Fix the sitemap format
Why it matters
The sitemap file cannot be read as a valid sitemap, so search engines will ignore it. The usual causes are an html page returned instead of the file, broken xml, or a wrong encoding.
The fix
- Open the sitemap and check it is xml and not an html page. If it is html, a catch-all rewrite or a login or error page is answering instead of the file.
- Check the xml is well formed, saved as UTF-8, with the sitemaps.org namespace, absolute URLs, and special characters escaped (an & in a URL must be written as &). Validate it with an xml validator or Google Search Console.
- Regenerate the file from your CMS or generator if it is built automatically, and make sure plugins print nothing before the xml declaration.
text
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://example.com/page?a=1&b=2</loc> </url> </urlset>
The examples use example.com. Replace it with your own domain.
Related
- Reported by the robots.txt and sitemap check
- Add a robots.txt file
- Fix the server error on robots.txt
- Fix the syntax of robots.txt
- Shrink the robots.txt file
- Allow search engines in robots.txt
- Publish an XML sitemap
- List the sitemap in robots.txt
- Make the sitemap reachable
- Put URLs into the sitemap
- Split the sitemap into several files
- Remove URLs from other domains in the sitemap
Scan your domain to see whether this applies to you.