Sitemaps allow website owners to inform search engines where all their content is located. This helps search engines crawl your website more effectively. In this tutorial, I will show you how to create an XML sitemap in WordPress using two popular plugins: WordPress SEO and Google XML Sitemaps. Both plugins can create an XML sitemap out of the box. However, I will show you all configuration options to give you a better understanding of how to customize your sitemap.
Note that there is a difference between XML sitemaps and HTML sitemaps. XML sitemaps are designed for search engines and are not intended to be seen by humans. An HTML sitemap provides an A to Z listing of all content on a website. This is why it is sometimes known as a site index.
How to Create an XML Sitemap in WordPress Using WordPress SEO
WordPress SEO is the complete website optimization plugin. It comes bundled with many goodies, and one of them is the ability to create sitemaps. To create an XML sitemap with WordPress SEO, the first thing you need to do is install and activate the WordPress SEO by Yoast plugin (Here is how to install a WordPress plugin).
To enable the sitemap feature in WordPress SEO, you need to go to SEO » XML Sitemaps and check the box next to XML sitemaps to enable this feature.
In addition to automatically Google and Bing whenever new content is added to your website, you can update Yahoo and Ask too.
Specific post types and taxonomies can be removed from your sitemap. You can also change the number of pages that are listed on a sitemap page.
Your sitemap will be created after saving your sitemap settings for the first time.
WordPress SEO divides your content into different sitemaps such as posts, pages and categories
Each corresponding sitemap page lists all of your links. Information is displayed such as how often the sitemap should be checked by search engines and the last time the post or page was updated.
If you are already using WordPress SEO, it is worth using the plugin to create your sitemap. Note that it does not offer a huge number of options. This makes it a great choice for people who just want a sitemap to work perfectly after activating. If you need more control over how your sitemap is created, you may want to consider Google XML Sitemaps instead.
How to Create an XML Sitemap in WordPress Using Google XML Sitemaps
First thing you need to do is install and activate the Google XML Sitemaps plugin. Upon activation, go to Settings » XML Sitemap to configure the plugin.
One thing that you would immediately notice is that Google XML Sitemaps plugin has a lot more options to fine tune your sitemaps than WordPress SEO. These options may look complicated and scary to new users, but they are really not. In fact, the plugin works out of the box, even if you don’t change any settings and simply click on the Update Options button at the bottom, then it will work just fine.
However, we will still walk you through the options on the settings screen.
First you need to check the box to notify search engines when you update your WordPress site. Under the Basic Settings> section check the boxes next to Google and Bing search engines.
Google XML Sitemaps allows you to add additional non-WordPress pages to your sitemaps. Simply click on the Add New Page link under the Additional Pages section to enter the URL of your non-WordPress static pages.
Another great feature of Google XML Sitemaps plugin is that it allows you to set post priority based on their comment count or average comment count. By default it is set to comment count, you can disable the automatic priority calculation if you want.
You decide what content you want to be included into your sitemaps. By default, the plugin includes your WordPress posts, pages, homepage, with last modification times. You can also add your category, tags, and archive pages if you want.
You can also choose to exclude content you don’t want to be added into your sitemaps. This includes your categories, and individual posts, pages, or custom post types.
Once you are done going through your XML Sitemaps settings, simply hit the Update Options button to save your settings.
Google XML Sitemaps automatically rebuilds your XML sitemaps whenever new content is published on your website. By default, your sitemap will be saved in the top level of your WordPress installation with the filename “sitemap.xml”. Once you have configured all settings, you can check that your sitemap has been created correctly by visiting the url
http://www.example.com/sitemap.xml (replace example.com with your own domain name).
The final sitemap file that WordPress SEO and Google XML Sitemap generates are almost identical. There is no real benefit of using one over the other. Google XML Sitemap is the better option if you want to customise your sitemap though both plugins work great out of the box.
I hope this article helped you create an XML sitemap in WordPress.