Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Explainers · Explainer

What Is an XML Sitemap? A Plain Explanation

What Is an XML Sitemap? A Plain Explanation

Short answer

An XML sitemap is a file that lists the pages on your site so search engines can find and crawl them. WordPress builds one for you at /wp-sitemap.xml, and Yoast SEO builds its own at /sitemap_index.xml. A sitemap is only a hint to search engines, not a promise that a page will be indexed.

Key takeaways

  • An XML sitemap is a file that lists your pages so search engines can find and crawl them.
  • One sitemap can hold at most 50,000 URLs or 50 MB uncompressed, and larger sites must split the list.
  • Google ignores priority and changefreq tags, but uses an accurate lastmod date.
  • WordPress 5.5 and later builds a sitemap index at /wp-sitemap.xml, with at most 2,000 entries per file.
  • Yoast SEO builds its own index at /sitemap_index.xml, with a default limit of 1,000 items per sitemap.
  • Submitting a sitemap is only a hint to Google, not a promise that a page will be indexed.

What is an XML sitemap?

An XML sitemap is a file that lists the pages on your site so search engines can find and crawl them.

XML stands for Extensible Markup Language, and the file is written in that format. Sitemaps.org describes a sitemap as an easy way for site owners to tell search engines about pages that are ready for crawling, with extra data about each URL.

The file lives on your site, usually at an address such as yourdomain.com/sitemap.xml. Search engines read it when they visit, and they use it to learn about pages they might miss through links alone.

A sitemap is a hint, not an order. Google Search Central states that submitting a sitemap does not guarantee that Google will download it or use it for crawling, but it gives crawlers a clear list to work from.

How does an XML sitemap work?

A search engine reads your sitemap, takes the list of URLs from it, and adds those URLs to its crawl list.

Crawlers usually find pages by following links inside your site and on other sites. Sitemaps.org explains that sitemaps add to that data, so crawlers that support the protocol can pick up every URL in the file and learn about each one from its metadata.

Each entry can carry a last modified date, so the crawler can see which pages changed. Google Search Central says Google uses the lastmod value when it is consistently and verifiably accurate.

The file can also point to image, video, and news content. Google Search Central notes that the XML format is the most flexible of the formats it supports, because its extensions can carry extra data about images, video, news, and localized versions of pages.

What goes inside an XML sitemap?

Each entry in an XML sitemap holds a page URL, and it can also hold the date the page last changed.

The only required tag is loc, which holds the full URL of the page. Make WordPress Core notes that WordPress lists only the URL itself by default, because the other tags are optional in the protocol and search engines do not usually use them.

Google ignores two tags that many site owners still fill in. Google Search Central states that Google ignores priority and changefreq values, so setting them does not change how often Google crawls a page.

Use full, absolute URLs in every entry. Google Search Central warns that Google will try to crawl your URLs exactly as listed, so a relative address such as /mypage.html will not work. Use the complete address instead.

FormatWhat it listsBest for
XML sitemapURLs, plus image, video, and news dataMost WordPress sites
RSS, mRSS, and Atom 1.0Recent URLs, plus video dataSites with feeds already running
Text sitemapOne URL per line, nothing elseVery large sites that need a simple list

Why does an XML sitemap matter for WordPress?

A sitemap matters for WordPress because it helps search engines find new and buried pages faster.

WordPress builds a sitemap for you, so you do not have to write one by hand. Make WordPress Core explains that WordPress 5.5 added basic XML sitemap support to core, and it covers all public post types and taxonomies, author archives, and the homepage.

That matters most for large sites and new posts. A new post may have few links pointing to it, and a deep archive page may sit far from the homepage, so the sitemap gives crawlers a direct list instead of making them hunt through links.

The sitemap also tells search engines which URLs you prefer. Google Search Central says a sitemap should list the canonical URLs you want in search results, and when the same content lives at more than one address, you should list the one you prefer.

Our guide on how to create an XML sitemap in WordPress walks through the options when the built-in sitemap is not enough for your site.

How do you find your WordPress sitemap?

Open yourdomain.com/wp-sitemap.xml in a browser to see the sitemap WordPress builds for you.

That address is the sitemap index, a short file that links to smaller sitemaps for posts, pages, categories, and authors. Make WordPress Core states that WordPress exposes the index at /wp-sitemap.xml, and the index can hold a maximum of 50,000 sitemaps.

If you use Yoast SEO, the address is different. Yoast's developer docs state that the index file should be at /sitemap_index.xml, and requests to /sitemap.xml should redirect there.

If the core sitemap shows an error, check two things. WordPress needs the SimpleXML PHP extension to render sitemaps, and Make WordPress Core notes that without it, WordPress shows an error message and sends a 501 status code.

