How to Add a Sitemap to WordPress (2026): 3 Methods Compared

WordPress website sitemap diagram showing how to add a sitemap to WordPress with connected pages and a search magnifier

Every page on your site can be perfect and Google can still take weeks to find it. A sitemap fixes that: it is a single file that lists every public page you want indexed, so search engines stop guessing and start crawling. This guide explains how to add a sitemap to WordPress in three ways — the built-in sitemap, Rank Math, and Yoast SEO — and how to submit it to Google afterwards.

You do not need code or money. WordPress has generated a sitemap automatically since version 5.5, and the free versions of Rank Math and Yoast SEO build a better one. The job takes ten minutes, and this guide shows you how to add a sitemap to WordPress with whichever method fits your site.

In this guide

  • What a WordPress sitemap is
  • Where your sitemap lives right now
  • Method 1: How to add a sitemap to WordPress without a plugin
  • Method 2: How to add a sitemap to WordPress with Rank Math
  • Method 3: How to add a sitemap to WordPress with Yoast SEO
  • The 3 methods compared
  • Submitting your sitemap to Google Search Console
  • How to check your sitemap is working
  • Common sitemap errors and fixes
  • What to include and exclude
  • Mistakes to avoid
  • Frequently Asked Questions
  • The Bottom Line

What Is a WordPress Sitemap (and Why Google Needs One)

A sitemap is an XML file that lists the public URLs on your site — posts, pages, categories, and tags — with the date each one was last updated. Search engines read it to discover new content and to find pages with no incoming links. That is why knowing how to add a sitemap to WordPress matters from day one: it hands Google the full map instead of making it wander.

A sitemap does not guarantee indexing, and it does not improve rankings directly. It removes the discovery problem, so Google can crawl a new post promptly and judge it on its merits. For a new site, learning how to add a sitemap to WordPress can mean days instead of weeks before a post appears in search — a strong reason to learn how to add a sitemap to WordPress before you publish much content.

Where Is Your WordPress Sitemap Right Now?

Check whether you already have one — most WordPress sites do. Try these addresses in order, replacing yoursite.com with your domain, to see whether you even need to learn how to add a sitemap to WordPress:

What generates the sitemap Sitemap address
WordPress core (version 5.5 or later) yoursite.com/wp-sitemap.xml
Rank Math yoursite.com/sitemap_index.xml
Yoast SEO yoursite.com/sitemap_index.xml

If one loads as an XML index listing sub-sitemaps for posts, pages, and categories, you already have a sitemap and only need to submit it to Google. You can also check yoursite.com/robots.txt, where WordPress writes a “Sitemap:” line with the exact address. This site, BadilHost, runs Rank Math, so its /wp-sitemap.xml redirects and its live index is /sitemap_index.xml.

Method 1: How to Add a Sitemap to WordPress Without a Plugin

If you run WordPress 5.5 or later with no SEO plugin, you already have a sitemap. WordPress added basic XML sitemaps to core in version 5.5, released in August 2020, and every public site since generates one automatically at /wp-sitemap.xml. It covers all public post types and taxonomies, author archives, and your homepage, with up to 2,000 URLs per sitemap and 50,000 sitemaps per index — the core answer to how to add a sitemap to WordPress.

There is nothing to install and nothing to switch on — the simplest version of how to add a sitemap to WordPress is doing nothing at all. The only way it fails is if something switched the feature off. Check Settings, then Reading, and make sure “Discourage search engines from indexing this site” is unchecked; if it is checked, WordPress hides your site and turns the sitemap off too. The other possible cause is hosting: rendering the core sitemap needs the SimpleXML PHP extension. Ask your host to enable it. This method suits small blogs that want zero extra plugins.

Method 2: How to Add a Sitemap to WordPress With Rank Math

Rank Math is the SEO plugin this site uses, and its free version generates a full XML sitemap automatically — if it is installed, your sitemap is probably already live at /sitemap_index.xml. To set it up from scratch, go to Plugins, then Add New, search for “Rank Math SEO”, and click Install Now and then Activate. That is the whole answer to how to add a sitemap to WordPress with Rank Math — the sitemap itself needs no further step.

