Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

What is an XML Sitemap? How to Create a Sitemap in WordPress?

Last updated on by
Follow WPBeginner on YouTube
What is an XML Sitemap? How to Create a Sitemap in WordPress?

Back in early 2000s, government websites used to have a link on their main pages, titled “Sitemap”. This page usually contained a list of all the pages on that website. Even today some websites have such HTML sitemaps. However, sitemaps have evolved so much from the manually created HTML bulleted list. Today sitemaps are published in XML instead of HTML and their target audience is search engines and not people. Recently one of our users sent us an email asking us: what is a WordPress sitemap? Do I need to have a sitemap on my site? How can I create a sitemap in WordPress? If you are new to WordPress and had the same questions, then you are at the right place. In this article we will explain what is a sitemap, why you need a sitemap, how to create a sitemap in WordPress, and how to tell search engines about your sitemaps.

What is a WordPress XML Sitemap?

Sitemap is a list of pages on a website that is accessible to all users. An XML sitemap is a way for website owners to tell search engines about all the pages that exist on their website. WordPress XML sitemap also tells search engines which links on your website are more important than others and how frequently you update your website. While sitemaps do not boost your search rankings, it allows search engines to better crawl your website.

Screenshot of WPBeginner posts sitemap

Why You Need an XML Sitemap

From a Search Engine Optimization (SEO) point of view sitemaps are extremely important. First we would like to clearly state that adding a sitemap does not affect search rankings. However, if there is some page on your site that is not indexed, then sitemap provide you a way to let search engines know about that page, so it can be indexed properly.

Sitemaps are very useful for new websites and blogs. As most new blogs usually don’t get many backlinks to their individual posts, it becomes harder for search engines to discover all of their posts and pages. Sitemaps allow those websites to help search engines crawl their sites more efficiently.

For popular websites, sitemaps allow your website to interact with search engines more effectively. Search engines can guess how often your site is updated, which parts of your website are more frequently updated than others, set crawl rate for your site, etc. This improves the overall visibility of your site to search engines.

Video Tutorial

If you don’t like the video or need more instructions, then continue reading.

How to create a Sitemap in WordPress?

There are several ways to create an XML sitemap in WordPress. At WPBeginner, we use Yoast’s WordPress SEO plugin to generate our sitemaps. We use this plugin because it allows us to optimize our blog posts along with offering other features such as sitemaps, social integration, and more. We have also noticed that it works more efficnelty than other standalone sitemap generators for WordPress. Lastly, it also offers custom sitemaps like the Video Sitemap.

To add a sitemap to your WordPress site, first thing you need to do is install and activate WordPress SEO by Yoast plugin. By default, WordPress SEO does not enable XML sitemap functionality, so you will have to turn it on. To do that go to SEO » XML Sitemaps and check the box to enable XML sitemap functionality.

Enable XML WordPress Sitemaps in WordPress SEO plugin

When you check the box to enable XML sitemap functionality, WordPress SEO will show you a number of options that you can configure for your Sitemaps. If you are unsure about what to do with them, then ignore them and click on Save settings.

Now your sitemaps are generated and publicly accessible. WordPress SEO will show a XML Sitemap button which you can click to view your sitemap_index.xml sitemap.

How to Tell Search Engines About Sitemaps?

Search engines are quite smart in finding a sitemap. Whenever you publish new content a ping is sent to Google and Bing to inform them about changes in your sitemap. However, we recommend that you submit your sitemap to Google by using Google Webmaster tools. The benefit of this is that Google will now show you any errors, pages indexed, and other relevant stats that will be helpful to you as a webmaster.

Go to Google Webmaster Tools. If you are not already signed in to your Google account, then you will be asked to sign in. After signing in you will reach webmaster tools. There you will see “Add a site” button, click it and then add the URL of your website.

On the next screen you will be asked to verify the ownership of the website you are trying to add. There are several methods to do that. But since you are already using WordPress SEO plugin, then the easiest method for you is to copy the HTML Meta tag value and paste it in WordPress SEO plugin. To do that click on Alternate methods and then on HTML Tag. You will then see a line of HTML Meta tag code.

Verify ownership of your website in Google Webmaster Tools with HTML Meta Tag

Copy and paste this line in a text editor like notepad. Now copy the value in the content=”” (Without copying the commas). Leave the webmaster tools site verification page open because we will come back to the page after adding the meta tag to verify the ownership of the website. Go to your WordPress admin area and then click on SEO tab. This will take you to WordPress SEO plugin’s dashboard. Scroll down, and you will see Webmaster Tools heading. Paste the meta tag value you copied next to Google Webmaster tools and Save Settings.

WordPress SEO Webmaster Tools

Go back to Google webmaster tools, site verification screen and press the verify button. You will see a notice like “Congratulations you have successfully verified your ownership of”. Click continue to see webmaster tools dashboard for your site.

On the next screen you will see Sitemaps column with no sitemaps in it. Clicking on it will take you to a Sitemaps page where you can add your sitemaps. Click on the red button labeled “Add/Test Sitemap” and provide the URL of your sitemap.

Adding your wordpress xml sitemap in Google webmaster tools

Yoasts WordPress SEO plugin publishes multiple sitemaps for your WordPress site. The main sitemap is sitemap_index.xml which contains link to your other sitemaps. You can either submit sitemap_index.xml alone or submit all other sitemaps one by one. We recommend submitting sitemap_index.xml alone, Google will then automatically discover other sitemaps and crawl them.

Once you have successfully added your sitemap, it will appear as pending. It will take Google sometime to crawl your website. After a while you would be able to see some stats about your sitemap. It will show you the number of links it found in your sitemap, how many of them got indexed, a ratio of images and web pages, etc.

A view of sitemap stats graph in google webmaster tools

Visit Google Webmaster tools often, at least once a month. As your site gets older you will start seeing more and more useful data about your website and how it is seen by the search engine. This information can help you learn how well your site is doing and what other things you can do to improve its performance in search engines.

