WordPress XML Sitemap Guide - Configure, Submit, and Optimise

A correctly configured XML sitemap helps Google crawl your content efficiently. How to configure, validate, and submit your WordPress sitemap.

Dobromir Dechev
Dobromir WordPress agency owner

Quick answer

WordPress generates a sitemap at /wp-sitemap.xml by default, and Yoast or Rank Math replace it with their own. Include only indexable, canonical URLs — excluding tag archives, paginated pages and attachment pages is usually the fix that matters.

An XML sitemap is a file that lists all the URLs on your site you want search engines to crawl and index. It does not guarantee indexing - Google indexes pages based on quality and authority - but it ensures Google knows about your content and can discover it efficiently.

WordPress generates sitemaps automatically through SEO plugins, but the default configuration often includes too much (thin content, admin pages) or not enough (recent posts not reflected immediately). Here is how to configure it correctly.


Where your sitemap is

With most WordPress SEO plugins, the sitemap is at:

  • Yoast SEO: yourdomain.com/sitemap_index.xml
  • Rank Math: yourdomain.com/sitemap_index.xml
  • SEOPress: yourdomain.com/seo-sitemap.xml
  • WordPress Core (5.5+, without SEO plugin): yourdomain.com/wp-sitemap.xml

Open the sitemap URL in your browser to verify it exists and contains URLs.


What should be in the sitemap

Include:

  • All published posts (blog posts, articles)
  • All pages you want indexed (homepage, about, services, contact)
  • Category and tag archive pages (if they have enough content to be indexable)
  • Custom post type archives (portfolio, case studies, products)

Exclude:

  • Cart, checkout, my-account pages (WooCommerce)
  • Admin, login, registration pages
  • Search results pages (?s=)
  • Paginated archive pages (/category/name/page/2/)
  • Author archives (if single-author site)
  • Tag archives (if thin/duplicate content)
  • Password-protected posts
  • Draft and private posts (excluded by default, but verify)

Configure the sitemap in Yoast SEO

Go to Yoast > Settings > Site Map (or in older versions, SEO > General > Features > XML Sitemaps).

Post types:

  • Enable: Posts, Pages, and any custom post types with indexable content
  • Disable: Media attachments (attachment pages are thin content)

Taxonomies:

  • Enable: Categories (if they have unique descriptions and enough posts)
  • Disable: Tags (usually thin content), Post Format archives

Author sitemap: Disable on single-author sites.

To exclude a specific post from the sitemap, open the post in the editor > Yoast SEO panel > Advanced > Allow search engines to show this Post in search results: No.


Configure the sitemap in Rank Math

Rank Math > Sitemap Settings:

Enable sitemaps: On Include images: On (important for image search) Ping search engines: On (notifies Google and Bing when the sitemap updates)

For each post type:

  • Posts: Enabled
  • Pages: Enabled
  • Attachments: Disabled
  • Custom post types: Enable those with indexable content

Under "Taxonomy Sitemap":

  • Categories: Enabled (if they have content worth indexing)
  • Tags: Disabled (set to "No" for indexing) or enabled with noindex on individual tags

Image sitemaps

Images benefit from sitemap inclusion. The sitemap can include image metadata that helps Google index images in Image Search.

Rank Math includes images in the sitemap automatically. In Yoast, image sitemaps are included by default. Sitemap behaviour is one of the few areas where the two plugins are close to equivalent — where they diverge is schema and pricing, which matters more if you are still deciding between them.

Verify images appear in your sitemap by opening yourdomain.com/sitemap_index.xml, navigating to the posts sitemap, and checking that <image:image> tags appear within post entries.


Submit to Google Search Console

  1. Open Google Search Console for your property
  2. Go to Indexing > Sitemaps
  3. Enter your sitemap URL (e.g., sitemap_index.xml)
  4. Click Submit

Google will begin crawling the sitemap. Check back in 24-48 hours for:

  • "Success" status (sitemap was fetched and parsed)
  • Number of URLs discovered vs submitted
  • Any errors in the sitemap

Monitor sitemap in Search Console

Once submitted, the Sitemaps report shows:

  • Last read date: when Google last fetched the sitemap
  • Discovered URLs: how many URLs Google found in the sitemap
  • Indexed URLs: how many of those Google has indexed

If "Indexed" is much lower than "Discovered", the gap is pages Google found but chose not to index. This is normal - Google does not index everything it discovers. Common reasons include thin content, duplicate content, or pages blocked by noindex tags.

Common sitemap errors in Search Console

"Sitemap could not be read": The sitemap URL is returning an error. Check Nginx/Apache logs and verify the sitemap URL loads correctly in a browser.

"Sitemap is HTML": The sitemap URL is returning an HTML page instead of XML. Check if a redirect or firewall is blocking the sitemap URL. Some security plugins redirect unknown URLs to the homepage.

"URL not allowed": The sitemap includes URLs from a different domain. This happens with misconfigured multisite setups.


Sitemap for large sites

WooCommerce stores with thousands of products and content sites with tens of thousands of posts need a split sitemap. A single XML file over 50MB or with over 50,000 URLs triggers errors.

Sitemap index format automatically handles this - the sitemap_index.xml file links to separate sitemaps for posts, pages, and products. Verify each referenced sitemap URL is accessible.

For very large stores: prioritise the sitemap. Products with stock available and a minimum number of reviews are more valuable to include than out-of-stock products with no reviews. In Rank Math Pro, you can exclude specific posts or categories from the sitemap based on meta values.


After publishing new content

Most WordPress SEO plugins automatically ping Google when new content is published. The sitemap is updated and Google is notified within minutes.

To manually ping (if automatic pinging is disabled):

# WP-CLI
wp eval 'do_action( "sm_ping" );' --allow-root

Or in Google Search Console: Sitemaps > click on your sitemap > "Request Indexing" is not available for sitemaps, but you can use URL Inspection on specific new URLs for faster individual indexing.


Frequently Asked Questions

Where is my WordPress sitemap?
WordPress generates one at /wp-sitemap.xml by default since version 5.5. If you run Yoast SEO the sitemap moves to /sitemap_index.xml, and with Rank Math it is /sitemap_index.xml as well. Both plugins disable the core sitemap when they take over, so you should only have one live.
What should be in a WordPress XML sitemap?
Only URLs you want indexed and that are canonical. That means published posts and pages, and genuinely useful archives. Tag archives, paginated pages, attachment pages, and anything marked noindex should be excluded — including a noindex URL sends Google contradictory instructions.
Do I need to submit my sitemap to Google?
Submitting through Search Console is worthwhile, mainly because it gives you the coverage reporting — how many submitted URLs were actually indexed, and why the rest were not. Google can discover a sitemap without submission, but you lose that diagnostic view.
Should I include images in my sitemap?
An image sitemap helps if images are a meaningful traffic source, such as on a store or a photography site. For a typical blog where images support the text rather than being the destination, the benefit is small and it is not the first thing to fix.
Why are my sitemap URLs not being indexed?
Submission is a request, not a guarantee. Common causes are thin or duplicate content, pages blocked by robots.txt or a noindex tag, canonical tags pointing elsewhere, or simply a new site with little crawl priority. The Search Console coverage report names the specific reason per URL.

Was this article helpful?