Back to blog
WordPress XML Sitemap: create and optimize your site map
WordPress

WordPress XML Sitemap: create and optimize your site map

ElevaSEOMarch 18, 202621 min read
sitemapxmlwordpressseogoogle

WordPress XML Sitemap: The Complete Guide to Create, Optimize, and Submit Your Site Map

A WordPress sitemap is one of the most overlooked technical SEO assets. It is a structured XML file that lists every URL on your site you want search engines to discover, crawl, and index. Without a properly configured XML sitemap, search engines must rely exclusively on internal links and external backlinks to find your content. For sites with hundreds or thousands of pages, that means entire sections can remain invisible in search results for weeks or even months.

This guide covers everything you need to know about WordPress sitemaps in 2026: what they are, how they work, which plugin to use, how to configure them correctly, how to submit them to Google Search Console and Bing Webmaster Tools, and how to troubleshoot the most common errors.

What Is an XML Sitemap and Why Does It Matter?

The Technical Definition

An XML sitemap is a file (typically located at yoursite.com/sitemap.xml) that follows the Sitemap Protocol. It provides search engine crawlers with a machine-readable list of URLs, along with optional metadata about each page:

  • <loc>: the full URL of the page
  • <lastmod>: the date the page was last modified
  • <changefreq>: how frequently the page is likely to change (note: Google ignores this tag)
  • <priority>: a relative priority hint between 0.0 and 1.0 (note: Google ignores this tag too)

A sitemap index file can reference multiple individual sitemaps, each containing up to 50,000 URLs and no larger than 50 MB uncompressed.

Why Sitemaps Are Critical for SEO

Search engines like Google and Bing use sitemaps as a discovery mechanism. While Googlebot will eventually find most pages through link crawling, sitemaps dramatically accelerate this process.

Sitemaps are particularly valuable when:

  • Your site is new and has few external backlinks pointing to it
  • Your site is large (1,000+ pages) with deep content hierarchies
  • Your pages are poorly interlinked or contain orphan pages
  • You publish content frequently and need fast indexation
  • You use rich media (images, videos) that benefit from dedicated sitemaps

According to Google's own documentation, sitemaps "help Google discover URLs on your site faster" and are one of the primary signals used during the crawl scheduling process. For any serious SEO strategy, a properly configured sitemap is non-negotiable.

Sitemap Types: Post, Image, Video, and News

WordPress sitemaps are not limited to standard page URLs. Depending on your content and your plugin configuration, you can generate:

Sitemap TypeContent CoveredBest For
Post sitemapBlog posts, custom post typesContent-heavy sites, blogs
Page sitemapStatic pagesCorporate sites, landing pages
Image sitemapImage URLs with metadataPhotography sites, e-commerce
Video sitemapVideo URLs, thumbnails, descriptionsMedia sites, YouTube embeds
News sitemapArticles published in last 48hNews publishers (Google News)
Category/Tag sitemapTaxonomy archive pagesLarge blogs with structured categories
Author sitemapAuthor archive pagesMulti-author publications

WordPress Core Sitemap: wp-sitemap.xml (Since WordPress 5.5)

Since WordPress 5.5 (released in August 2020), WordPress ships with a built-in XML sitemap feature. You can access it at yoursite.com/wp-sitemap.xml.

What the Core Sitemap Includes

The WordPress core sitemap automatically generates a sitemap index that links to individual sitemaps for:

  • Posts (all published posts)
  • Pages (all published pages)
  • Custom post types (if they are public and queryable)
  • Categories and tags (taxonomy archives)
  • Author archives (user pages)

Each individual sitemap contains up to 2,000 URLs per page.

Limitations of the Core Sitemap

While the built-in sitemap is functional, it has significant limitations compared to plugin-generated sitemaps:

  • No image sitemap support: images are not included
  • No video sitemap support: video metadata is missing
  • No news sitemap: not suitable for Google News publishers
  • No <lastmod> tag: the core sitemap does not include last modification dates, which reduces its value for crawl prioritization
  • No exclusion controls: you cannot exclude specific posts, pages, or taxonomies from the sitemap through the WordPress admin
  • No search engine ping: the core sitemap does not automatically notify search engines when content changes

