XML, or Extensible Markup Language, is a structured file format and markup language that defines rules for encoding documents so they are readable by both humans and machines.
This information is primarily read by individuals focused on Search Engine Optimization (SEO) who need to ensure search engine crawlers can properly access and index all of a website's content.
External context
For those managing web pages, understanding XML means knowing how to structure your site’s data using standardized rules. This capability allows you to create specific files, such as sitemaps, which list your URLs for search engines to efficiently crawl and index. Essentially, it helps transmit complex information in a machine-readable format.
XML Wikipedia contributors, “XML”, en.wikipedia.orgLicence01What it is and how it works
XML, short for Extensible Markup Language, is a generic format that defines rules for structuring data with tags. In SEO, XML is used almost exclusively for sitemaps: a file that lists the URLs you want search engines to crawl. The file typically contains a set of ` entries, each with a tag for the URL and optional tags like for the last modification date, for how often the page changes, and for relative importance. You place the file at a predictable address, such as https://example.com/sitemap.xml`, and tell search engines about it. When a crawler fetches the file, it parses the XML, reads the URLs, and adds them to its crawl queue. The format is strict: every tag must be closed and the file must be well-formed, otherwise the crawler may ignore it.
XML is a way to write down a list of your website's URLs so search engines can find them easily.
02What to do about it
To get value from XML, create a sitemap and keep it current. Use a plugin or generator to produce the file automatically, or hand-code it if your site is small. Include only canonical URLs, skip tracking parameters and session IDs. Keep the file under 50 MB and under 50,000 URLs; if you exceed that, split it into multiple files and use a sitemap index. Submit the sitemap in Google Search Console under the 'Sitemaps' section. Also add a Sitemap: line to your robots.txt file, like Sitemap: https://example.com/sitemap.xml. After submission, monitor the report for errors and update the sitemap whenever you add or remove significant pages.
03How it is measured or noticed
You can measure an XML sitemap's effectiveness in a few ways. In Google Search Console, the 'Sitemaps' report shows the submission date, status, and the number of discovered URLs. The 'Indexing' report then shows how many of those URLs are actually indexed. A large gap between submitted and indexed may indicate content issues or duplicate pages. You can also check server logs for requests to the sitemap file from crawlers; a recent fetch means the crawler is reading it. A healthy sitemap shows a high discovery rate and few errors.
04Common mistakes
Avoid these common mistakes when working with XML sitemaps:
- Including URLs that return 404 or redirect to a different page.
- Listing duplicate or near-duplicate URLs, such as session IDs or tracking parameters.
- Using
lastmodincorrectly or failing to update it when a page changes. - Placing the sitemap in a directory blocked by
robots.txt. - Submitting a sitemap that exceeds the 50 MB or 50,000 URL limit.
- Writing malformed XML, like unclosed tags or invalid characters.
05Limits and confusions
XML sitemaps are a discovery aid, not a ranking factor. They tell search engines which URLs exist, but they don't guarantee indexing or ranking. They are often confused with HTML sitemaps, which are user-facing pages of links, or with RSS feeds, which are for content syndication. XML sitemaps also do not solve duplicate content issues; you still need canonical tags and proper redirects. If your site is small and well-linked, you may not need an XML sitemap at all. For large sites, they are essential but require regular maintenance to stay useful.
06A worked example
Here is a minimal XML sitemap for a two-page site:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2025-01-01</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/about</loc>
<lastmod>2025-01-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
The entry above is written by GetLoopLoop. What follows is what independent catalogues hold about the same term — none of it is the source of this page.
- Also called
- eXtensible Markup Language, Extensible Markup Language
- Introduced
- 1998
- Developed by
- World Wide Web Consortium
- Builds on
- Standard Generalized Markup Language, The Unicode® Standard
- Kind of thing
- markup language, file format, data serialization format
The same term on Wikipedia
Catalogued in 80 languagesFrequently asked questions
What's the difference between an XML sitemap and an HTML sitemap?
An XML sitemap is a machine-readable file that lists URLs for search engines to crawl, while an HTML sitemap is a human-readable page that helps visitors navigate. XML sitemaps are the primary tool for SEO, as they directly communicate your site's structure to crawlers. HTML sitemaps are less critical and mainly for user experience.
Should I create an XML sitemap for my site?
Yes, you should create an XML sitemap if your site has more than a few pages, especially if it's new, has few external links, or uses rich media. It's also important for large sites or those with isolated pages that are hard to discover. Most SEOs recommend it as a standard practice.
How do I create and submit an XML sitemap?
You can generate an XML sitemap using a CMS plugin, a sitemap generator tool, or write it manually. Once created, upload it to your site's root directory and submit it via Google Search Console and Bing Webmaster Tools. Keep it updated whenever you add or remove pages.
Does an XML sitemap still matter for SEO?
Yes, XML sitemaps still matter for discovery, though they are not a ranking factor. They help search engines find and crawl your pages more efficiently, especially if you have a large site or new content. They're particularly useful for sites with weak internal linking.
What happens if I don't update my XML sitemap?
If you don't update your XML sitemap, search engines may still crawl your site but might miss new pages or waste time on removed ones. This can slow down indexing of new content and cause 404s for deleted URLs. Regularly updating it ensures your site's visibility stays accurate.
How long does it take for an XML sitemap to affect indexing?
It can take anywhere from a few days to several weeks for search engines to process a new or updated XML sitemap. The effect depends on your site's crawl budget, authority, and how often you submit it. You can check the sitemap status in Search Console to track progress.
Wikimedia Commons
Related visuals with source and licence credit

Asked out loud
spoken, not typedThe same term in the words somebody uses speaking to an assistant rather than typing into a box — written from the situation, which is why each one carries the situation it came from.
Yes, you should create an XML sitemap and submit it to Google Search Console. That's the fastest way to tell Google your pages exist. Make sure the sitemap is current and includes all your important URLs.
Check if your XML sitemap is valid and up to date, and that it's submitted in Search Console. Often the issue is a stale sitemap or a robots.txt file blocking crawlers. Fix those and request indexing for the affected pages.
Update your XML sitemap to include the new URL, then use the URL Inspection tool in Search Console to request indexing. That's the most direct way. It usually gets picked up within a few days.