Contact

SEO

WordPress XML Sitemap: How to Create It and Submit It to Google

Since WordPress 5.5, every site has an XML sitemap at /wp-sitemap.xml, and SEO plugins usually replace it with their own. This guide shows how to find your sitemap, what belongs in it, how to submit it in Search Console and how to fix common errors.

Illustration of a WordPress XML sitemap and submitting it to Google, with layers, file check, search, link and check icons
Contents

This guide is for WordPress site owners asking "where is my sitemap and how do I submit it?", agencies launching client sites, and anyone stuck with a "couldn't fetch" or 404 error in Search Console. We cover what a sitemap is, how WordPress creates one, how to find your sitemap URL, what belongs in it and what doesn't, how to submit it, and how to fix the most common errors. If you haven't done the basic setup yet, start with our WordPress SEO settings guide.

What is an XML sitemap, and what is a sitemap index for?

An XML sitemap is a machine-readable file that lists the URLs on your site you want search engines to know about, optionally with their last-modified dates and images. It is written for crawlers such as Googlebot, not for visitors. A single product entry looks roughly like this:

<url> <loc>https://examplefurniture.com/product/oak-dining-table/</loc> <lastmod>2026-11-20T10:00:00+00:00</lastmod> <image:image> <image:loc>https://examplefurniture.com/wp-content/uploads/oak-table.jpg</image:loc> </image:image> </url>

On larger sites the URLs don't fit in one file, or you want them split by type. That's where a sitemap index comes in: it lists other sitemaps rather than URLs, so posts, pages, products and categories each live in their own file. According to Google's documentation, a single sitemap can hold up to 50,000 URLs and 50 MB uncompressed; larger sites split their sitemaps and group them in an index.

What a sitemap does and doesn't do

  • What it does: helps new and updated pages get discovered faster, surfaces pages with weak internal linking, and lets you monitor page groups separately in Search Console.
  • What it doesn't: guarantee indexing or improve rankings directly. Google treats the URLs as a hint.
  • Who benefits most: new sites, large online stores, archives with weak internal links, and news or blog sites that update often.
Sitemap structure: robots.txt, sitemap index, child sitemaps by type, page URLs and image entries
The index lists other sitemaps; child sitemaps list page URLs and images.

How do you create a sitemap in WordPress?

Most of the time you don't have to do anything: WordPress has shipped a built-in XML sitemap since version 5.5, published automatically at /wp-sitemap.xml. Once you install an SEO plugin, the plugin usually switches the core sitemap off and generates its own.

The built-in WordPress sitemap

The core sitemap lists posts, pages, public custom post types, category and tag archives, and author pages. There is no settings screen; changing what's included takes developer filters. It doesn't include image entries, and by default it lists pages most sites don't need indexed, such as author archives. It can be enough for a small company site, but once you need exclusions, a plugin sitemap is more practical.

Sitemaps from SEO plugins

Plugins such as Yoast SEO, Rank Math and All in One SEO generate their own sitemaps and let you exclude post types, taxonomies or individual posts from the dashboard. Most also add image entries. We compare these plugins more broadly in Yoast vs Rank Math vs free alternatives; URLs and options can change between versions, so check your plugin's own documentation.

Core sitemap vs plugin sitemap
CriterionWordPress coreSEO plugin
Default URL/wp-sitemap.xmlVaries by plugin, often /sitemap_index.xml or /sitemap.xml
Settings screenNone, code filters onlyYes; exclude by post type or individual post
Image entriesNoIn most plugins
Noindex pagesNot excluded by a settingUsually excluded automatically
Best forSmall, simple sitesMost sites that need control

One important rule: keep a single sitemap source. If two plugins, or a plugin and core, both generate sitemaps, submit only one to Search Console and switch the other off.

Table comparing the WordPress core sitemap and an SEO plugin sitemap by URL, settings, images and noindex handling
The core sitemap suits simple sites; a plugin sitemap wins when you need control.

How do you find your WordPress sitemap URL?

The quickest way to find your sitemap is to add the common paths to your domain one at a time and open them in a browser. Whichever URL shows XML or a readable list is your active sitemap.

  1. Open https://yourdomain.com/robots.txt; most plugins write the sitemap URL there on a Sitemap: line.
  2. Try /sitemap_index.xml (the usual path for Yoast SEO and Rank Math).
  3. Try /sitemap.xml (used by some plugins and redirects).
  4. Try /wp-sitemap.xml (WordPress core).
  5. Still nothing? Check your SEO plugin's sitemap settings, where the URL is shown.

If none of them load, first check the "Discourage search engines from indexing this site" box under Settings → Reading. While it is ticked, WordPress doesn't publish the core sitemap. It is often left ticked on freshly launched sites; our guide to moving WordPress from localhost to a live server explains why it belongs on your launch checklist.

What should go in your sitemap, and what should stay out?