For a basic blog or a small business site with under 50 pages, the core sitemap may be sufficient. For anything more complex, you will need a dedicated SEO plugin.

How to Disable the Core Sitemap

If you are using an SEO plugin that generates its own sitemap (Yoast, Rank Math, AIOSEO), you should disable the core sitemap to avoid sending conflicting signals to search engines. Most SEO plugins do this automatically when activated. If you need to disable it manually, add this to your theme's functions.php:

// Disable WordPress core sitemap
add_filter( 'wp_sitemaps_enabled', '__return_false' );

Generating Your WordPress XML Sitemap with Plugins

The vast majority of WordPress sites rely on an SEO plugin to generate and manage their XML sitemap. The three dominant plugins in 2026 are Yoast SEO, Rank Math, and All in One SEO (AIOSEO). Each offers robust sitemap generation with different levels of configuration.

Yoast SEO: Sitemap Setup and Configuration

Yoast SEO is the most widely installed WordPress SEO plugin, powering over 12 million active sites. Its sitemap generation is reliable and largely automatic.

Step-by-step setup:

  1. Navigate to Yoast SEO > Settings in your WordPress dashboard
  2. Go to Site features
  3. Under Technical SEO, toggle XML sitemaps to On
  4. Click View the XML sitemap to verify it is working

Your sitemap will be available at yoursite.com/sitemap_index.xml.

Key configuration options:

  • Post type sitemaps: Yoast automatically includes all public post types. To exclude a post type, set it to noindex under Yoast SEO > Settings > Content Types
  • Taxonomy sitemaps: categories and tags are included by default. Disable them individually under Yoast SEO > Settings > Categories & Tags
  • Per-page exclusion: on any individual post or page, use the Yoast meta box to set the page to noindex, which removes it from the sitemap
  • Entries per page: by default, Yoast includes 1,000 URLs per sitemap page. You can adjust this with a code filter:
// Limit Yoast sitemap entries to 100 per page
function custom_sitemap_entries() {
    return 100;
}
add_filter( 'wpseo_sitemap_entries_per_page', 'custom_sitemap_entries' );

For a detailed walkthrough of all Yoast SEO features, see our complete Yoast SEO guide.

Rank Math: Advanced Sitemap Features

Rank Math has gained significant market share thanks to its free tier offering features that Yoast reserves for premium. Its sitemap module is particularly powerful.

Step-by-step setup:

  1. Go to Rank Math > Sitemap Settings in your dashboard
  2. Toggle Enable Sitemap to on
  3. Configure individual tabs: General, Posts, Pages, Categories, Tags, and any custom post types

Rank Math sitemap advantages:

  • Granular exclusion: exclude individual posts, pages, or entire taxonomies directly from the sitemap settings panel
  • Image sitemap: automatically includes images found in post content
  • Video sitemap (Pro): detects embedded videos and generates a dedicated video sitemap
  • News sitemap (Pro): compliant with Google News requirements
  • Ping on publish: automatically pings Google and Bing when new content is published
  • Sitemap links per page: configurable from 50 to 2,000

AIOSEO: Simplified Sitemap Management

All in One SEO takes a more streamlined approach. Its sitemap feature is designed for users who want minimal configuration.

Setup:

  1. Navigate to All in One SEO > Sitemaps
  2. Enable XML Sitemap
  3. Configure which post types and taxonomies to include
  4. Optionally enable Video Sitemap or News Sitemap (Pro)

AIOSEO also supports a dedicated RSS Sitemap that can help with faster indexation of newly published content.

Plugin Feature Comparison Table

FeatureYoast SEO (Free)Yoast SEO (Premium)Rank Math (Free)Rank Math (Pro)AIOSEO (Free)AIOSEO (Pro)
XML sitemapYesYesYesYesYesYes
Image sitemapYesYesYesYesYesYes
Video sitemapNoYesNoYesNoYes
News sitemapNoYesNoYesNoYes
Per-post exclusionVia noindexVia noindexDirectDirectVia noindexDirect
Ping search enginesYesYesYesYesYesYes
Custom entries/pageVia filterVia filterUI settingUI settingUI settingUI setting
Price (annual)Free~99 EURFree~69 EURFree~49 EUR

Configuring Your Sitemap for Maximum SEO Impact