Also check Settings, Reading: if you asked WordPress to discourage search engines, sitemaps are switched off.

Our guide on fixing a sitemap that is not working covers the common causes when the file will not load.

How do you submit a sitemap to Google?

Submit your sitemap index in Google Search Console, or list it in your robots.txt file.

Search Console is the clearest route. Google Search Central says you can submit a sitemap through the Sitemaps report, which also shows when Googlebot read the file and flags processing errors.

The robots.txt route needs no account. Google Search Central explains that you can add a line such as Sitemap: https://example.com/sitemap.xml anywhere in robots.txt, and Google will find it the next time it crawls that file. You can list more than one sitemap this way, with no limit on the count.

WordPress already points search engines at its own sitemap. Make WordPress Core notes that the robots.txt file WordPress generates references the sitemap index, so search engines can discover it without a manual submission.

Our guide on how to edit robots.txt in WordPress shows where the file lives and how to add a sitemap line to it.

What are the size limits for a sitemap?

One sitemap can hold at most 50,000 URLs or 50 MB uncompressed, and larger sites must split the list.

That limit comes from the sitemaps protocol and applies to every format. Google Search Central states that if you have a larger file or more URLs, you must break the sitemap into several sitemaps, and you can group them with a sitemap index file.

WordPress sets a lower limit per file. Make WordPress Core states that a single sitemap can hold a maximum of 2,000 entries, and the index can hold a maximum of 50,000 sitemaps, which is far more than most sites need.

Yoast SEO splits its sitemaps even earlier. Yoast's developer docs set a default limit of 1,000 items per sitemap, and generate extra sitemaps, up to 50,000 of them, when a content type passes that count.

What mistakes should you avoid with a sitemap?

Do not list pages you want hidden, broken links, or duplicate versions of the same content.

Every URL in a sitemap should be a page you want in search results. Yoast's developer docs list pages that must stay out, including pages with a noindex directive, private or password-protected pages, search results pages, and paginated archive pages such as /blog/page/2/.

Do not list the same page twice under different addresses. Google Search Central advises that when the same content is reachable at more than one URL, you should pick the one you prefer and list that one only.

Our guide to the best permalink structure for SEO explains how to keep one clean address per page.

Keep the file fresh. Google Search Central notes that a sitemap must be UTF-8 encoded, and if a sitemap lists a page that no longer exists, crawlers waste time on a dead link instead of your live pages.

How do you check that your sitemap works?

Open the sitemap URL in your browser and check that it loads, lists live pages, and has no errors.

Start with the index. If /wp-sitemap.xml shows a list of links to smaller sitemaps, the core sitemap is working, and each child sitemap should open to a list of URLs with last modified dates.

Then check Search Console. The Sitemaps report shows whether Google could read the file, how many URLs it found, and any errors it hit, so you can fix a broken file before it costs you crawls.

Watch for the common failures. A 404 means the sitemap file is missing or the plugin that made it is off, a 501 points to the missing SimpleXML extension, and a sitemap full of noindex pages means your index settings need a review.

Our guide on fixing a Yoast sitemap 404 covers the plugin case step by step.

Frequently asked questions

Does an XML sitemap guarantee that Google will index my pages?

No. A sitemap points search engines at your pages, but Google decides which pages to index. Google Search Central states that submitting a sitemap is only a hint and does not guarantee that Google will download it or use it for crawling.

Should I set the priority and change frequency for each page?

No. Google ignores the priority and changefreq tags, so filling them in changes nothing. The lastmod date is the tag worth keeping accurate, because Google uses it when it is consistently and verifiably correct.

How do I find my WordPress sitemap?

Open yourdomain.com/wp-sitemap.xml in a browser. If it loads, the core sitemap is working. If you use Yoast SEO, open yourdomain.com/sitemap_index.xml instead, because Yoast replaces the core sitemap with its own index.

Do I need a plugin for a sitemap on WordPress?

Yes. WordPress 5.5 added XML sitemaps to core, and most sites need nothing else. A plugin is worth it only when you need image, video, or news sitemaps, which core does not build, or finer control over what is listed.

My sitemap shows errors in Search Console. What should I do?

Check the Sitemaps report in Google Search Console. It shows whether Google could read the file, how many URLs it found, and any errors. Fix the error shown there, then resubmit the sitemap index.

Sources

  1. Build and Submit a Sitemap Google Search Central
  2. Sitemaps XML Format Sitemaps.org
  3. New XML Sitemaps Functionality in WordPress 5.5 Make WordPress Core
  4. Yoast SEO XML Sitemaps: Functional Specification Yoast Developer Portal

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.