Next, check the settings. Go to Rank Math SEO, then Sitemap Settings, and confirm the sitemap module is enabled. Enable image sitemaps so your images can rank in image search, and exclude post types you do not want indexed — author archives on a single-author blog, for example. Then open yoursite.com/sitemap_index.xml: you should see an index listing post-sitemap.xml, page-sitemap.xml, and category-sitemap.xml.

Rank Math sitemap settings panel in the WordPress dashboard with toggles and a page list

Rank Math’s free version costs $0 and covers everything in this guide. Rank Math Pro starts at $59 a year and adds video sitemaps, news sitemaps, and rank tracking — none of which you need for a working sitemap.

Method 3: How to Add a Sitemap to WordPress With Yoast SEO

Yoast SEO is the oldest and most installed SEO plugin for WordPress, and its free version also generates an XML sitemap automatically. Install it from Plugins, then Add New, search for “Yoast SEO”, and click Install Now and then Activate. Those few clicks are all that how to add a sitemap to WordPress with Yoast SEO requires.

Check that sitemaps are switched on: go to Yoast SEO, then Settings, then Site features, and look for the “XML sitemaps” card, which is enabled by default. Then open yoursite.com/sitemap_index.xml: Yoast’s index lists post-sitemap.xml, page-sitemap.xml, category-sitemap.xml, and author-sitemap.xml, and updates automatically when you publish or edit content.

Yoast’s free version costs $0 and includes the XML sitemap, title and meta controls, and basic schema markup. Yoast SEO Premium adds redirect management and internal linking suggestions, but for sitemaps alone the free version is enough.

The 3 Methods Compared: Which Way Should You Add a Sitemap?

All three methods teach the same skill — how to add a sitemap to WordPress — and all three work.

Feature WordPress core Rank Math (free) Yoast SEO (free)
Cost $0 $0 $0
Sitemap address /wp-sitemap.xml /sitemap_index.xml /sitemap_index.xml
Automatic updates Yes Yes Yes
Image sitemaps No Yes Yes
Exclude post types Code only Settings Settings
Exclude single posts Code only Per-post setting Per-post setting
Video and news sitemaps No Paid Pro ($59/yr) Paid add-ons
Setup time 0 minutes 5 minutes 5 minutes

If you want the simplest answer to how to add a sitemap to WordPress, use the built-in core sitemap and do nothing. If you want control without paying, pick Rank Math or Yoast — whichever SEO plugin you already use. Installing both at once is a mistake: two plugins will fight over the same sitemap address, so choose one.

How to Submit Your Sitemap to Google Search Console

Knowing how to add a sitemap to WordPress is only half the job: a sitemap helps only if Google knows where it is. Google usually finds it through robots.txt, but submitting it directly is faster and gives you a status report.

  1. Open Google Search Console and select your site property. Verify your site first if needed.
  2. In the left menu, click Indexing, then Sitemaps.
  3. In the “Add a new sitemap” field, type only the end of the address: sitemap_index.xml for Rank Math or Yoast, or wp-sitemap.xml for the core sitemap.
  4. Click Submit. Google shows the sitemap as Pending while it fetches it.

Check back after a day. A healthy sitemap shows “Success” with the number of URLs discovered, which should roughly match your public posts and pages. If it shows “Couldn’t fetch” or “Has errors”, use the fixes in the errors section below.

How to Check Whether Your Sitemap Is Working

Submitting a sitemap is not proof that it works, so run these three checks after you submit, and repeat them whenever you change plugins or hosting. First, open the sitemap address in your browser and confirm it loads as an XML index with working links; click a sub-sitemap such as post-sitemap.xml and confirm it lists real post addresses with recent lastmod dates.

Second, check the Search Console Sitemaps report after 24 hours. The status should read “Success” and the discovered URL count should be close to your real page count. Third, check the Pages report under Indexing: a sitemap gets Google to the page, but indexing depends on content quality and internal links. If a page you care about sits undiscovered, link to it from a stronger page — the same discipline our table of contents guide uses to help readers and crawlers find deep content. These three checks close the loop on how to add a sitemap to WordPress — generation, submission, and verification.

Common Sitemap Errors and How to Fix Them

Most problems after you learn how to add a sitemap to WordPress come from a small set of causes. Here are the ones you will actually meet.

