WordPress XML Sitemap: Creation and Submission Guide

Introduction

pc, notebook, work, job, relax, web, seo, wordpress, responsive, seo, wordpress, wordpress, wordpress, wordpress, wordpr
Photo by alberthbq on Pixabay

If you own a WordPress site and you’re trying to get traffic from search engines, you need an XML sitemap. This WordPress XML sitemap guide will walk you through what one is, why it matters, and how to get one set up. I’ve managed a number of WordPress sites over the years, and a properly configured sitemap is one of the easier technical SEO wins. It won’t fix everything, but it’s a clear signal that helps search engines find and understand your content. This guide is aimed at site owners who are still figuring things out—you’ve heard the term, but you aren’t sure if you need one or how to create it. By the end, you’ll have practical steps you can use.

WordPress SEO plugin settings screen showing XML sitemap toggle enabled

What Is a WordPress XML Sitemap and Why Does It Matter?

An XML sitemap is a file that lists all the important pages on your website. Think of it as a roadmap for search engines like Google and Bing. Instead of them crawling your site blindly, you’re giving them a structured list of where everything is. For a WordPress site, that usually includes your posts, pages, categories, and sometimes images and videos.

It matters because it helps with SEO. Search engines use sitemaps to discover content they might otherwise miss. This is especially important for larger sites with lots of posts or for new sites that haven’t built up a strong internal linking structure yet. A sitemap doesn’t guarantee every page gets indexed, but it improves the odds that search engines will at least take a look. Without one, you’re relying entirely on internal links and external backlinks to guide crawlers. That works for small, well-linked sites, but it leaves room for error. A sitemap is a low-effort way to reduce that risk. It standardizes the process and acts as a reliable fallback for your site’s architecture.

Do You Even Need a Sitemap? (Common Misconceptions)

Fair question. If you run a small blog with ten posts and every page is linked from your homepage, search engines will probably find everything without a sitemap. But I still recommend having one. It’s a lightweight addition that costs almost nothing to set up and gives a clear SEO signal.

A sitemap becomes essential when you have more than 50 pages, regularly publish new content, or have pages that aren’t easily linked from your main navigation. Think about old blog posts, product pages, or category archives—these can get buried. A sitemap ensures they’re on the radar.

Let’s clear up a common misconception: a sitemap does not fix duplicate content issues. If you have two pages with essentially the same content, a sitemap won’t tell Google which one to prioritize. That’s a canonical tag problem. Another myth is that a sitemap guarantees faster indexing. It can help new content get discovered sooner, but the speed of indexing depends on your site’s overall authority and crawl budget. The sitemap is just the starting point. So, assess your site honestly. If it’s tiny and you never change content, you might survive without one. But if you’re building for the long term, create the sitemap. It’s a no-brainer.

How to Create an XML Sitemap in WordPress Using Plugins

The easiest way to create an XML sitemap on a WordPress site is to use a plugin. I recommend this for 95% of site owners because it’s reliable, automated, and requires no code. Here’s how to do it with the three most popular SEO plugins.

Yoast SEO

  • Install and activate Yoast SEO.
  • Go to SEO > General > Features.
  • Make sure the “XML sitemaps” toggle is set to “On.”
  • Your sitemap will be available at yoursite.com/sitemap_index.xml.

Rank Math

  • Install and activate Rank Math.
  • Go to Rank Math > Sitemap Settings.
  • Enable the XML sitemap module from the General Settings tab.
  • The sitemap URL will be yoursite.com/sitemap.xml.

All in One SEO (AIOSEO)

  • Install and activate AIOSEO.
  • Go to All in One SEO > Sitemaps.
  • Toggle the “Enable Sitemap” option to on.
  • Your sitemap will be available at yoursite.com/sitemap.xml.

After installing any of these, check the sitemap URL by visiting the link directly in your browser. If you see a structured XML list of your pages, it’s working. All three plugins automatically update your sitemap when you publish new content, so you don’t need to regenerate it manually. That’s the main benefit of using a plugin—set it and forget it.

If you want a simpler, dedicated sitemap plugin, Google XML Sitemaps is a solid standalone option. It focuses only on sitemaps and has been reliable for years. You’ll find it under Settings > XML-Sitemap once installed. Personally, I use Rank Math on most of my sites because it offers more customization options for free, but all three will get the job done.

Example of an XML sitemap file opened in a web browser showing a list of URLs

Creating a Sitemap Manually (Without a Plugin)

For advanced users or those trying to minimize plugin bloat, it’s possible to create a sitemap manually. This approach gives you full control, but it requires more work and ongoing maintenance.

One method is to use a free online XML sitemap generator. Tools like XML-Sitemaps.com let you enter your site URL, crawl your site, and generate a sitemap file. You then download the file and upload it via FTP or your hosting file manager to the root directory of your WordPress installation (usually the public_html folder). The file needs to be named sitemap.xml.

frozen, landscape, cold, sunrise, file, wilderness, rock, december, mongolia, nature, mongolia eastern
Photo by Kanenori on Pixabay

If you prefer a hands-on coding approach, you can create a simple PHP script that generates the sitemap dynamically. This is more complex and requires understanding of WordPress database queries. A basic version might look like this:

  • Query all your published posts and pages using WP_Query.
  • Loop through the results and output each one in XML format with a <url> tag.
  • Save the output as a file or serve it directly.

Here’s the catch: manual sitemaps don’t update automatically. If you publish a new post, you need to regenerate and re-upload the file. For a site that changes weekly, this becomes tedious quickly. I only recommend this method for static sites or for developers who have set up a cron job to regenerate the sitemap periodically. For most WordPress users, a plugin is the smarter choice. It saves time and eliminates the risk of forgetting to update your sitemap.

XML Sitemap Plugins Compared: Yoast vs Rank Math vs All in One SEO

If you’re trying to decide which plugin to use, here’s a practical breakdown based on what each one offers for sitemaps. All three are solid, but they have different strengths.

Yoast SEO

  • Ease of setup: Very easy. One toggle to turn on sitemaps.
  • Customization: Good. You can exclude individual posts or whole post types, and it supports image sitemaps and video sitemaps in the premium version.
  • Best for: Users who want a reliable, widely-used plugin with a simple interface and don’t mind paying for advanced features.

Rank Math

  • Ease of setup: Easy, with a setup wizard that guides you through sitemap configuration.
  • Customization: Excellent. You can exclude specific taxonomies, set priority, and include images/videos—all in the free version.
  • Best for: Users who want advanced features like multiple sitemaps for different content types, and more control over what gets included, all without paying.

All in One SEO (AIOSEO)

  • Ease of setup: Very easy. The sitemap is enabled by default.
  • Customization: Good. It allows you to exclude pages, set priorities, and supports image sitemaps. The free version is less feature-rich than Rank Math’s free version.
  • Best for: Users who want a straightforward, all-in-one SEO plugin that doesn’t overwhelm and works out of the box.

My personal recommendation: start with Rank Math for the best free features. If you prefer the Yoast ecosystem, it’s still a strong choice. The key is that any of these will get your sitemap set up correctly. Don’t overthink the choice. Pick one, set it up, and move on to submitting it.

Submitting Your Sitemap to Google Search Console

Creating the sitemap is step one. Submitting it to Google is step two. Here’s how to do it in Google Search Console.

  1. Go to Google Search Console and sign in with your Google account. If you haven’t added your site yet, you’ll need to do that first (you can verify via DNS, HTML file upload, or Google Analytics).
  2. Once verified, select your property from the dropdown if you have multiple.
  3. In the left sidebar, find the “Sitemaps” section under “Indexing.”
  4. Click “Add a new sitemap.”
  5. Enter your sitemap URL. For most WordPress sites using Rank Math or AIOSEO, this will be sitemap.xml. For Yoast, it’s sitemap_index.xml. You only need to enter the part after your domain, not the full URL. So just type sitemap.xml.
  6. Click “Submit.”

After submission, Google will start processing it. You’ll see the status change to “Success” or “Couldn’t fetch” after a day or so. Don’t worry if it doesn’t happen instantly. Under the “Sitemaps” page, you can see the total number of URLs discovered versus indexed. It’s normal for the indexed count to be lower than the submitted count—Google doesn’t index everything, and that’s fine. What you’re checking for is errors. If it says “Couldn’t fetch,” that’s a problem. We’ll cover common errors in a later section.

Submitting to Search Console gives Google a direct signal to check your sitemap. Without submission, Google will likely still find it by reading your robots.txt file (which most plugins automatically update), but submitting it manually ensures it’s in the queue. I always submit it as part of initial site setup.

Submitting to Bing and Other Search Engines

While Google dominates search traffic, Bing still accounts for a significant share, especially on certain demographics. Submitting your sitemap there is a quick way to cover your bases.

Bing Webmaster Tools

  • Go to Bing Webmaster Tools and sign in with a Microsoft account.
  • Add your site. You can verify it via XML file, CNAME record, or by importing from Google Search Console.
  • Once verified, go to “Sitemaps” in the left menu.
  • Enter your sitemap URL (same as you did for Google) and click “Submit.”

Bing also adopts sitemaps from Google if you import your Google Search Console data, so that’s the easiest route. Yandex (Russia’s main search engine) has its own Webmaster Tools with a similar process, but I don’t recommend prioritizing it unless you have a Russian audience.

For most site owners, submitting to Google is the main task. Bing is a bonus that takes five minutes. I submit to both on every new site, but I haven’t found Yandex to be worth the effort unless the site is localized for that market.

Google Search Console interface showing the Sitemaps section with a submitted sitemap URL

Common Sitemap Errors and How to Fix Them

Here are the most frequent errors I’ve seen in Search Console and how to resolve them.

bar, ipad, mockup, business, computer, tablet, technology, mobile, google, search, google, google, google, google, googl
Photo by Firmbee on Pixabay

“Couldn’t fetch”

  • Cause: Google could not access your sitemap URL. This is usually a server issue, a permissions problem, or a firewall blocking the crawler.
  • Fix: First, test the sitemap URL in your browser. If you get a 404, your sitemap isn’t at that location. Check your plugin settings. If the URL works, check your server logs to see if Google’s IP is being blocked. Also, ensure your .htaccess file or security plugin isn’t restricting access.

“Allowed URLs limit exceeded”

  • Cause: Google recommends no more than 50,000 URLs per sitemap, or a maximum file size of 50MB.
  • Fix: If you have more than that, you need to split your sitemap into multiple files. Most SEO plugins handle this automatically. For example, Rank Math creates separate sitemaps for posts, pages, and categories. If you’re using a manual sitemap, you’ll need to create separate files and a sitemap index file (a parent sitemap that points to the smaller ones).

“Invalid XML”

  • Cause: The sitemap file has a syntax error or is not valid XML.
  • Fix: Open the sitemap URL in your browser. If you see a text representation instead of structured XML, there might be a plugin conflict or theme issue generating the file. Try deactivating all other plugins temporarily to see if the sitemap resolves. A caching plugin can serve an old or broken version—clear your cache first.

“URL not accessible”

  • Cause: Individual URLs within the sitemap return 404s or 500s.
  • Fix: Review the list in Search Console. Find the broken URLs and either fix them (if they should exist) or remove them from your sitemap. For deleted pages, ensure they redirect properly to a relevant page.

Most errors are fixable within minutes. The key is to check Search Console weekly after first submission, then monthly once everything stabilizes.

Should You Exclude Certain Pages from Your Sitemap?

Yes, and this is where a bit of strategic thinking helps. Not every page on your site is worth indexing. Including low-value pages wastes crawl budget and can dilute your site’s overall quality signal.

Typical pages to exclude:

  • Thin content: Archive pages for tag clouds, author pages with few posts, or category pages that only link to a handful of articles.
  • Private or login pages: These have no value for search engines.
  • Duplicate or low-value pages: Pages created by ecommerce filters or similar dynamic content that don’t offer unique value.
  • Staging site pages: If you have a staging site that’s accessible via a URL, make sure it’s not in your sitemap.

How to exclude pages depends on your plugin. In Rank Math, go to Sitemap Settings and select the post types or taxonomies you want to exclude. You can also exclude individual posts from the post edit screen under the “Rank Math” meta box, in the “Advanced” tab. In Yoast, go to SEO > Search Appearance, and you can set specific post types or taxonomies to “No” under “Show in search results,” which also removes them from the sitemap.

A good rule of thumb: if a page doesn’t serve a clear purpose for users, it probably doesn’t need to be in your sitemap. Be thoughtful about what you include. Quality over quantity applies to sitemaps too.

How Often Does a Sitemap Update Automatically?

When you use a plugin, the sitemap updates automatically when you publish, update, or delete a post. But—and this is important—the sitemap file is usually cached by your site’s caching plugin or server-level caching. So while the plugin generates a new version, the cached version might still be served to search engines for a few hours or a day.

This delay is normal. Don’t panic if your new post doesn’t appear in the sitemap immediately after publishing. Most modern caching plugins have a “clear cache” function that you can use right after publishing if you want the sitemap to reflect the change faster.

As for search engine recrawl frequency, the sitemap’s <lastmod> tags tell search engines when a page was last updated, but they don’t force a recrawl. Google and Bing decide when to recrawl based on your site’s history and authority. A sitemap can help new content get discovered sooner, but it doesn’t guarantee instant indexing. Expect anywhere from a few days to a couple of weeks for new content to appear in search results, depending on your site’s authority.

Maintaining Your Sitemap Over Time: A Quick Checklist

A sitemap isn’t something you set and forget. Here’s a simple maintenance checklist to keep it healthy.

  • After major site changes: If you redesign your site, change your URL structure, or delete large batches of content, regenerate your sitemap manually or check that your plugin does it automatically.
  • Monthly check in Search Console: Look at the “Sitemaps” report. Watch for errors like “Couldn’t fetch” or a sudden drop in indexed URLs.
  • Review excluded pages: Every few months, revisit what you’re excluding. New content types or sections might need to be added to the sitemap.
  • Confirm accessibility: Test your sitemap URL directly in a browser. If you get a 404 or a broken page, your plugin may have been deactivated or updated incorrectly.
  • After plugin updates: Major updates to your SEO plugin can sometimes reset your sitemap settings. Verify the sitemap is still enabled and configured as you want.

Keeping this checklist in rotation takes about ten minutes a month. It’s a small investment that ensures your sitemap continues to work properly, and that’s good for your SEO foundation.