If you’re trying to figure out how to create a sitemap in WordPress, you’ve come to the right place. We’ll go over some of the basics about sitemaps – both XML and HTML) and then dive into how to create XML sitemaps in WordPress as well as HTML sitemaps in WordPress.
What is a Sitemap File
A sitemap file is primarily used to tell search engine what pages are on your site so that they can index and rank all of your content. There are two common kinds of sitemap files – XML sitemaps and HTML sitemaps, with XML sitemaps being more common.
What is an XML Sitemap vs HTML Sitemap
An XML sitemap is purely to help Googlebot discover your content while an HTML sitemap can be used to help your content rank better as well. XML sitemaps are generated and then submitted directly to search engines through Google Search Console or Bing Webmaster Tools. You should only list URLs that report a 200 HTTP response code and are indexable (not blocked by robots.txt or noindexed). Basically, the XML sitemap spoon feeds search engines a list of your pages that you want indexed. Effectively, search engines use XML sitemaps primarily to discover new content on your site.
An HTML sitemap is similar to an XML sitemap in that it lists pages on your site, but it is usually user facing (or at least accessible). Typically, HTML sitemaps are linked to in the footer. This passes “link equity” (conceptually: value) to the HTML sitemap from every page on your site. This links to every page (or at least your most important pages on your site). While this does help Google “discover” your content, it also helps them rank better in Google since it generates link equity to the end URLs. If you have a good site architecture and internal linking, HTML sitemaps are typically not needed if you already have XML sitemaps in place.
Do You Need an XML Sitemap
While XML sitemaps are not a requirement for a website, they are typically help Google find your content faster so they are generally a good thing if you want traffic from Google. If you do not care about search traffic, then you do not need an XML sitemap.
Does WordPress Generate a Sitemap
No – WordPress does not automatically generate a sitemap for you but there are plugins that can help you generate both XML sitemaps and HTML sitemaps. Keep reading below to find out how to create both types of XML sitemaps.
How to Create an XML Sitemap in WordPress
As XML sitemaps are not a native part of WordPress, you will need to generate them through a plugin. If you have an SEO plugin, such as Rank Math, Yoast, or All in One SEO – this plugin will handle creating an XML sitemap for you. Alternatively, you can install a plugin dedicated to XML sitemaps. I’ll go through both an SEO plugin and a dedicated XML sitemaps plugin setup process below.
Creating WordPress XML Sitemaps with Rank Math
When you install Rank Math and go through the setup process, you should be given the option to enable XML sitemaps. If you have another SEO plugin such as Yoast or All in One SEO, simply search for the XML sitemaps settings in your plugin to ensure they are setup.
If you would like to validate that you have setup your XML sitemaps, select the “Sitemap Settings” in the left hand bar under Rank Math. Here you can:
- Ensure that XML sitemaps are enabled
- View your XML sitemap
- Determine the number of links per XML sitemap (should be less than 50,000)
- Choose which pages are included in your XML sitemap (ex: posts, pages, categories, tags, images, etc)
How to Create WordPress XML Sitemaps with Google XML Sitemaps Plugin
A popular XML sitemaps plugin is Google XML Sitemaps. This plugin is dedicated to creating XML sitemaps and nothing else. After installing and activating Google XML Sitemaps, you can find the plugin settings by navigating in the left hand navigation to:
Settings > XML Sitemaps
From here you will be able to find your XML sitemap and manage your XML sitemap settings.
How to Make an HTML Sitemap File in WordPress
To make an HTML sitemap file in WordPress, you will need to either manually curate all of you posts and pages on a single page, or use a plugin like Simple Sitemap, which will automatically create an HTML sitemap for you. After installing and activating you can go through several different settings (Note there is a pro version of the plugin which unlocks several settings):
In the Simple Sitemap plugin settings, you can go and specify pages that you’d like to exclude from your HTML sitemap.
Historically the Simple Sitemaps plugin worked off of short codes – you’d place a short code on a page and then the HTML sitemap would be rendered on the page. Now, you can leverage the modern Gutenberg blocks system to create your HTML sitemap.
But you can also use the legacy short codes to create your XML sitemap. The pro version of Simple Sitemaps allows for additional short code features and attributes.
How Do I Find My Sitemap in WordPress
XML sitemap plugins will typically list your sitemap in your robots.txt file – this is the easiest place to start looking for your XML sitemap file in WordPress. If your XML sitemap file is not listed in the robots.txt file, you should try looking in the settings for the plugin that generates the XML sitemap file (as shown above) – these plugins will typically show you where you can find your XML sitemap file in WordPress.
How to Submit Your WordPress XML Sitemap to Google (and Bing)
In Google Search Console as well as Bing Webmaster Tools, you are able to provide Google and Bing with your XML sitemaps so that they can easily find all of your content: