How to Create an XML Sitemap in WordPress

Sitemap Creation Made Easy

Sitemaps act as a guide for search engine bots to understand what content lives on your site and where they can find it. They come in two forms which include XML and an HTML version. The XML version looks like code that is followed by search engine bots. The HTML version (which is optional) is more of a guide for users who want to know what’s on your site. In this blog post, I will show some WordPress sitemap plugins, how to create an XML sitemap without a plugin, why you should update your robots file afterward, and how to let Google and Bing know about the file that you created.


WordPress Sitemap Plugins


There are many plugins that are sitemap generators for WordPress. One of the best SEO plugins out there is Yoast. Yoast will include the option to automatically use the sitemap that it has created for you when you use this plugin. To do this, you need to directly head over to our SEO tab and look for sitemaps. From here, you want to click on the enable button. Once completed, you will have a range of settings that you can do to play around with the sitemap. You will even see a link that will show you your live XML sitemap on your site.


Yoast XML Sitemap


If you don’t have Yoast, you can still find a great plugin that will do the job. If you go to your plugins add a new section, you can search for XML sitemaps and see an extensive list to download from. Almost all of them work the same way. You click on install now and activate to get going. One thing that I would recommend is checking on the star ratings, the last time it was updated, and if it is compatible with your theme. Since you only want to make this and move on, you should choose a plugin that works best. Some of the best ones that I have seen are All in One SEO Pack, Google XML Sitemaps, Simple XML Sitemap Generator, and more.


Sitemap Plugins for WordPress


All in all, WordPress makes this entire process so simple. Creating sitemaps using a plugin in WordPress is the perfect option for people who want something quick and don’t want to spend a lot of time building a file. However, I do have to stress is that sometimes you get what you get for free. Plugins are a fast solution, but sometimes lack the proper priority settings, or might have a hard time finding all of your content. If you are looking to expand this further, we should move to the next section.


Creating an XML Sitemap Without a Plugin

For the longest time I have used Yoast for my XML sitemap, but I noticed for some reason that not all of my main pages were in the sitemap. This was a little curious, so I decided to use an XML generator online to view my site and create a sitemap on my own. The steps are actually really simple, but you will need access to your file manager to upload the file to the domain. Here is a screenshot of the steps below.


How to Create a Sitemap Steps

    1. Step 1: Type in your website address
    1. Step 2: Put the frequency to weekly. You can put this for daily and monthly as well
    1. Step 3: Last Modification is set to use the server’s response.
    1. Step 4: Change the priority of auto detect. This is incredibly important because you are using your server for this. That means that this sitemap is going to look at your most traffic pages and adjust the crawl to make sure that is being indexed as often as possible.
    1. Step 5: Click start

XML Sitemap Generator


Once the file is done, you will see a screen that lets you view the XML file and then tells you to add it to the domain. As a note, I decided to open that link within Google Chrome and then I right clicked on the page to save the file as (sitemap.xml). You want to do this because you need to keep the data that was just created so you can add it to your domain. By saving it as that name, you will have a clear URL patch that will look like (


XML File Ready


One thing to be aware of is that by doing this, you are giving all of your pages over to this file. If you have any pages blocked in the robots.txt file, you should remove them when you submit the data. Since you are already preventing them, you don’t need to tell Google and Bing “hey don’t look at these pages, but look here and if you see them then don’t look at them”. That is a waste of their time and their efficiency.


Add the XML File to Your Domain

XML SItemap Added to Domain


This step will be different depending on who you use for your hosting. If you are not sure who your host company is, I would recommend checking in with your webmaster or looking at your credit card to see who is billing you for hosting. Once you find that out, you can contact that hosting provider to get into your file manager. Assuming that you are able to get into your file manager without a problem, you will need to drag and drop the file into it. Just make sure you have the public folder selected when you drag and drop. You will see that on the left-hand side since it is bolded.


Edit the File for Maximum Efficiency


The reason why I decided to create my own sitemap without a plugin was the ability to have control. I wanted to edit the sitemap within my domain to remove pages I already blocked within the robots.txt and change some of the priority within that. Some plugins give you limited control like Yoast, so that is why I am advocating creating your own. Here I am in my own file going through and manually removing pages that should not be in the file. This step is so easy to do. You just right-click on the record and go to edit. From there, you go line by line through and delete pages you don’t want in your sitemap and change the priority for some of the leading pages. Once done you click on the save button.


manually removing files in a xml sitemap for SEO


Opening and Ending Tag Mismatch


XML Error Code


If you run into any errors by doing this, you will see a message like this above. This message simply states that something is not set up correctly. What you need to do is jump into the code editor tab and view the code for the file. Chances are you have an extra space or / mark that is throwing off the file. Once you find that, you can update that code and then the file should read properly. Make sure you clear your cache if you are still seeing this issue when you reload this page in a browser like Edge, FireFox, or Chrome.


If the file seems like it is working fine, I would then opening up your sitemap in incognito in Google Chrome. Sometimes it is just a caching issue and it is not showing the proper listing. With Incognito, you will then have a more clear way of looking at your site.


Update Your robots.txt File


Sitemap in the Robots.TXT File


With the sitemap now updated, we want to show this in our robots.txt file. This file is one of the first places Google and Bing look at when they come to your site. This is essentially the guide to your website. Here you will let both search engine bots know what to look at and what not to look at. Since they are already here, you might as well put a link to your sitemap since you just spent the time creating one. Within your file manager, you want to look for a rile that reads robots.txt. Once you find that, you want to click on edit and then add the sitemap line underneath it. Here is an example of how I did this on my site.


Let Google and Bing See the File


Finally, we are in the final and the easiest stage of all of the steps. With the sitemap XML file created in WordPress, we want to let both search engines know about it. The best part of the XML file is that Google and Bing will both use it. You have to go to Google Search Console and Bing Webmaster Tools to submit the sitemap. As a note, Google and Bing will find the sitemap regardless, but you want to alert them to this file as soon as possible. Both tools will also show you how many have been submitted and Google will even show you how many have been indexed.

Both tools are pretty easy to understand where to update this, so just head over to the sitemap section and paste in your XML sitemap URL.



Google allows you to test and submit a sitemap. I recommend testing first just to make sure everything was processed correctly. Once the file comes back ok, you can then click on the blue button to submit the sitemap over to Google.

Google Sitemap Added



Bing just has the submit button and not a test button. You should submit the sitemap first within Google and test to make sure it is ok, so you know it will most likely work within Bing. Once the sitemap is submitted, you will see how many pages are indexed within Bing.

Bing Sitemap Submission




Sitemap creation only takes a few moments, but it is one of the most important things to get right when it comes to SEO. A proper and clean sitemap will allow Google and Bing to understand what is on your website and will tell them what to crawl and how often. Here is how to check for errors on your sitemap using Screaming Frog.


Sitemap Creation Made Easy