Your sitemap should contain only pages you want in search results: URLs that return a 200 status code, are canonical and can be indexed. A sitemap is a list that says "these pages matter"; every weak or broken URL in it dilutes that signal.

What to include

  • Core business pages such as services, products and categories.
  • Blog posts and guides.
  • The home page and company pages like About and Contact.
  • Important images on products and posts (as image entries).

What to leave out

  • Noindex pages: saying "don't index this" while listing it in the sitemap sends a contradictory signal.
  • Thin archives: tag pages with a single post, author archives on single-author sites, date archives.
  • Attachment pages: pages WordPress creates for each image that only show the image; most SEO plugins redirect them to the file.
  • Page-builder templates: template library entries from tools like Elementor or Divi aren't pages for visitors.
  • Thank-you, cart, checkout and account pages, plus filter and internal search URLs.
  • Redirected or broken URLs: anything returning 301, 404 or 5xx shouldn't be listed.

Take an online furniture store with 400 products. Product and category pages belong in the sitemap; colour-filter URLs, cart and checkout pages, attachment pages for product photos and the designer's Elementor template entries don't. Getting this right means the "submitted URLs" count in Search Console reflects the pages you actually want indexed.

Sitemap clean-up checklist: canonical 200 pages, excluding noindex, thin archives, attachment pages and page-builder templates
Clean your sitemap with this list before you submit it.

How do you submit your sitemap to Google?

There are two official ways to submit a sitemap to Google: add its URL in the Sitemaps report in Google Search Console, and add a Sitemap: line to your robots.txt. We recommend doing both; one tells Google directly, the other lets every search engine find it.

Step by step in Search Console

  1. Open your site's property in Google Search Console; if you don't have one, create and verify a domain property.
  2. In the left menu, go to Indexing → Sitemaps.
  3. Enter the sitemap URL under "Add a new sitemap" (for example sitemap_index.xml) and click Submit.
  4. Wait for the status to read "Success"; this can take anywhere from minutes to a few days.
  5. If you use an index, submitting the index is enough; the child sitemaps are listed separately in the report.

Referencing it in robots.txt

Add one line with the full URL to your robots.txt: Sitemap: https://yourdomain.com/sitemap_index.xml. This also helps other search engines, Bing included, find your sitemap. Most SEO plugins add the line to WordPress's virtual robots.txt automatically; if there is a physical robots.txt file on the server, the plugin's line may not appear, so open the file in a browser and check.

The ping endpoint is gone

The google.com/ping?sitemap= URL found in older guides has been retired; Google explained this in 2023 when it announced the deprecation of the sitemaps ping endpoint. In the same post Google said it does use lastmod on sites that keep it consistently accurate. So rather than bumping lastmod every day, change it only when the content really changes.

IndexNow in brief

IndexNow is an open protocol that notifies participating search engines, such as Bing and Yandex, the moment a URL changes. Google doesn't use IndexNow; for Google, your sitemap plus Search Console is enough. If Bing traffic matters to you, turn IndexNow on as a complement to your sitemap.

Steps to submit a sitemap to Google: find the URL, check it in a browser, add it in Search Console, add a robots.txt line, monitor
Submitting takes minutes; the real value comes from checking the report regularly.

How do you read the Sitemaps report in Search Console?

The Sitemaps report shows the status, last read date and number of discovered URLs for each sitemap you've submitted. "Success" means the sitemap was read; it doesn't mean the pages were indexed.

Success
The sitemap was read and processed. Compare the discovered URL count with what you expect.
Couldn't fetch
Google couldn't download the sitemap. It can appear briefly for newly submitted sitemaps; if it persists, check the URL, access and firewall settings.
Has errors
The sitemap was read but contains problems such as format errors, invalid dates or URLs on another domain.

To see what happened to the pages in a sitemap, click it in the report and open the page indexing view. Reasons such as "Crawled – currently not indexed" or "Excluded by 'noindex' tag" tell you whether the sitemap itself needs cleaning. If you see noindex pages listed, the sitemap is the problem; if good pages aren't getting indexed, the cause is more likely content or internal linking.

How to interpret the numbers

Picture a dental clinic site with 12 service pages, 40 blog posts and a handful of company pages. You would expect around 60 discovered URLs. If the report shows 300, tag archives, attachment pages or template entries have leaked into the sitemap; if it shows 20, a content type may have been excluded by mistake. Either way, open the sitemap in a browser, find the child sitemap with the unexpected count, and fix the exclusion settings in your plugin. You don't need to resubmit afterwards; Google processes the updated file the next time it reads the same URL.

Common mistakes and how to fix sitemap errors

Most sitemap problems come down to four causes: the wrong URL, rewrite rules, caching and blocked access. The table below summarises the most common symptoms and where to look first.

Sitemap errors: symptom, cause and fix
SymptomLikely causeFix
Sitemap returns 404Rewrite rules are stale, or you're trying the wrong URLGo to Settings → Permalinks and click Save without changes; confirm the URL in robots.txt
404 on an Nginx serverThe server doesn't pass XML requests to WordPressAdd the Nginx rules from your plugin's documentation to the server config
"Couldn't fetch" in Search ConsoleFirewall, bot protection or the wrong propertyMake sure Googlebot isn't blocked; check http/https and www
Outdated content in the sitemapA page cache is caching the sitemap tooExclude sitemap URLs from the cache and purge it
"Sitemap is HTML" errorThe URL redirects to an error or login pageTest the URL logged out, in a private window
XSL/XSLT warning in the browserThe sitemap uses an XSL stylesheet for displayThe warning is browser-side; Google reads the raw XML, though an XSL-free setup avoids it

Fixing a Rank Math or Yoast sitemap 404

When a plugin sitemap returns 404, the first step is to re-save your permalink settings, which refreshes WordPress's rewrite rules. If that doesn't help, check whether another plugin (a second SEO plugin or an old sitemap plugin) claims the same URL, whether the plugin's sitemap feature is switched on, and whether the server runs Nginx. When you try /wp-sitemap.xml on such a site, it often redirects to the plugin's sitemap or is disabled; that's expected.

Other frequent mistakes

  • Old domain in the sitemap after a migration: purge the page cache and the plugin's sitemap cache, then submit the new domain's sitemap in Search Console.
  • Mixing http and https properties: submit the sitemap under the protocol and host the site actually uses.
  • A lastmod that changes daily: updating the date without changing content can teach Google to ignore the field.
  • Submit and forget: review the sitemap whenever you add new post types, plugins or page builders.

If you'd like to audit your sitemap alongside robots.txt, canonicals and redirects, our technical SEO checklist walks through these checks under crawlability.

Sitemaps with Doruva SEO

Doruva's free plugin Doruva SEO generates paginated, cached XML sitemaps that include images, and lets you exclude content you don't want listed. The sitemap is one of the modules you can switch on or off from the plugin's Dashboard; a disabled module loads no code.

  • Page-builder templates stay out (1.0.3): template libraries from Elementor, ElementsKit, Divi, Beaver Builder, Oxygen, Bricks and others are kept out of the sitemap and always get noindex.
  • The cache refreshes itself (1.0.3): the sitemap cache is rebuilt automatically when the plugin is updated.
  • No XSL stylesheet (1.0.4): because sitemaps no longer use XSL, Chrome doesn't show visitors a "this site uses XSLT" warning. Logged-in users see the sitemap as a readable table; search engines get the usual XML.
  • Supporting modules: a robots.txt editor, sitemap management through wp doruva-seo WP-CLI commands, and optional IndexNow, which is off by default.

The plugin is completely free, with no Pro version, and is coming soon to WordPress.org. You can follow its status on our WordPress plugins page; features can change between versions, so check the current list on the product page before installing. Whichever plugin you use, open the sitemap URL in a browser after setup and submit it in Search Console.

Doruva SEO dashboard: overview, a site SEO score of 70/100 and module cards that switch on and off
The Doruva SEO dashboard: switch modules, including sitemaps, on or off here.

Summary and next steps

Your WordPress site already has a sitemap: core publishes one at /wp-sitemap.xml, and SEO plugins generate their own. Your job is to pick one source, list only the pages you want indexed, submit the URL in Search Console, reference it in robots.txt and check the report regularly.

A good sitemap isn't the longest list but the cleanest one: every URL in it should return 200, be canonical and be a page you genuinely want indexed.

For a quick read on your site's crawlability, try our free SEO checker. If you'd like help untangling sitemap, indexing and technical SEO issues, take a look at our SEO services and tell us about your site.

Frequently Asked Questions

Can Google find my site without a sitemap?

Yes. Google also discovers pages by following links, so small sites with solid internal linking can be crawled without one. A sitemap still helps new and updated pages get noticed sooner and makes monitoring in Search Console easier.

How often should I resubmit my sitemap?

As long as the URL stays the same, you don't need to; Google rereads submitted sitemaps regularly. Submit again only when the domain, protocol or sitemap URL changes.

Both /wp-sitemap.xml and /sitemap_index.xml load. Which one do I submit?

Submit the sitemap from the SEO plugin you use and make sure the other is switched off. Two sources create duplicate and conflicting URL lists in Search Console.

Why wasn't a page in my sitemap indexed?

A sitemap doesn't guarantee indexing; Google weighs quality, duplication and technical signals. The page indexing report in Search Console shows why a page was left out.

Do I need a separate image sitemap?

Most SEO plugins add images inside each page's entry, so a separate image sitemap usually isn't needed. On online stores and portfolio sites that expect image search traffic, check that image entries are actually present.

Let’s apply this to your project.

Let’s look together at how the approach in this article applies to your own website, search visibility or digital systems.