Generating a sitemap is only the first step. Configuring it correctly is where the real SEO value lies. A poorly configured sitemap can actually harm your crawl efficiency by wasting your crawl budget on low-value pages.

Include Only Indexable, Canonical URLs

Your sitemap should only contain URLs that:

  • Return a 200 HTTP status code
  • Are not blocked by robots.txt
  • Do not have a noindex meta tag or HTTP header
  • Point to the canonical version of the page (no duplicates, no parameter variations)
  • Contain meaningful content (not thin pages, empty archives, or tag pages with one post)

Exclude Low-Value Pages

The following page types should generally be excluded from your WordPress sitemap:

  • Tag archives with fewer than 3 posts
  • Author archives on single-author sites
  • Date-based archives (monthly, yearly)
  • Attachment pages (WordPress media attachment URLs)
  • Search result pages
  • Paginated archives beyond page 1 (let the main archive URL represent the series)
  • Staging or development pages accidentally left public

Leverage the <lastmod> Tag

The <lastmod> tag tells search engines when a page was last updated. This is one of the most valuable sitemap signals because:

  • Googlebot uses <lastmod> as a crawl priority signal when the dates are accurate
  • Pages with recent <lastmod> dates are more likely to be recrawled quickly
  • Inaccurate dates (e.g., updating <lastmod> without changing content) can cause Google to ignore the tag entirely for your site

All three major SEO plugins automatically update <lastmod> when you edit and save a post. Do not artificially inflate these dates.

Optimize Sitemap Size for Large Sites

For sites with more than 10,000 URLs, sitemap organization becomes important:

  • Split by content type: separate sitemaps for posts, pages, products, and categories
  • Limit entries per sitemap: keep each sitemap file under 10,000 URLs for faster processing (even though the protocol allows 50,000)
  • Use gzip compression: serve sitemaps as .xml.gz files to reduce bandwidth
  • Remove expired content: regularly audit your sitemap and remove URLs that return 404 or have been redirected

Submitting Your WordPress Sitemap to Search Engines

Creating a sitemap is only useful if search engines know where to find it. There are three primary methods to ensure Google and Bing discover your sitemap.

Method 1: Google Search Console

Google Search Console (GSC) is the most reliable way to submit your sitemap to Google.

  1. Log in to Google Search Console
  2. Select your property
  3. Navigate to Sitemaps in the left sidebar
  4. Enter your sitemap URL (e.g., sitemap_index.xml or sitemap.xml)
  5. Click Submit

GSC will show you the submission status, the number of discovered URLs, and any errors found during processing. Check back after 24-48 hours to verify that Google has successfully read your sitemap.

For a complete walkthrough of GSC features, see our Google Search Console guide.

Method 2: Bing Webmaster Tools

Bing Webmaster Tools follows a similar process:

  1. Log in to Bing Webmaster Tools
  2. Select your site
  3. Go to Sitemaps
  4. Enter your sitemap URL and click Submit

Bing also supports IndexNow, a protocol that allows you to notify Bing (and other supporting search engines) of content changes in real time. Both Yoast SEO and Rank Math support IndexNow natively.

Method 3: robots.txt Declaration

You can also declare your sitemap location in your robots.txt file. This ensures that any crawler that reads your robots.txt (which is virtually all of them) will discover your sitemap:

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
 
Sitemap: https://yoursite.com/sitemap_index.xml

This method is passive but effective. It serves as a fallback when search engines have not yet been manually notified.

Troubleshooting Common WordPress Sitemap Errors

Even with a well-configured plugin, sitemap issues can arise. Here are the most frequent problems and their solutions.

Error: "Sitemap could not be read" or 404

Cause: the sitemap URL returns a 404 error, typically due to permalink issues or plugin conflicts.

Solutions:

  1. Go to Settings > Permalinks and click Save Changes (this flushes the rewrite rules)
  2. Verify your .htaccess file is writable
  3. Check for plugin conflicts by temporarily deactivating other plugins
  4. Ensure your web server (Apache/Nginx) is not blocking the sitemap URL

Error: "Sitemap contains URLs blocked by robots.txt"

Cause: your robots.txt file is blocking URLs that appear in your sitemap.

