
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.
- Install and activate Rank Math SEO from Plugins > Add New Plugin. (How to install a plugin.)
- Go to Rank Math SEO > Dashboard and make sure the Sitemap module is turned on.
- Open Rank Math SEO > Sitemap Settings. Under General, set links per sitemap (the default is fine) and choose whether to include images.
- Under Post Types, include Posts and Pages; exclude anything not meant for search, such as attachments.
- Under Taxonomies, include categories if they are useful landing pages; most blogs exclude tags.
- 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
- Install and activate Yoast SEO. See our Yoast SEO setup guide.
- Go to Yoast SEO > Settings > Site features and make sure XML sitemaps is on (it is by default).
- Click View the XML sitemap to see it at
yourdomain.com/sitemap_index.xml. - 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.

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:
- How to submit your sitemap to Google Search Console
- How to submit your sitemap to Bing Webmaster Tools
- How to submit your blog to all major search engines
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.
Leave a Reply