Links with & or ?
Discussion in 'Google Sitemaps' started by qwikad.com, Jun 25, 2017.
I get an error when I try to add links containing & or ?. Is there a way to add those links anyway with a sitemap?
You have to properly escape them - https://www.w3schools.com/html/html_entities.asp - i.e. you should use &amp; instead of & in your URLs.
You have to do the same think when you use them in HTML - so I recommend validating your website too - https://validator.w3.org/.
No, you don't. A sitemap is XML, which demands that you encode them. But HTML does NOT demand that. There is no harm in doing it, of course, but there is no demand for it.
I use query string url all the time and have no problem with them. Google and Bing seem to handle them easily. I also use A! Sitemap Generator to make my site maps so it might just be you generators can't handle it.