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.
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.
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
- Open Google Search Console for your property
- Go to Indexing > Sitemaps
- Enter your sitemap URL (e.g.,
sitemap_index.xml) - 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.
Related reading
// new_articles
Get notified when new guides drop
Practical WordPress guides from a working agency owner. No filler. Unsubscribe any time.
Was this article helpful?
Thanks for the feedback!