,

How to Create a Sitemap in WordPress (3 Easy Ways)

Create a sitemap in WordPress

An XML sitemap is a list of the important URLs on your site, written for search engines. It helps Google and Bing find every post and page quickly, especially on new blogs with few links pointing to them, and it lets you see indexing stats when you submit it in Search Console.

The good news: WordPress already creates a basic sitemap for you, and any SEO plugin creates a better one in a few clicks. Here is how to set it up the right way.

What Is a Sitemap?

A sitemap is an XML file listing your URLs, often with the date each was last updated. Search engines would eventually find your pages without one, but a sitemap makes discovery faster and more complete. Most WordPress sitemaps are split into a sitemap index with smaller sitemaps for posts, pages, and categories.

Option 1: WordPress’s Built-In Sitemap

Since WordPress 5.5, every site has a basic sitemap at:

https://yourdomain.com/wp-sitemap.xml

It lists posts, pages, categories, tags, and author pages. It works, but you cannot easily exclude content or control it without code. That is why most bloggers let their SEO plugin replace it. When you enable an SEO plugin’s sitemap, it switches off the core sitemap automatically, so you never have two.

Option 2: Create a Sitemap With Rank Math (Recommended)

This is what we use on RoadToBlogging.

  1. Install and activate Rank Math SEO from Plugins > Add New Plugin. (How to install a plugin.)
  2. Go to Rank Math SEO > Dashboard and make sure the Sitemap module is turned on.
  3. Open Rank Math SEO > Sitemap Settings. Under General, set links per sitemap (the default is fine) and choose whether to include images.
  4. Under Post Types, include Posts and Pages; exclude anything not meant for search, such as attachments.
  5. Under Taxonomies, include categories if they are useful landing pages; most blogs exclude tags.
  6. Click Open Sitemap to view it at yourdomain.com/sitemap_index.xml.

To keep a single post out of the sitemap, set it to No Index in the Rank Math panel of that post; noindexed content is removed from the sitemap automatically.

Option 3: Create a Sitemap With Yoast SEO

  1. Install and activate Yoast SEO. See our Yoast SEO setup guide.
  2. Go to Yoast SEO > Settings > Site features and make sure XML sitemaps is on (it is by default).
  3. Click View the XML sitemap to see it at yourdomain.com/sitemap_index.xml.
  4. To exclude content types, go to Settings > Content types (or Categories & tags) and set “Show in search results” to off. To exclude a single post, set it to not appear in search results in that post’s Yoast panel.
Example XML sitemap

If your sitemap shows a 404 error, go to Settings > Permalinks and click Save Changes to refresh your permalink rules, then try again.

Other Sitemap Plugins

All in One SEO (AIOSEO)

AIOSEO, used on about 2 million sites, generates XML sitemaps (plus video and news sitemaps in Pro), lets you include or exclude post types, taxonomies, and individual posts, and adds an HTML sitemap for visitors.

XML Sitemap Generator for Google

Formerly called Google XML Sitemaps, this dedicated plugin has about 1 million active installs. Use it if you want a standalone sitemap without a full SEO plugin. Do not run it alongside an SEO plugin’s sitemap.

Sitemap Best Practices

  • Use only one sitemap plugin. Multiple sitemaps confuse search engines and you.
  • Include only pages you want in search results. Leave out thin archives, tags, attachments, and noindexed pages.
  • Make sure every URL returns 200, not redirects or 404s.
  • Add your sitemap to robots.txt with a line like Sitemap: https://yourdomain.com/sitemap_index.xml (Rank Math and Yoast do this automatically). See how to optimize robots.txt.
  • Check the Sitemaps report in Search Console for errors from time to time.

Submit Your Sitemap to Search Engines

Search engines can find your sitemap on their own, but submitting it shows you how many URLs are indexed and alerts you to errors:

Frequently Asked Questions

Does WordPress create a sitemap automatically?

Yes. Since version 5.5, WordPress creates one at /wp-sitemap.xml. SEO plugins replace it with a more flexible version.

What is my WordPress sitemap URL?

With Rank Math, Yoast, or AIOSEO it is usually /sitemap_index.xml or /sitemap.xml. Without a plugin it is /wp-sitemap.xml.

Do I need an HTML sitemap?

Not for SEO. An HTML sitemap page can help visitors browse a large site, but the XML sitemap is what search engines use.

Having trouble with your sitemap? Ask in the comments.

Comments

11 responses to “How to Create a Sitemap in WordPress (3 Easy Ways)”

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Aamir Saleh Avatar
    Aamir Saleh

    Hi Istiak,

    You Have explained Very Greatly, i Like your way of explaining with step by step guide.

    Yoast Plugin Made it Very for simple and easy for Begginer SEO, before few years ago i used to submit sitemap, manually. :)

  2. SM Nuruzzaman Avatar
    SM Nuruzzaman

    Hi Istiak, your nice post just taught me how to create my blog’s sitemap automatically. Many many thanks bro.

    1. Istiak Rayhan Avatar
      Istiak Rayhan

      Glad I could help. Let me know if you need any other bits of help.

  3. Kalpana Sharma Avatar
    Kalpana Sharma

    Hi Istiak,

    Thank you for writing such a detailed article. This is really very helpful. I have installed Yoast SEO Plugin on my blog and this is just an awesome plugin which not only creates sitemap but also provides and guide you about the SEO score of your post.
    Thanks for sharing such in-depth article with us. ALL THE BEST..!!!

    1. Istiak Rayhan Avatar
      Istiak Rayhan

      Yes, Yoast SEO is the ultimate SEO solution for WordPress. You can check this complete setup tutorial of Yoast SEO.

  4. Palash Avatar
    Palash

    Hi, thanks for sharing this message. Currently, I am using Google Sitemap XML plugin which is good working for my blog.

    1. Istiak Rayhan Avatar
      Istiak Rayhan

      Yes, it’s a good plugin. But if you are using both Yoast SEO and Google Sitemap XML plugin at a time, I’d recommend you to use Yoast only.

  5. deepak Kumar Avatar
    deepak Kumar

    What will be its impact on SEO if I don’t submit the Sitemaps to Google Webmastertools?

    1. Istiak Rayhan Avatar
      Istiak Rayhan

      Submitting sitemap to Google Search Console won’t boost your rankings. But it will help you find errors on your site.

  6. Naruto forums Avatar
    Naruto forums

    I wanted to create an XML sitemap for Luffyforums’ blog and i guess this plugin will do wonders for me. Thanks for sharing.

  7. Pawan Avatar
    Pawan

    That was a nice tutorial, Thanks for sharing. I think Google XML Sitemaps is a good plugin for the job.