Solution: review your robots.txt for overly broad Disallow rules. Your sitemap URLs and robots.txt directives must be consistent. Never include a URL in your sitemap that is blocked by robots.txt.

Error: "Sitemap contains noindex URLs"

Cause: some URLs in your sitemap have a noindex meta tag or X-Robots-Tag header.

Solution: either remove the noindex directive from those pages or exclude them from your sitemap. In Yoast SEO, setting a page to noindex should automatically remove it from the sitemap. If it does not, clear your sitemap cache and regenerate.

Error: "Sitemap is an HTML page"

Cause: instead of serving raw XML, your server returns an HTML page (often a theme template or a caching plugin interfering).

Solutions:

  1. Disable page caching for sitemap URLs
  2. Check if a security plugin (Wordfence, Sucuri) is intercepting the request
  3. Verify there is no physical sitemap.xml file in your WordPress root directory that overrides the dynamic one

Sitemap Not Updating After Publishing New Content

Cause: aggressive caching at the server or plugin level.

Solutions:

  1. Clear your object cache and page cache
  2. If using a CDN (Cloudflare, Fastly), purge the sitemap URL from the CDN cache
  3. Check that your SEO plugin's sitemap cache is not stale (some plugins cache sitemaps for performance)

For more on resolving WordPress technical issues, refer to our WordPress maintenance guide.

Advanced Sitemap Strategies

Image Sitemaps for Visual Content

If your site relies heavily on images (portfolios, e-commerce, photography), an image sitemap can significantly boost your visibility in Google Images. Image sitemaps include:

  • The image URL
  • An optional caption
  • An optional title
  • An optional geographic location
  • The license URL

Yoast SEO and Rank Math both include image URLs in their standard sitemaps automatically. If you need more granular control over image metadata, consider the dedicated Google XML Sitemap for Images plugin.

Video Sitemaps for Media-Rich Sites

Video sitemaps are essential if you embed videos in your content. They help Google understand:

  • The video URL (or embed URL)
  • The thumbnail URL
  • The video title and description
  • The video duration
  • The publication date

Without a video sitemap, Google must discover and process your videos through content rendering, which is slower and less reliable. Both Rank Math Pro and Yoast SEO Premium support automatic video sitemap generation.

News Sitemaps for Publishers

If your site is approved for Google News, you need a dedicated news sitemap. News sitemaps differ from standard sitemaps:

  • They must only contain articles published within the last 48 hours
  • They include a <news:publication> tag with the publication name and language
  • They include a <news:publication_date> tag with the exact publication timestamp
  • They include <news:title> for the article headline

All three major SEO plugins offer news sitemap functionality in their premium tiers.

Using IndexNow for Real-Time Indexation

IndexNow is a protocol supported by Bing, Yandex, and several other search engines (Google has not officially adopted it yet, though it monitors the submissions). When you publish or update content, IndexNow sends an instant ping to participating search engines with the specific URL that changed.

How to enable IndexNow in WordPress:

  • Rank Math: built-in under Rank Math > Instant Indexing
  • Yoast SEO Premium: built-in under Yoast > Settings > Site features
  • Standalone: use the official IndexNow plugin by Microsoft

IndexNow is particularly effective for time-sensitive content like news articles, product launches, and event pages.

Sitemap SEO Best Practices Checklist

Follow this checklist to ensure your WordPress sitemap is fully optimized:

  • One sitemap source: disable the WordPress core sitemap if using a plugin
  • Indexable URLs only: every URL in the sitemap returns 200, is canonical, and is not noindexed
  • Accurate <lastmod> dates: only update when content actually changes
  • No blocked URLs: sitemap URLs are not blocked by robots.txt
  • Reasonable size: under 10,000 URLs per individual sitemap file
  • Image coverage: images are included in the sitemap for visual content sites
  • Submitted to GSC: sitemap is submitted and showing "Success" status
  • Submitted to Bing: sitemap is submitted in Bing Webmaster Tools
  • robots.txt declaration: sitemap URL is listed in robots.txt
  • No duplicate sitemaps: only one sitemap source is active
  • Regular audits: review sitemap monthly for 404s, redirects, and thin content
  • HTTPS consistency: all sitemap URLs use HTTPS (no mixed HTTP/HTTPS)

