An XML sitemap is a file, usually called sitemap.xml, that lists the important URLs of your website in a format search engines can read, so Google and Bing can find and crawl your pages faster. WordPress creates one automatically at /wp-sitemap.xml, and SEO plugins replace it with their own, often at /sitemap_index.xml.
Search engines find pages mainly by following links. A sitemap helps them find pages that are new, deep in your site structure, or have few links pointing to them. That makes it especially useful for new websites and for large sites with hundreds of pages. A sitemap does not guarantee that a page gets indexed, but it makes sure Google knows the page exists.
XML sitemap example
This is what a small sitemap.xml file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2026-11-10</lastmod>
</url>
<url>
<loc>https://example.com/about/</loc>
<lastmod>2026-09-02</lastmod>
</url>
</urlset>
Each <url> entry has:
- <loc>: the full URL of the page. This is the only required field.
- <lastmod>: the date the page last changed in a meaningful way. Google uses it when it is consistently accurate.
- <changefreq> and <priority>: optional fields that say how often a page changes and how important it is. Google has said it ignores both, so you do not need to worry about them.
One sitemap file can hold up to 50,000 URLs and may be up to 50 MB uncompressed. Use full, absolute URLs and save the file as UTF-8.
What is a sitemap index?
A sitemap index is a sitemap of sitemaps. Instead of one big file, your site gets separate sitemaps for posts, pages, categories and so on, and the index file lists them all. This is what most WordPress SEO plugins create:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/post-sitemap.xml</loc>
</sitemap>
<sitemap>
<loc>https://example.com/page-sitemap.xml</loc>
</sitemap>
</sitemapindex>
You only need to submit the index file. Search engines find the sitemaps inside it on their own.
What to include and exclude
Only put URLs in your sitemap that you want to show up in Google. Include:
- Your pages, posts, products and other important content.
- Only the canonical version of each URL, with https and your preferred www or non-www.
Leave out:
- Pages with a noindex tag.
- URLs that redirect or return an error.
- URLs blocked in robots.txt.
- Duplicate pages, internal search results, cart, checkout and account pages, and thank you pages.
- Thin archives you do not want in Google, such as empty tag pages or media attachment pages.
XML sitemaps in WordPress
Since WordPress 5.5, WordPress creates a basic sitemap for you at yoursite.com/wp-sitemap.xml. It works, but you cannot control much about it.
When you install an SEO plugin, it usually switches off the WordPress sitemap and creates its own, with more control over what is included. SureRank, Yoast SEO and Rank Math all create a sitemap index at yoursite.com/sitemap_index.xml. These plugins normally leave pages you set to noindex out of the sitemap. I show how to set this up in my SureRank tutorial.
Not sure where your sitemap is? Try /sitemap_index.xml, /sitemap.xml and /wp-sitemap.xml after your domain, or look in your robots.txt file.
How to submit your sitemap to Google and Bing
Google Search Console
- Log in to Google Search Console and select your website.
- Click Sitemaps in the left menu.
- Type the sitemap address, for example sitemap_index.xml, and click Submit.
- Check that the status says Success and how many URLs were discovered.
You only do this once. Google comes back to your sitemap by itself to look for new and updated pages.
Bing Webmaster Tools
In Bing Webmaster Tools, add your site, go to Sitemaps, click Submit sitemap and paste the full URL. Bing also lets you import your site from Google Search Console, which saves time.
Add your sitemap to robots.txt
You can also point all search engines to your sitemap with one line in your robots.txt file. Use the full URL:
User-agent: * Disallow: Sitemap: https://example.com/sitemap_index.xml
Many SEO plugins add this line to the virtual robots.txt of WordPress for you.
Common sitemap errors
- “Couldn’t fetch” in Search Console: often temporary. Open the sitemap URL in your browser to check it loads, and check that a security plugin or firewall is not blocking Google.
- Two sitemaps at once: the WordPress sitemap and a plugin sitemap both active, or two SEO plugins installed. Use one SEO plugin and submit only its sitemap.
- Noindexed or redirected URLs in the sitemap: these send mixed signals. Remove them.
- A cached or old sitemap: exclude your sitemap from your caching plugin so it always shows new pages.
- “Search engine visibility” ticked: under Settings, Reading in WordPress, the option to discourage search engines must be off on a live site.
- Invalid XML: stray spaces or PHP output before the first line break the file. A plugin or theme conflict is usually the cause.
Frequently asked questions
Does every website need an XML sitemap?
A small site with good internal links can be found without one. But a sitemap costs nothing in WordPress and helps Google find new pages faster, so I always use one.
What is the difference between sitemap.xml and sitemap_index.xml?
A sitemap.xml file usually lists pages directly. A sitemap_index.xml file lists other sitemaps. Both work. Just submit the one your website actually uses.
How do I find the sitemap of a website?
Add /sitemap.xml, /sitemap_index.xml or /wp-sitemap.xml to the domain, or open /robots.txt and look for the Sitemap line.
Related: Technical SEO, Indexing, Robots.txt

Learn more about XML Sitemap
Want to see this in practice? These free tutorials show it step by step:
- SureRank Tutorial
- Complete Yoast SEO Tutorial | SEO For Beginners
- How To Switch From Yoast SEO to Rank Math
Want AI to do the work? Use the free SEO and AI search optimization prompt.