What Is an XML Sitemap?
An XML sitemap is a structured file that lists URLs from a website that search engines may discover and crawl. It is particularly useful for large websites, websites with frequently updated content, and sites with pages that may not be easy to discover through internal links.
A sitemap does not guarantee that every listed URL will be crawled or indexed. Search engines use their own systems to decide which URLs to crawl and include in search results. A sitemap is a discovery aid, not a ranking shortcut.
Common Types of Sitemaps
XML Sitemap
A structured XML file containing URLs that you want search engines to discover and consider for crawling.
Sitemap Index
An XML file that references multiple individual sitemaps. It is useful for websites that organise URLs into separate sitemap files.
Image Sitemap
Provides additional information about images associated with website pages and can support image discovery.
Video Sitemap
Provides search engines with information about video content hosted or embedded on website pages.
News Sitemap
A specialised sitemap format for eligible news publishers to provide information about recently published news articles.
What Should a Good Sitemap Contain?
A useful sitemap should list important, canonical URLs that you want search engines to discover. Keep the file accurate and remove entries that no longer represent valid pages on your website.
- Correct URLs: Use complete, absolute URLs with the correct protocol and hostname.
- Canonical pages: Include the preferred version of each page rather than multiple duplicate URL variations.
- Accessible pages: Avoid including URLs that return errors, require authentication, or redirect to other destinations.
- Indexable content: Focus on pages that you want search engines to consider for indexing.
- Accurate lastmod values: Include last modification dates when they genuinely reflect meaningful page updates.
- Valid XML: Make sure the sitemap follows the supported XML sitemap format and can be parsed correctly.
- Useful organisation: Split large websites into multiple sitemap files and reference them through a sitemap index when appropriate.
Important XML Sitemap Tags
An XML sitemap commonly uses the following elements:
<urlset> identifies the collection of URLs in an XML sitemap.
<url> contains information about an individual URL.
<loc> specifies the absolute URL of a page.
<lastmod> optionally indicates the last meaningful modification date.
<sitemapindex> identifies a sitemap index containing references to other sitemap files.
<sitemap> contains the location of an individual sitemap within a sitemap index.
Older sitemap formats may contain changefreq and priority values. Google ignores these fields when processing XML sitemaps, so they should not be treated as ranking controls or guarantees of crawling frequency.
Common Sitemap Problems
Invalid XML
Malformed XML, missing required elements, or incorrect formatting can prevent a sitemap from being processed correctly.
Broken URLs
URLs returning errors or pointing to unavailable pages should be investigated and removed or corrected where appropriate.
Redirected URLs
A sitemap should generally contain the final canonical destination rather than URLs that redirect elsewhere.
Noindex Pages
Listing pages marked noindex can create conflicting signals about which URLs you want search engines to index.
Incorrect Last Modified Dates
Automatically changing lastmod values without meaningful content updates can make the information unreliable.
Oversized Sitemap Files
A single sitemap must follow the protocol limits for URL count and uncompressed file size. Large sites can use multiple sitemaps and a sitemap index.
How to Submit a Sitemap to Search Engines
- Generate an XML sitemap containing your important canonical URLs.
- Open the sitemap address in a browser to confirm that it is accessible.
- Check the file for XML errors, broken URLs, and unnecessary entries.
- Reference the sitemap location in your robots.txt file where appropriate.
- Submit the sitemap through Google Search Console for your verified website.
- Monitor the sitemap status and review any reported processing errors.
- Update the sitemap when important pages are added, removed, or meaningfully changed.
Submitting a sitemap helps search engines discover its URLs, but it does not guarantee that every URL will be crawled or indexed.
Sitemap Best Practices for WordPress Websites
Many WordPress SEO plugins and core WordPress features can generate XML sitemaps automatically. Check which sitemap your website is actually using before enabling another sitemap generator. Multiple competing sitemap systems can create confusion and unnecessary maintenance.
- Use one reliable sitemap generation method.
- Exclude unnecessary URLs such as duplicate archives or pages you do not want indexed.
- Make sure published articles and important pages are included.
- Check category, tag, author, and other archive settings against your indexing strategy.
- Verify that the sitemap updates when content is published or changed.
- Review sitemap status after plugin changes or website migrations.
Frequently Asked Questions
Does an XML sitemap improve search rankings?
A sitemap is primarily a discovery aid, not a direct ranking boost. It helps search engines find URLs, but rankings depend on many other factors, including content relevance, quality, and competition.
How many URLs can one XML sitemap contain?
A standard sitemap can contain up to 50,000 URLs and must not exceed 50 MB uncompressed. Larger websites should split their URLs across multiple sitemap files and use a sitemap index.
Where should I place my sitemap?
A sitemap can be hosted at a suitable accessible URL on your website, such as https://example.com/sitemap.xml. You can also declare its location in robots.txt and submit it through search engine webmaster tools.
Should noindex pages be included in a sitemap?
Generally, no. A sitemap should focus on canonical URLs that you want search engines to consider for indexing. Including noindex URLs can send conflicting signals about your indexing preferences.
Does Google guarantee indexing after sitemap submission?
No. Sitemap submission does not guarantee crawling or indexing. Google decides which URLs to crawl and include in its index based on its own systems and evaluation.
How often should I update my sitemap?
Keep your sitemap updated as important pages are added, removed, or meaningfully changed. Automated sitemap generators can handle this process when configured correctly.