Monitoring Your Sitemap Performance

Google Search Console Sitemap Report

After submitting your sitemap in GSC, monitor these metrics:

  • Discovered URLs: the total number of URLs Google found in your sitemap
  • Indexed URLs: how many of those URLs are actually in Google's index
  • Coverage issues: errors, warnings, and excluded URLs with reasons

A large gap between "discovered" and "indexed" indicates quality issues. Common reasons include:

  • "Discovered - currently not indexed": Google found the URL but chose not to index it (often a content quality signal)
  • "Crawled - currently not indexed": Google crawled the page but did not add it to the index (thin content, duplicate content, or low value)
  • "Excluded by noindex tag": the page has a noindex directive and should not be in your sitemap

Server Log Analysis

For advanced monitoring, analyze your server logs to see how search engine crawlers interact with your sitemap:

  • How frequently Googlebot requests your sitemap
  • Which individual sitemaps are crawled most often
  • Whether Googlebot discovers new URLs from the sitemap within expected timeframes

Server log analysis provides the ground truth about crawler behavior that no other tool can replicate.

Common Myths About WordPress Sitemaps

Myth 1: "A sitemap guarantees indexation"

Reality: a sitemap is a request, not a guarantee. Google will still evaluate each URL based on content quality, crawl budget, and overall site authority before deciding whether to index it. A sitemap helps with discovery, not with ranking.

Myth 2: "Priority and changefreq tags improve rankings"

Reality: Google has publicly stated that it ignores both <priority> and <changefreq> tags. Yoast SEO removed priority support in version 3.5 for this reason. Do not waste time configuring these values.

Myth 3: "You need a separate plugin for sitemaps"

Reality: if you are already using Yoast SEO, Rank Math, or AIOSEO, you do not need a separate sitemap plugin like Google XML Sitemaps. Using multiple sitemap plugins simultaneously creates conflicts and duplicate sitemaps.

Myth 4: "Sitemaps are only for large sites"

Reality: even a 10-page website benefits from a sitemap. It provides search engines with a complete, authoritative list of your URLs and signals which pages you consider important. For new sites with few backlinks, a sitemap is often the primary discovery mechanism.

Myth 5: "Submitting your sitemap is a one-time task"

Reality: while you do not need to resubmit your sitemap every time you publish, you should regularly monitor the sitemap report in Google Search Console. Plugin updates, permalink changes, and content migrations can all break your sitemap without warning.

Integrating Your Sitemap with Your Overall Technical SEO Strategy

Your XML sitemap does not exist in isolation. It is one component of a broader technical SEO framework that includes:

  • robots.txt: controls which URLs crawlers can access. Must be consistent with your sitemap.
  • Canonical tags: indicate the preferred version of duplicate pages. Only canonical URLs should appear in your sitemap.
  • Structured data: provides semantic context about your content. Pages with rich structured data benefit even more from being in the sitemap because search engines can quickly extract and display rich results.
  • Internal linking: complements your sitemap by providing crawl paths through your content hierarchy. A good internal linking strategy reduces your dependence on the sitemap for URL discovery.
  • Site security: a compromised site can inject spam URLs into your sitemap, leading to manual penalties. Regular security audits protect your sitemap integrity.

Conclusion: Your WordPress Sitemap Action Plan

Setting up and optimizing your WordPress XML sitemap is a straightforward process that delivers measurable SEO benefits. Here is your action plan:

  1. Choose your sitemap source: use your SEO plugin (Yoast, Rank Math, or AIOSEO) and disable the WordPress core sitemap
  2. Configure inclusions and exclusions: only include indexable, canonical, content-rich URLs
  3. Submit to search engines: add your sitemap to both Google Search Console and Bing Webmaster Tools, and declare it in robots.txt
  4. Enable IndexNow: for faster indexation of new and updated content
  5. Monitor regularly: check the GSC sitemap report monthly for coverage gaps and errors
  6. Audit quarterly: remove 404s, redirected URLs, and thin content from your sitemap

A well-maintained sitemap is not a set-and-forget asset. It is a living document that evolves with your site. Treat it as the foundation of your crawl strategy, and your content will reach search engine indexes faster, more reliably, and more completely.

Related posts