In this tutorial, you are going to learn how to create a sitemap for WordPress. Sitemaps help SEO as they are a list of all the pages on your site.
Submit this list to Google and Bing to help your pages appear in the search results.
We will create a sitemap for your site step-by-step we will also cover how you can then submit this to Google and Bing.
There is a lot to cover, let's get started.
What Is a WordPress Sitemap?
A WordPress sitemap is a list of all the pages on your website. This list should only include the pages that you want to appear in search engines. Google, Bing and others will read your sitemap to find all the pages.
Googlebot or Bingbot are two web crawlers that will then visit your pages from the list.
Once the web crawler visits the page it will appear in the search results.
This is why it is important to generate a sitemap and then submit it to the search engines.
We will cover both in this tutorial.
HTML vs XML Sitemap
There are two types of sitemaps HTML and XML. They both have the same content as they show a list of all the pages on your site. Yet, they have different purposes.
Let's look at both types and the difference.
What is an HTML Sitemap?
An HTML sitemap was very common in the past. This is a web page on a website that will list all the pages on a site and is easy to read.
You can often find a link to the HTML sitemap in the footer of a page. For example, there is a link to an HTML sitemap on the footer of the Samsung site.
This HTML sitemap is becoming less and less common now. The reason is that these HTML sitemaps would help people find a page they were looking for.
Search engines are so good at finding the page we want these days that HTML sitemaps are rarely used.
If you don't need an HTML sitemap then what type of sitemap do you need?
What is an XML Sitemap?
An XML sitemap is not for your visitors to find the page they are looking for. Its purpose is to give a list of pages to web crawlers and search engines.
The XML format is a computer format used for computer to computer transfer. It looks like this:
This one is from the Yoast SEO plugin.
We will look at how to create a sitemap using four common SEO plugins later.
But what it you have an SEO plugin installed already?
How Can You Find a Sitemap in WordPress?
There is a chance that you already have a sitemap, as they can be well hidden. This is because a sitemap can have any URL but there are a few tricks to see if you already have one.
The first is to look in a file called robots.txt as this file will sometimes list your sitemap URL. You will find your robots.txt file at the root of your site like this:
Change example.com with your domain and see what the file has inside. For example, the PageDart robots.txt file has a link to the sitemap:
If there is not a Sitemap link don't worry there are still a few URLs we can try. The first is the most common URL:
If it is not here are a few other filenames you can try:
To get the above list we looked at over 7000+ of the most popular websites on the internet. If you still cannot find a sitemap then we can create one using a plugin. Let's look at this next.
How to Generate an XML WordPress Sitemap?
The simplest way to generate an XML sitemap in WordPress is to use a plugin. Many of the SEO plugins have this feature built in.
Once you add a plugin you will not have to worry about the sitemap again. This is because these plugins will keep the sitemap up-to-date as you add new pages to your site.
The four plugins we are going to cover are:
All in One SEO
You only need one of these plugins and chances are you have one installed already. If you don't then I recommend that you install Yoast first.
Create a Sitemap with Yoast
With Yoast on your site you will find the settings in the side menu:
Select “General” from the side menu. At the top of the next page select the “Features” tab:
This page is full of toggles and one of these is “XML sitemaps”. Switch this on:
If it is you will find the sitemap at this URL:
Replace example.com with your domain name. The sitemap will look something like this:
Create a Sitemap with All in One SEO
With the All in One SEO plugin sitemaps are not turned on by default. You need to make sure that you add the feature. To do this go to the menu and select “All in One SEO” then “Feature Manager”:
The first feature you will see is “XML Sitemaps”:
It is a free feature and all you need to do is click activate. The feature is now on and you can visit the sitemap at:
The sitemap looks like this:
Create a Sitemap with Rank Math
RankMath can also create an XML sitemap. This is a setting that you can enable during the installation of the plugin. If you did not enable it then you can switch it on by going to “Rank Math” and then click on the “Dashboard”:
If you scroll down to the bottom of the page you will see the Sitemap toggle, switch this on:
Once on you will find the sitemap at this URL:
The sitemap is like that from All in One SEO:
Create a Sitemap with SEOPress
SEOPress has a menu option for sitemaps. You can find it on the side menu like this:
At the top of the screen is a toggle to activate the sitemap:
Once you enable the toggle scroll down to the bottom and select “save changes”:
There is a button to view the sitemap which will be at this URL:
The sitemap will look like this:
How to Submit WordPress XML Sitemaps to Search Engines?
Now that you have created an XML sitemap for WordPress we need to let the search engines know where the file is. To do this you will need to submit your XML sitemap to Google and Bing.
Google has a tool called Google Search Console that lets you register your domain name. Once registered you can then submit your sitemap.
Bing also has a tool called Bing Webmaster Tools and this has a similar feature.
I have written two tutorials on how to submit your sitemap to Google and Bing. I recommend that you follow these next.
Make sure to set up Google Search Console first because Bing can use the Google data for quick setup:
In this tutorial, you have learned how to create a sitemap for WordPress. We have covered what is a sitemap and the difference between an HTML and XML sitemap:
HTML sitemap - A legacy webpage that would list all the URLs on a site. Designed to make it easy for visitors to find the page that they are looking for. No longer needed as search engines are better at this job.
XML sitemap - A special file used by search engines like Google and Bing to find and index all the pages on your site.
We looked at a few ways to locate an existing sitemap by using the robots.txt file and some common filenames. If there is not a sitemap then we also covered how to create a sitemap for WordPress using plugins.
We looked at four plugins:
All in One SEO
Remember that you only need one of these plugins and if you do not have one installed then first start with Yoast.
Finally, we covered how to submit the sitemap to Google and Bing. Make sure that you submit to Google first as this makes it easier to set up Bing.