Error or symptom Likely cause Fix
404 at the sitemap address Permalinks not flushed, or plugin conflict Go to Settings, then Permalinks, and click Save Changes; deactivate other SEO or sitemap plugins
“Couldn’t fetch” in Search Console Robots.txt blocks the sitemap, or the site blocks Google Check robots.txt allows the sitemap address; uncheck “Discourage search engines” in Settings, then Reading
Sitemap shows as an HTML page Cache plugin serving a cached HTML copy Exclude sitemap addresses from caching, or purge the cache

The permalink fix solves the most common error. WordPress builds sitemap addresses from your permalink rules, and those rules are cached. After installing or removing a plugin, open Settings, then Permalinks, and click Save Changes without changing anything. If your sitemap loads in a browser but Search Console reports HTML, add /sitemap_index.xml, /wp-sitemap.xml, and /*-sitemap.xml to your cache plugin’s exclusion list. Our speed guide explains caching without breaking the files search engines need.

What to Include (and Exclude) in Your Sitemap

A good sitemap lists every public page you want Google to index, and nothing else. Posts, pages, and public category archives belong in it, and image sitemaps are worth enabling because they help your images appear in image search.

Several things should stay out. Thin tag archives add little value. Author archives on a single-author blog duplicate the blog index. Attachment pages — the bare pages WordPress creates for each uploaded image — are almost never worth indexing.

Mistakes to Avoid When You Learn How to Add a Sitemap to WordPress

The first mistake is submitting two sitemaps. When you install Rank Math or Yoast, the plugin replaces the core sitemap, but the old address may still load.

The second mistake is forgetting the sitemap after a site change. A new theme, a new cache plugin, or a move to a new host can break it silently. After any change, open the sitemap address and check it loads. The third is treating the sitemap as an SEO strategy on its own: it helps Google find content, but it does not make thin content rank. Our WordPress security checklist and backup guide cover two other foundations every site needs — and if you edit theme files, our child theme guide shows how to customise safely.

Frequently Asked Questions

How do I add a sitemap to WordPress for free?

Use the built-in sitemap at /wp-sitemap.xml, which WordPress has generated automatically since version 5.5 at no cost, or install the free version of Rank Math or Yoast SEO. In short, how to add a sitemap to WordPress for free has three answers, and all of them cost $0.

Where is my WordPress sitemap URL?

It depends on what generates it. With no SEO plugin, it is yoursite.com/wp-sitemap.xml. With Rank Math or Yoast SEO installed, it is yoursite.com/sitemap_index.xml.

How long does it take Google to index a sitemap?

Google usually fetches a newly submitted sitemap within a day, and the Search Console Sitemaps report shows a “Success” status with the number of URLs discovered.

Do I need a sitemap if my site is small?

Yes, even a small site benefits. A sitemap costs nothing, takes minutes to set up, and guarantees Google knows about every page — including new posts and pages with few incoming links.

Can I add a sitemap to WordPress without a plugin?

Yes. WordPress has built XML sitemaps into core since version 5.5, so a sitemap already exists at /wp-sitemap.xml on any public site running a current version. No plugin is needed to follow how to add a sitemap to WordPress unless you want image sitemaps, per-post exclusions, or video and news sitemaps.

Why is my sitemap showing a 404 error?

Stale permalink rules are the usual cause. Go to Settings, then Permalinks, and click Save Changes to flush the rules.

The Bottom Line

Learning how to add a sitemap to WordPress is one of the highest-value ten-minute jobs in WordPress SEO. The built-in sitemap needs no work at all, Rank Math and Yoast SEO both build a better one for free.

Google Search Console sitemaps report showing a submitted sitemap with a rising indexing graph

Verdict: The fastest way to learn how to add a sitemap to WordPress is to use the one you already have: WordPress core generates one at /wp-sitemap.xml since version 5.5. For more control, install Rank Math free ($0), use /sitemap_index.xml, and submit it in Search Console.

All facts and prices verified against official documentation and vendor pages on 21 November 2026. Prices change without notice — confirm the live figure at checkout.


Sources: WordPress core sitemaps, Make WordPress Core: https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/ — Build and submit a sitemap, Google Search Central: https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap

Leave a Comment