How To Add a XML Sitemap to WordPress Blog

You want two kind of sitemaps on your blog. One for search engines and another one for your readers. Both can be very easily implemented into the WordPress blog with plugins in matter of minutes.

The sitemap for search engines will help search engines to find and index your site/ blog and keep your listing and information up-to-date with your latest content and inform about the changes in your blog structure with zero effort. The sitemap for your readers is optional compared to the sitemap for the search engines, but that too takes only couple of minutes and can potentially help your readers navigate your site better.

In addition to explaining what a sitemap is, in the rest of this article I'll show you:

  • How to setup and install a plugin on your WordPress that generates the XML sitemap for search engines for you
  • How to install another plugin that automatically generates a sitemap for your readers anywhere you want to display it on your blog.

What are Sitemaps?

Like said, you can and should have two sitemaps on your site, one for the search engines and another one for your readers. The sitemap for Search Engines is arguably the more important one, as it helps the search engines to index your site. And it takes one minute or less to install the plugin that does all the search engine sitemap work for you, so you definately *must* install it, as it only servers you well after you've done it...

XML Sitemap for Search Engines

Sitemaps are an easy way for webmasters to inform search engines about pages on their sites that are available for crawling. In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site... ...Using the Sitemap protocol does not guarantee that web pages are included in search engines, but provides hints for web crawlers to do a better job of crawling your site. -sitemaps.org

Note: The XML-Sitemap format was introduced in 2005 by Google and adopted in 2006 by YAHOO, MSN Search and Ask.com so thats why it’s often called "Google Sitemaps". -Google (XML) Sitemaps Generator for WordPress

As explained, to help Search Engines find your blog and website, you want to have XML sitemap on your site. Google XML Sitemaps -plugin does this automatically for you.

Google XML Sitemap -plugin Installation and Activation

If you're running WordPress versions, 2.7.x, the plugin installation is super easy:

  1. Just go to the Plugins section,
  2. click “add new”,
  3. search for “Google XML Sitemap”
  4. check that the search result is the correct plugin
  5. click “install”
  6. activate the plugin after succesful install.

or you can install more manually with the earlier versions of WordPress:

  1. Download the plugin from the Google XML Sitemaps at WordPress Plugin Directory
  2. Upload the plugin to plugins -folder with ftp client, like FileZilla
  3. Activate the plugin from the plugins -page in WordPress dashboard

Google XML Sitemap -plugin Configuration

After the installation and activation, the default settings are usually ok, so you don't have to do anything. (That was very easy configuration, don't you agree!)

However, if you want, set the options how you want the sitemap to be created, for example if you don't want some parts of your website to be listed (note that the search engines might still find those pages and index them if you don't configured the robots meta to prevent the indexing)

And as you just installed the plugin, you can go to the configuration screen of the plugin, and rebuild the sitemap manually by clicking "rebuild the sitemap" link there. In addition to creating the XML file, the Google XML Sitemaps -plugin will notify Google, MSN and Ask.com about your new (or updated) sitemap. Normally, you don't have to do the manual rebuild, it will be done automatically for you, but if you change permalink structure, or change page or post urls, you should go and do the rebuild manually (takes one second to go and click the button).

If you don't touch the settings for the location of your sitemap file, it will be generated to http://your-blog-domain/sitemap.xml or /blog/sitemap.xml or other directory, depending how your blog is configured - e.g. http://zemalf.com/sitemap.xml. Compressed sitemap.xml.gz -file will also be created and search engines will usually use that, but that is something you don't have to worry about. Now you can link the XML Sitemap on your footer if you like, but you don't have or need to. Search Engines should pick up the sitemap based on the announcement the plugin sends.

Sitemap for Your Readers

There are plenty of ways to do this, but I use the Dagon Design Sitemap Generator, which inserts configurable sitemap anywhere you want in your blog.

Dagon Design Sitemap Generator -plugin Installation and Activation

Like above, with WordPress 2.7.x and onwards:

  • Go to the Plugins section in your Dashboard, click “add new”, search for “Dagon Design Sitemap Generator”, check that the search result is the plugin you want, click “install” and activate the plugin after succesful install.

or install manually with the earlier versions of WordPress:

  • Download the plugin from the Dagon Design Sitemap Generator at WordPress Plugin Directory, upload the plugin to plugins -folder with ftp client, like FileZilla. Activate the plugin from the plugins -page in WordPress dashboard

Dagon Design Sitemap Generator -plugin Configuration

Go to the configuration screen and set the options as you like, again the defaults are fine, but check the options for your liking and you are set, the plugin is now ready for action.

Go create a new page ("Pages" in your Dashboard, "add new"). Add some introductory text to the page if you want (e.g. "Complete Sitemap for Zemalf.com"), and the add the Dagon Design Sitemap Generator tags to the page:

<!-- ddsitemapgen -->

I created a separate page for my sitemap, and you can see it in the ingeniously named "Sitemap" for this site at the page list navigation (on top at the time this was written).

You can also add the sitemap directly to your theme template if you like and feel confortable going into the php-files:

<?php echo ddsg_create_sitemap(); ?>

For example, you could add the code to the theme's 404.php -file or possibly in the loop if no posts are found, but I leave the option for you. If you're interested in details about the plugin and the latest updates, check the Dagon Design Sitemap Generator -plugin homepage.

Great Job - Now Enjoy the Results!

Now you have a sitemap set up for the search engines and they can't wait to crawl through your website and content, and you have a page for your readers to navigate through your site if everything else, like category, page or tag listings fail to point to the right direction.

It might be that "reader's sitemap" won't be used that much, but in case it helps your readers to navigate your site, enjoy more of your content and stay on your site, I say it's worth the couple of minutes it takes to install the plugin and page for the sitemap. After setting the sitemap up, you don't have to maintain it at all.

Posted by

Topic: WordPress Tips
Tags: , , , , ,

If you enjoyed this post, sign up for updates (it's free)


Feedback, questions and comments are also welcome on my Facebook page