We hope that it answered all the related questions like what is an XML sitemap, what are the benefits of a sitemap, how to create a sitemap in WordPress, and more. If you have any questions, or noticed that we missed something, then please leave a comment below.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. Bikramjit Singh says:

    Thank You! These small things such as issue when needed urgently.Thanks a lot for the article.

  2. Saikot Hc says:

    Thanks bro because share this plugin.

  3. marshall says:

    thanks a ton!!! its awesomely written

  4. Anatoly Khalizev says:

    Thank you very much for such delailed explanation. It is very useful!

  5. Adrian says:

    My Site Map URL returns a 404 :/ anyone knows why this is? I already followed the steps to get it :(

  6. Santhosh Veer says:

    how to edit this sitemap?

  7. WPBeginner Staff says:

    You will have to verify your owner ship of the site by adding a meta tag or uploading a file to your web server.

    • Shamim Gypsy says:

      Thanks for your reply. Will it harmful for the site if I verify the site with new email ID?

      • Grayson Carter says:

        Its not harmful to the site from an SEO perspective, however, if your boss has already verified the site under his account, you’ll loose all historical data under his account. The best solution would be for him to add you as an administrator for that site in GWT and then you can see all the historical data he’s collected and you can still handle submitting a site map

  8. Shamim Gypsy says:

    My boss already have a webmaster account. He did not add xml site map. But now I want to add site map without his webmaster account. that means I want to add site map with my email webmaster account. Is it possible to use double webmaster account for one site?

  9. Tholi says:

    How do I make my site maps appear on one page under my domain name?

  10. Taylor Thompson says:

    Great post! Thank you for all of the helpful information :) However, I still have a few questions. Why does Google index only some of the pages you submit with a sitemap? Also, I see that you have images indexed. I have numerous images on my site, and none of them were indexed. Is there a separate process to index images?

    Thank you!

  11. Yatin says:

    I have uploaded sitemap_index.xml on webmaster. My first blog was seen on the google search. But my other posts are not getting indexed. What is the reason behind it? Do we need to add post-sitemap.xml or category-sitemap.xml individually then?

  12. sudan says:

    do i need to submit sitemap offten on google webmaster tool ? becuase my new post still not count

  13. WPBeginner Staff says:


  14. nazifa mazni says:

    if I already setup xml sitemap from wordpress seo yoast. do I need uninstall plugin Dagon Design Sitemap Generator, google sitemap and google xml sitemap?

  15. Lencho says:

    followed your instructions and when I clicked on the “You can find your XML Sitemap here: XML Sitemap” it took me to this error mesage:

    “Not Found
    Sorry, but the page you were trying to view does not exist.
    It looks like this was the result of either:
    a mistyped address
    an out-of-date link”

    Now what?


  16. KC Wong says:

    I follow the steps as per video, when click “xml sitemap”, it shows 404 rather than the list. How can I improve it?

    • Geoff says:

      In the Yoast SEO plugin settings for XML sitemaps, untick the box for “Check this box to enable XML sitemap functionality.”, SAVE, then tick the box and SAVE again. This got everything working for me after much reading and not finding any answers. Many people seem to be having this issue so I hope this helps someone.

  17. calmberay141182 says:


  18. Edwin Juma says:

    Thanks alot! my new site is now working well.

  19. D Donaldson says:

    Helped me more than anything I have found in the very difficult endeavor of selfing a site. Thank you. Owe you one.

  20. Ankit Jha says:

    I want to edit the XML file created by SEO by Yoast Plugin. Where can I find the file?

    • Walter Mrowczynski says:

      Pretty sure any change you make will be overwritten whenever you make a new page/post.

  21. TheRookieUser says:

    Thank you! I have a new site and your tips really works well for me :)
    Have a great day!

  22. Keith Davis says:

    Thanks guys
    I’m just looking at the Yoast SEO plugin and I’m checking out info on XML sitemaps.
    As ever you guys nail it.

  23. Marlon Buenaventura says:

    Hi! My homepage title duplicates, what was the reason behind it? How can I fix the error? Please help! Thanks!

  24. susielindau says:

    Does this work for .com sites? if not, what can I do to make my site easy to crawl?

  25. Max says:

    Very good . I love this. Helpful.

    Thanks from Thailand.

  26. Tina says:

    Thank you for this article. I had just assumed the sitemap was pulled once I verified my site. Great article & thanks for teaching me. You’re my #1 stop to find out information.

  27. micheal says:

    Nice post. Was able to set my sitemap in seconds thanks to your wonderful tutorial.

  28. Dennis West says:

    Yoast WordPress SEO: XML Sitemaps
    I am getting an error when I click on the XML Sitemap button
    Not Found

    The requested URL /sitemap_index.xml was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Apache/2.2.24 (Unix) mod_hive/3.6 mod_ssl/2.2.24 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/ mod_jk/1.2.35 Server at Port 80

  29. Jane Barlow says:

    Wish I’d have found this hours and hours ago. My site is now validated thanks to your easy to follow guidelines.
    Most appreciated with heartfelt thanks.

  30. Ian says:

    Great article. Thank you!
    It’s taken me ages until now, but up and running.

  31. Quizvook says:

    Awesome post,i created my site sitemap using this method thanks a lot for sharing Syed Balkhi.

  32. mike jefferies says:

    Used Yoast WP SEO, it took time but pleased to say succeeded, which I put down to WP4B well explained “idiots guide” (no disrespect to anyone..merely applies to me). Many thanks guys, you haven’t failed yet.

  33. wajid khan says:

    Hi, great article about sitemaps. Mind me asking that if i am using a plugin like seo by yoast, which creates multiple sitemaps how can i achieve what you have mentioned above?

    • WPBeginner Support says:

      In this article we did show how to do this using WordPress SEO plugin. However, if you are using some other plugin to generate sitemaps. Then make sure your sitemaps are publicly accessible and then submit the sitemap URL in Google Webmaster Tools.

  34. Larry Woods says:

    Good article. Too bad Yoast doesn’t generate a sitemap on my site! And, judging from the number of complains on the WP forum there are others that are having the same problem. The frustrating thing is that when you press the “XML Sitemap” button it displays a sitemap. It just doesn’t create it.

    • Mauritz Mostert says:

      A valid statement Larry. I am sorry you didn’t get an answer because I have been puzzling about exactly what you refer to. When I click on the “XML Sitemap” button in Yoast I get nothing! Only a blank page.

      I have 24 Posts and 62 pages in just under a year, all submitted to Google myself. I have submitted my sitemap five times for almost a year to Google Webmaster Tools and the result is still 7 submitted and 5 indexed. I can’t understand how that works?

      I don’t even have a sitemap displayed, never mind created by Yoast. There is no way to cross-reference Yoast to see if the job is indeed done or not… sad.

  35. Reyansh says:

    once again excellent article.
    falling in love with wpbeginner.:)

  36. Avinash says:


    Google webmaster tools showing error as on sitemp being the sitemap is a html.

    Works fine on my 2nd site, but not on the 1st site.

    I’ve tried suggestion given on about adding the sitemap to the exclusion list on using W3Total Cache plugin. Error still persists.

    Any other suggestion would be helpful.

  37. Jennifer Ebeling says:

    Awesome post! Thank you!

  38. Andy Peck says:

    What a brilliantly clear article – very easy to use and run through. many thanks

  39. Chris Lovie-Tyler says:

    Thanks, this was helpful to me. Yoast’s WordPress SEO is a great plugin.

  40. Abdullah Abduragmaan says:

    Please can you advise if it is possible to stop non-search engines from accessing the site map?

    OR if one can change the path of the files or something. I am concerned scrapers will get access to the sitemap.

    • Editorial Staff says:

      Not unless you modify the plugin. Scrapers will scrape your content regardless. They don’t need RSS for that.

  41. Michael Dimas says:

    NICE POST !!! (y)

  42. Anshar says:

    If i install wordpress in the directory (not in the root) ex.
    where is the place to submit the sitemap page? after domain like or after the directory where i install wordpress on it, like

  43. Rose says:


    I am kind of new. 2 questions to ask
    1. How frequent should we submit our sitemap, is it necessary to submit each we created a new post.
    2. do we need to submit sitemaps all including those related to categories, tags, pages number or just purely the blog posts?


  44. MJ says:

    It appears that Editorial Staff is busy somewhere…..

  45. MJ says:

    With reference to my previous comment can you please answer my query. When i type my site name in Google, it shows the last update as 3 or 4 days old. I tried different setting of Yoast WordPress SEO plugin but i couldnt’ find anything that could resolve it.

    I am sceptical that my posts are not reaching to Google on time. I check the sitemap and found that ‘Post Priority’ of all the posts as ‘60%’. Can it be changed to 100% without manually editing it from “Yoast admin area in Post”? Is this priority factor actually is the reason behind outdated update in Google Search result as mentioned above…?

  46. MJ says:

    I am using WP SEO by Yoast but interestingly my site map vanishes from the Google Webmaster Dashboard and it starts showing ‘0’ URL submitted. When i click on this section to go into detail, i find “/sitemap_index.xml” as “Pending”.

    It happens most of the time in a week and i have to resubmit it again and again. What is the solution to this?

    Secondly when i search my site in Google, it shows updated time as 2 or 3 or sometimes 4 days ago whereas, the site is updated every day. This is all happening since i have installed WP SEO by Yoast.

    Yoast does not respond to such queries, i thought i would get a solution here….

  47. Nikunj says:

    Thanks for enlighten us I want to ask one question that We should include our categories in sitemap or Posts in sitemap which one should be at higher priority POST or CATEGORY ? plz tell

    • Editorial Staff says:

      WordPress SEO by Yoast gives you the option to choose whether you want to add categories, tags, other taxonomies in your sitemap or not. We have our categories in the sitemap. Posts should always have a higher priority over the archive pages just because most folks usually land on your single post pages rather than archive pages.

  48. David says:

    Thank you, that was a useful post. I’ve been wondering if it’s necessary to post Yoast’s sitemap to the WT area.

    • Editorial Staff says:

      It’s not necessary, but it will help you see if there are any errors and such.

      • David says:

        So does a bot know to look for that map? Or is Yoast’s plugin actually submitting it anyway?

        • Editorial Staff says:

          To get the best results and confirmation that the bot is actually seeing your sitemap, you should submit the sitemap in Google.

  49. Keith Davis says:

    Hi Syed
    I submit a sitemap to Google via Webmaster tools and my sitemap is a simple .txt file.

    Each time I write a post I add it to the sitemap and resubmit.
    Only takes two minutes and it’s part of the SEO I carry out for each post / page.

    Would I be better off going with an XML sitemap?

    • Travis Shak says:

      Hey Keith,

      You definitely would be better off using an XML sitemap. Its a no brainier. With the Yoast SEO plugin, your sitemaps will be automatically generated which leaves more time to work on the important things.

  50. Umer Rock says:

    I understood Sitemap but facing a strange issue with wp seo by yoast plugin, when we go for scan our website with any seo online tool, in report show this sitemap.xml not found blah blah,
    because WP seo by yoast make like / post_sitemap.xml etc. any solution..

    • Editorial Staff says:

      Those SEO tools don’t know any better.

    • Gautam Doddamani says:

      exactly those seo tools are taking sitemap.xml as the url and not post_sitemap….since yoast maintains a wide variety of sitemaps such as for video, pages, categories and tags…we get the post sitemap url for posts!!

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.