Beginner's Guide for WordPress / Start your WordPress Blog in minutes

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

Are you wondering what is an XML sitemap, and how to add it to your WordPress website?

An XML sitemap helps search engines easily navigate through your website content. It gives them a list of all your content in a machine-readable format.

In this article, we will explain what is an XML sitemap, and how to easily create a sitemap in WordPress.

What is an XML Sitemap and how to create one for your WordPress site

What is an XML Sitemap?

An XML sitemap is a file that lists all your website content in an XML format, so search engines like Google can easily discover and index your content.

Back in the 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.

While some websites still have HTML sitemaps today, the overall usage of sitemaps have evolved.

Today sitemaps are published in an XML format instead of HTML, and their target audience is search engines and not people.

Basically, an XML sitemap is a way for website owners to tell search engines about all the pages that exist on their website.

It also tells search engines which links on your website are more important than others, and how frequently you update your website.

While XML sitemaps will not boost your search engine rankings, they allow search engines to better crawl your website. This means they can find more content and start showing it in search results thus resulting in more search traffic, and improved SEO rankings.

Why You Need an XML Sitemap?

Sitemaps are extremely important from a search engine optimization (SEO) point of view.

Simply adding a sitemap does not affect search rankings. However, if there is a page on your site that is not indexed, then sitemap provides you a way to let search engines know about that page.

Sitemaps are extremely useful for when you first start a blog or create a new website because most new websites don’t have any backlinks. This makes it harder for search engines to discover all of their content.

This is why search engines like Google and Bing allow new website owners to submit a sitemap in their webmaster tools. This allows their search engine bots to easily discover and index your content (more on this later).

Sitemaps are equally as important for established popular websites as well. They allow you to highlight which part of your websites are more important, which parts are more frequently updated, etc, so search engines can visit and index your content accordingly.

That being said, let’s take a look at how to create XML sitemap in WordPress.

Video Tutorial

Subscribe to WPBeginner

If you’d prefer written instructions, just keep reading.

How to create a Sitemap in WordPress?

There are several ways to create an XML sitemap in WordPress. We will show you three popular methods to create an XML sitemap in WordPress, and you can choose one that works best for you.

Method 1. How to Create an XML Sitemap in WordPress without a Plugin

This method is very basic and limited in terms of features.

Until August 2020, WordPress didn’t have built-in sitemaps. However in WordPress 5.5, they released a basic XML sitemap feature.

This allows you to automatically create an XML sitemap in WordPress without using a plugin. You can simply add wp-sitemap.xml at the end of your domain name, and WordPress will show you the default XML sitemap.

Default WordPress XML sitemap

This XML sitemap feature was added to WordPress to make sure that any new WordPress website does not miss out on the SEO benefits of an XML sitemap.

However, it is not very flexible, and you cannot easily control what to add or remove from your XML sitemaps.

Luckily, almost all top WordPress SEO plugins come with their own sitemap functionality. These sitemaps are better, and you can control which content to remove or exclude from your WordPress XML sitemaps.

Method 2. Creating an XML Sitemap in WordPress using All in One SEO

The easiest way to create an XML sitemap in WordPress is by using the All in One SEO plugin for WordPress.

It is the best WordPress SEO plugin on the market offering you a comprehensive set of tools to optimize your blog posts for SEO.

First, you need to install and activate the All in One SEO plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Note: Sitemap feature is also available in AIOSEO Free version. However to get advanced news sitemap and video sitemaps, you’ll need the Pro version.

Upon activation, go to the All in One SEO » Sitemaps page to review sitemap settings.

Enable sitemap in All in One SEO

By default, All in One SEO will enable the Sitemap feature for you and replace the basic WordPress sitemaps.

You can click on the ‘Open Sitemap’ button to preview it to see what it looks like. You can also view your sitemap by adding ‘sitemap.xml’ to the URL such as www.example.com/sitemap.xml.

All in One SEO XML sitemap preview

As a beginner, you don’t need to do anything as the default settings would work for all kinds of websites, blogs, and online stores.

However, you can customize the sitemap settings to control what you want to include in your XML sitemap.

Simply scroll down to the Sitemap settings section.

AIOSEO Sitemap settings

This section gives you options to manage sitemap indexes, include or exclude post types, taxonomies (categories and tags). You can also enable XML sitemaps for date-based archives and author archives.

All in One SEO automatically includes all your WordPress content in XML sitemaps. However, what if you have stand-alone pages like a contact form, a landing page, or Shopify store pages that are not part of WordPress?

Well, AIOSEO is the only plugin that lets you add external pages in your WordPress sitemap. Simply scroll to the Additional Pages section and turn it on. This will show you a form where you can add any custom pages that you want to include.

Adding additional pages to your WordPress XML sitemap

You simply need to add the URL of the page that you want to include and then set a priority where 0.0 is the lowest and 1.0 is the highest, if you are unsure then we recommend using 0.3.

Next, choose the frequency of updates and the last modified date for the page.

You can click on the ‘Add New’ button if you need to add more pages.

Don’t forget to click on the ‘Save Changes’ button to store your settings.

Excluding Specific Posts / Pages from your XML Sitemap

All in One SEO allows you to exclude any post or page from your XML Sitemaps. You can do this by clicking on the Advanced Settings section under the All in One SEO » Sitemaps page.

Excluding items from your WordPress XML sitemap

You can also remove a post or page from your XML sitemaps by making it no-index and no-follow. This will block search engines from showing that content in search results.

Simply edit the post or page that you want to exclude and scroll down to the AIOSEO Settings box below the editor.

Removing a post or page from XML sitemap using robots.txt

From here you need to switch to the Advanced tab and check the boxes next to ‘No Index’ and ‘No Follow’ options.

Creating Additional Sitemaps

All in One SEO allows you to create additional sitemaps like a video sitemap or a news sitemap.

You can create a video sitemap if you regularly embed videos in your blog posts or pages. It allows search engines to display posts in search and video search results along with a video thumbnail.

Video search results showing video thumbnail

You can also create a News sitemap if you run a news website and want to appear in Google News search results.

Simply go to All in One SEO » Sitemaps and switch to the Video Sitemap or News Sitemap tabs to generate these sitemaps.

Generating video and news sitemaps in All in One SEO

Overall, AIOSEO is the best WordPress plugin because it gives you all the flexibility and powerful features at a very affordable price.

Method 3. Creating an XML Sitemap in WordPress using Yoast SEO

If you are using Yoast SEO as your WordPress SEO plugin, then it also automatically turns on XML sitemaps for you.

First, you need to install and activate the Yoast SEO plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, go to SEO » General page and switch to the ‘Features’ tab. From here, you need to scroll down to the ‘XML Sitemap’ option and make sure that it is turned on.

Yoast SEO XML Sitemap option

Next, click on the save changes button to store your changes.

To verify that Yoast SEO has created an XML Sitemap, you can click on the question mark icon next to the XML Sitemap option on the page.

View XML Sitemap created by Yoast SEO plugin

After that, click on the ‘See the XML Sitemap’ link to view your live XML sitemap generated by Yoast SEO.

You can also find your XML sitemap by simply adding sitemap_index.xml at the end of your website address. For example:

https://www.example.com/sitemap_index.xml

Yoast SEO sitemap

Yoast SEO creates multiple sitemaps for different types of content. By default, it will generate sitemaps for posts, pages, author, and categories.

How to Submit Your XML Sitemap to Search Engines

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 the sitemap manually to ensure that search engines can find it.

Submitting Your XML Sitemap to Google

Google Search Console is a free tool offered by Google to help website owners monitor and maintain their site’s presence in Google search results.

Adding your sitemap to Google Search Console helps it quickly discover your content even if your website is brand new.

First, you need to visit the Google Search Console website and sign up for an account.

After that, you will be asked to select a property type. You can choose a domain or a URL prefix. We recommend choosing URL prefix as it is easier to setup.

Select property type

Enter your website’s URL and then click on the continue button.

Next, you will be asked to verify ownership of the website. You will see multiple methods to do that, we recommend using the HTML tag method.

Google Search Console verify site ownership

Simply copy the code on the screen and then go to the admin area of your WordPress website.

If you’re using AIOSEO, then it comes with easy webmaster tools verification. Simply go to All in One SEO » General Settings and then click the Webmaster Tools tab. After that, you can enter the code from Google there.

AIOSEO Site Verification

If you’re not using AIOSEO, then you need to install and activate the Insert Headers and Footers plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Settings » Insert Headers and Footers page and add the code you copied earlier in the ‘Scripts in Header’ box.

Add your verification code in the header section

Don’t forget to click on the save button to store your changes.

Now, switch back to the Google Search Console tab and click on the ‘Verify’ button.

Google will check for verification code on your site and then add it to your Google Search Console account.

Note: If the verification is unsuccessful, then please make sure to clear your cache and then try again.

Now that you have added your website, let’s add your XML sitemap as well.

From your account dashboard, you need to click on ‘Sitemaps’ from the left column.

Add sitemap to Google Search Console

After that, you need to add the last part of your sitemap URL under the ‘Add new sitemap’ section and click the Submit button.

Google will now add your sitemap URL to your Google Search Console.

It will take Google some time to crawl your website. After a while, you would be able to see basic sitemap stats.

This information includes the number of links Google found in your sitemap, how many of them got indexed, a ratio of images to web pages, and more.

Sitemap stats in Google Search Console

Submitting Your XML Sitemap to Bing

Similar to Google Search Console, Bing also offers Bing Webmaster Tools to help website owners monitor their website in the Bing search engine.

To add your sitemap to Bing, you need to visit the Bing Webmaster Tools website. Here, you’ll see two options to add your site. You can either import your site from Google Search Console or add it manually.

Create account in Bing Webmaster Tools

If you’ve already added your site to Google Search Console, we suggest importing your site. It saves time as your sitemap will automatically be imported for you.

If you choose to add your site manually, you need to enter your site’s URL and then verify the site.

Bing will now ask you to verify the ownership of your website and will show you several methods to do that.

We recommend using the Meta tag method. Simply copy the meta tag line from the page and head over to your WordPress admin area.

Copy meta tag to verify site in Bing Webmasters Tool

Now, install and activate the Insert Headers and Footers plugin on your website.

Upon activation, you need to visit Settings » Insert Headers and Footers page and add the code you copied earlier in the ‘Scripts in header’ box.

Add Bing verification code

Don’t forget to click on the Save button to store your changes.

How to Utilize XML Sitemaps to Grow Your Website?

Now that you have submitted the XML sitemap to Google, let’s take a look at how to utilize it for your website.

First, you need to keep in mind that the XML sitemap does not improve your search rankings. However, it does help search engines find content, adjust crawl rate, and improve your website’s visibility in search engines.

You need to keep an eye on your sitemap stats in Google Search Console. It can show you crawl errors and the pages excluded from search coverage.

Sitemap coverage

Below the charts, you can click on the tables to view actual URLs excluded or not indexed by Google.

Sitemap URLs reports

Normally, Google may decide to skip duplicate content, pages with no content or very little content, and pages excluded by your website’s robots.txt file or meta tags.

However, if you have an unusually high number of excluded pages, then you may want to check your SEO plugin settings to make sure that you are not blocking any content.

For more details, see our complete Google Search Console guide for beginners.

We hope this article helped answer all your questions about XML sitemaps and how to create an XML sitemap for your WordPress site. You may also want to see our guide on how to quickly increase your website traffic with step by step tips, and our comparison of the best keyword research tools to write better content.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

261 CommentsLeave a Reply

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

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

      • 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

  3. 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?

  4. 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!

  5. 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?

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

  7. 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?

  8. 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?

    Thanks

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

    • 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.

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

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

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

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

  13. 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.

  14. 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/5.0.2.2635 mod_jk/1.2.35 Server at designresidential.biz Port 80

  15. 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.

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

  17. 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.

  18. 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?

    • 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.

      Admin

  19. 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.

    • 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.

  20. Hi,

    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 Yoast.com about adding the sitemap to the exclusion list on using W3Total Cache plugin. Error still persists.

    Any other suggestion would be helpful.

  21. 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.

  22. If i install wordpress in the directory (not in the root) ex. http://www.mydomain.com/blog/
    where is the place to submit the sitemap page? after domain like mydomain.com/sitemap.xml or after the directory where i install wordpress on it, like mydomain.com/blog/sitemap.xml

  23. Hi

    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?

    Thanks

  24. Hi,
    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…?

  25. 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….

  26. 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

    • 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.

      Admin

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

  28. 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?

  29. 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 domain.com / post_sitemap.xml etc. any solution..

    • 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!!

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.