How to Create a Sitemap for WordPress

Google XML Sitemaps

Anyone who has created a WordPress site has done so for a reason and wants to ensure that someone can find their site. The easiest way to make search engines aware of the content on your site is to create a sitemap and submit it to the search engines.

An additional advantage of creating a sitemap is that you can have some control over how much weight you want to give to each page. You can specify that certain pages on your site are more important than others.

One way to create a sitemap would be to create it manually, which would be like writing your web pages from top to bottom in raw HTML – not a very attractive option. So instead, we’ll use a plugin to create it dynamically and automatically.

UPDATE: I now recommend using WordPress SEO by Yoast to achieve this, instead of the Google XML Sitemaps plugin.

Google XML Sitemaps

The Google XML Sitemaps plugin has long been seen as the standard plugin for creating sitemaps in WordPress and for good reason. Once you have installed the plugin, head to the settings page, located under Settings > XML-Sitemap in your WordPress admin panel.

You’ll see a group of checkboxes, for a number of search engines that you can submit your sitemap to and you’ll want to check them all, so that all the major search engines have a good idea of what your site consists of. You’ll have to create an application ID for Yahoo, but it’s a very straightforward process.

Make sure you create a normal XML file as well as a gzipped file, so that you have some redundancy and also so that you have both types available for certain sites which require one or the other. If you haven’t created your own robots.txt, then check the “Add Sitemap URL to the virtual robots.txt file” box.

Under Post Priority, I recommend selecting the “Comment Count” option, so that your most popular posts are given the highest priority.

For the location of your sitemap, you should just use “Automatic Detection”, unless you have some compelling reason to select something else, or unless the plugin is having trouble finding the sitemap automatically.

I recommend excluding categories, archives, tag pages and author pages from your sitemap, because you rin the risk of creating duplicate content, which is not good for SEO, but also, when people search for something, they don’t want to find a collection of articles about a general topic, but they want to find the specific post (which will be included in your sitemap already).

If there’s certain items or categories that you want to exclude from your sitemap, you have the option to do that also.

The last two sections (Change frequencies and Priorities) will largely depend on your individual site, how often you update it and what types of content are the most important in your eyes. The post priorities range from 0 to 1 and are broken down into increments of 0.1, where 0 is the least important content and 1 is the most important. Be sure not to give everything the same priority, otherwise you’re just telling search engines that everything on your site is of equal importance. The priority is for how important something is relative to other content on your site, not other content on the web.

When setting your “Change Frequencies” options, be careful not to show that you update your site more often than you actually do – if Google is coming to your site daily and everything is the same day after day, you’re going to do yourself more harm than good, because Google isn’t going to waste its time coming to a site that doesn’t update itself daily when it says that it does.

Do you use some other method of creating sitemaps in WordPress? Let me know if you had any problems by leaving a comment.

UPDATE (3/15/11)

Sitemaps for WordPress Multisite Installations

Following the arrival of WordPress 3.0, WordPress now natively supports multisite installations. As such, Arne, the developer of the Google XML Sitemaps had to rework the plugin to equip it for multisite installations since they work so differently to traditional WordPress installations.

However, instead of just updating the existing plugin, he created a new one, since for now, the more advanced options are not available in the multisite version, but all of the options discussed above are covered and will suit most people.

So in short, the only thing you need to do differently for multisite WordPress installations is install the plugin made for Multisite installations.


Sitemaps with WordPress SEO by Yoast

WordPress SEO by Yoast is one of a handful of plugins that I just must install on every single site because of how useful and extensive it is. The sitemap functionality is a prime example of this.

Once you have installed WordPress SEO by Yoast, a new menu will be created at the bottom of the left-hand menu. One of the submenus is XML , so click on that to get to the configuration.

There’s not much needed from you and the options are generally self-explanatory. First of all, enable the sitemap. Then go about setting your unique configuration. Personally, I enable pinging on all services, I don’t exclude any post types, and I exclude all taxonomies.

Save your settings and you’re away. Note the button that links to your sitemap. Be sure to update robots.txt if you have manually entered a sitemap address, and Google Webmaster Tools (and Bing/Yahoo equivalents) if you have included your sitemap to be crawled.

8 thoughts on “How to Create a Sitemap for WordPress”

  1. Danny says:

    Thanks for this post, I was having an awful lot of difficulty setting up a sitemap on my WordPress blog. When you have followed all of the steps, do you just hit “Update Options” and you’re done? Forgive me as I’m a newbie to this sitemap business, but do you need to have a visible sitemap on your page or does this just create an invisible one that accomplishes the same purpose?

    Many thanks again for your help.

    1. Dave says:

      Sometimes, you need to force it to build the sitemap, by hitting “Rebuild the sitemap manually”. You may also need to physically create the files in the root of your web directory. You’ll need to create empty files called sitemap.xml and sitemap.xml.gz.

      Give that a try and let me know how it goes.

  2. Danny says:

    By the way, this is a great site… going to bookmark your blog!

    1. Dave says:

      Well, thanks. I definitely appreciate the encouragement. Helps me to keep writing!

  3. Fnarp says:

    I also use Google XML Sitemaps, but I suggest to send it to google using google webmaster tools to be indexed faster !

    1. Dave says:

      Well yes, you should definitely submit your sitemap (to Google, but also to Bing, Yahoo etc.) to make sure that you get indexed quickly. You should also make sure you have it called out in your robots.txt

  4. Bill says:

    When I contacted WP.com they said that one of the benefits of using them was that they provided a sitemap for me. With that is this article meant for WP.org or self-hosted WP users but not for WP.com?

    1. Dave says:

      wp.com blogs do sutomatically produce a sitemap (see this article from WordPress – http://en.support.wordpress.com/sitemaps/#xml-sitemaps-for-search-engines), however, since you can’t install plugins, you won’t be able to follow this tutorial, nor will you be able to have the control over your sitemap (like changing priorities) that you get from a wp.org (self-hosted) installation in conjunction with a plugin such as this one. So, yes this article applies only to wp.org installations, not wp.com blogs.

Leave a Reply