Mobile app version of vmapp.org
Login or Join
Lee4591628

: & in sitemap links, are they correct? Simple question, I'm asking just to make sure. A Google sitemap generator generated a sitemap.txt fle with links written like this: http://www.domain.com/category.htm?name=some-name&

@Lee4591628

Posted in: #Links #Sitemap

Simple question, I'm asking just to make sure.

A Google sitemap generator generated a sitemap.txt fle with links written like this:
www.domain.com/category.htm?name=some-name&cat_id=8

is it correct to use the & in these links in place of the & or it's just an error made by the sitemap generator?

Thanks.

10.05% popularity Vote Up Vote Down


Login to follow query

More posts by @Lee4591628

5 Comments

Sorted by latest first Latest Oldest Best

 

@Deb1703797

Google rejects the sitemap as broken if it has a & character in an URL. It accepts it when you replace & with &

BUT: if you later check the list of crawling errors in the Google webmasters tool, it will report this URL of the sitemap file as broken, because it contains & instead of &.

Thus the correct solution is to change the URL such that it does not contain &. Or report this as bug to Google.

10% popularity Vote Up Vote Down


 

@Yeniel560

You can also convince yourself by checking


this sitemaps and ampersands article
official XML sitemaps protocol page


You can't really argue against the official xml sitemaps protocol page :)

10% popularity Vote Up Vote Down


 

@Ravi8258870

URL-Encoding and XML entity encoding are not the same things.
You need URL-Encoding to replace special characters in URLs, such as & which can only be used for the separation of query parameters.
XML entity encoding is for encoding special characters in XML (also XHTML). This means, if you have a URL in an XML (or XHTML) file, and this URL includes some & characters, you have to entity encode it to &. So in a sitemap.xml you will have urls like in the question from Marco Demaio.

10% popularity Vote Up Vote Down


 

@Phylliss660

Your Sitemap file must be UTF-8 encoded (you can generally do this when you save the file). As with all XML files, any data values (including URLs) must use entity escape codes for the characters.

This may help out, sitemaps.org/protocol.php

10% popularity Vote Up Vote Down


 

@Sarah324

That is correct. It is the HTML entity for an ampersand (&) and is the proper character representation of it in a properly encoded URL. Ampersands (&) and well as < and > are special characters in XML and HTML and need to be displayed using their special character entities.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme