How to check your sitemap.xml for errors
A sitemap helps search engines find your pages, but a messy one can waste their time. Here is what a good sitemap contains and the mistakes to look for.
Published · Updated
Put this into practice
What does a sitemap do?
A sitemap is an XML file, usually at yourdomain.com/sitemap.xml, that lists the pages you want search engines to find. It helps them discover pages faster, especially new pages and pages with few links pointing at them. It does not guarantee that a page will be indexed or ranked.
What belongs in it?
List the pages you want people to find, using their final addresses. Leave out:
- Pages that redirect somewhere else
- Pages blocked in robots.txt or marked noindex
- Duplicate versions of the same page
- Pages that return an error
What are the most common mistakes?
- Listing the same address more than once
- Using relative addresses such as /about instead of full addresses
- Mixing http and https, or listing addresses from a different host than the sitemap
- Dates in the lastmod field that are not valid dates, or that change on every visit
- Going past the limits: 50,000 addresses or 50 MB for one file. Larger sites use several sitemaps listed in a sitemap index
How do you tell search engines about it?
Add a Sitemap line to robots.txt, and submit the address in Google Search Console and Bing Webmaster Tools. Then check the reports there to see which pages were found and which were skipped, and why.
Frequently asked questions
Does every site need a sitemap?
Small, well-linked sites can be crawled without one. A sitemap still helps, costs little, and is useful for finding errors.
Does a sitemap improve my ranking?
Not directly. It helps pages get discovered. Ranking depends on the pages themselves.