You've published great content on your WordPress site. But if Google can't find it, it can't rank it.
An XML sitemap is a file that lists all the important pages, posts, and other content on your website in a structured format that search engines can easily read. Submitting it to Google dramatically speeds up the discovery and indexing of your content — making it one of the most important SEO setup tasks for any WordPress site.
This guide covers everything about XML sitemaps in WordPress: what they are, why they matter, how to create one using your SEO plugin, how to submit it to Google Search Console, and how to troubleshoot sitemap problems.
An XML sitemap is a file (usually at yourdomain.com/sitemap.xml or yourdomain.com/sitemap_index.xml) that contains a structured list of URLs on your website, along with optional metadata like:
Here's a simplified example of what an XML sitemap looks like:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://yourdomain.com/wordpress-development/</loc>
<lastmod>2025-01-15</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://yourdomain.com/blog/wordpress-speed-tips/</loc>
<lastmod>2025-01-10</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
</urlset>
Search engine crawlers (Googlebot, Bingbot, etc.) read your sitemap and use it as a map of your site — discovering URLs they might not find through regular link-following alone.
lastmod timestamp in your sitemap tells Google when content was last updated, prompting re-crawls of updated content.Rank Math generates a comprehensive XML sitemap automatically. Here's how to configure it:
Enable Rank Math Sitemap:
Configure What's Included:
In Rank Math → Sitemap Settings, you'll see modules for each content type:
Posts Sitemap:
Pages Sitemap:
Categories/Tags Sitemap:
Authors Sitemap:
Check Your Sitemap URL:
Your Rank Math sitemap is at:
https://yourdomain.com/sitemap_index.xml
This is a sitemap index — a master file that links to separate sitemaps for each content type:
https://yourdomain.com/page-sitemap.xml — all pageshttps://yourdomain.com/post-sitemap.xml — all postshttps://yourdomain.com/category-sitemap.xml — categoriesVisit the sitemap index URL and verify it loads and shows your content types.
Enable Yoast Sitemap:
Configure Sitemap Content:
Recommended settings for most WordPress sites:
Check Your Yoast Sitemap:
https://yourdomain.com/sitemap_index.xml
Click the "See the XML sitemap" link in Yoast settings to view it directly.
If you don't use Rank Math or Yoast, Google XML Sitemaps is a dedicated, lightweight option:
Your sitemap is at yourdomain.com/sitemap.xml
Creating the sitemap is only half the work. Submitting it to Google Search Console ensures Google knows where to find it.
If you haven't set up GSC yet:
sitemap_index.xml — for Rank Math or Yoastsitemap.xml — for Google XML Sitemaps plugin
After submission, Google Search Console shows:
The Discovered URLs count shows how many URLs Google found in your sitemap. This may be lower than your total URL count — Google doesn't necessarily index every URL it discovers.
Don't neglect Bing — it powers Bing, DuckDuckGo, and several other search engines:
Excluding Specific Pages in Rank Math:
Excluding Specific Pages in Yoast:
An image sitemap extends your XML sitemap to include information about images on each page — helping Google index your images in Google Images search.
For sites where image search traffic matters (photography, recipes, products, design), verify your images are appearing in your sitemap by viewing the raw XML:
https://yourdomain.com/post-sitemap.xml
Look for <image:image> tags within each URL entry — these confirm image sitemap data is included.
| Problem | Cause | Fix |
|---|---|---|
| Sitemap returns 404 Not Found | Permalink rules haven't been flushed since the SEO plugin was activated | Go to Settings → Permalinks and click Save Changes (without changing anything). This regenerates the .htaccess rewrite rules that make the sitemap URL work. |
| Sitemap shows no URLs | Content types are set to noindex, or the sitemap isn't finding published content | Check your SEO plugin's search appearance settings and ensure your content types are set to "Yes" for indexing. Also check that you have published posts and pages. |
| "Couldn't fetch" in GSC | Google can't access your sitemap URL | Check if the URL is correct and that the sitemap is publicly accessible (not blocked by a plugin or robots.txt). |
| "No URLs found in sitemap" | Sitemap XML is valid but contains no <url> entries |
Check your SEO plugin settings — content types may be excluded. |
| "Indexed, though blocked by robots.txt" | Sitemap URLs are listed but blocked by robots.txt |
Check your robots.txt file for Disallow: / or overly broad disallow rules. |
| Pages not appearing in sitemap | Individual page is set to noindex, or its content type is excluded | Check whether the individual page is set to noindex in the SEO plugin's meta settings. Also check that the content type is included in sitemap settings. |
After submission, use Google Search Console to monitor:
Sitemaps report:
Coverage report (Indexing → Pages):
URL Inspection:
For any specific URL, use URL Inspection to check if it's indexed and when it was last crawled.
Creating and submitting an XML sitemap is one of the most straightforward and impactful SEO steps you can take for your WordPress site. Install your SEO plugin, verify the sitemap at your sitemap index URL, submit it to Google Search Console, and monitor the indexed URL count over time.
Combined with good content, proper on-page optimisation, and a technically sound site, a well-configured sitemap ensures Google discovers and indexes your content as quickly as possible.
Need help with WordPress SEO setup including sitemap configuration? Our team handles full SEO implementations for WordPress sites.
Contact us today and we'll sort it out.