Tutorial: Automatic Site Map for WordPress
To improve the navigation of your users as well as search engine traffic and ranking to your WordPress blog I suggest making a good site map of your posts - a map of your site. A kind of user friendly archive of your posts. This is not "Google sitemap"!
The benefits:
- The user can quickly find a specific post he wants anytime he wants.
- The user can quickly see and get an idea how big the blog is get an overview on what the person is writing about.
- All your posts are linked to from a single page to make sure they are not forgotten by the search engines. Basically PageRank is passed to all of them and they are not buried deep down in the archive. If there are no links to your old posts Google will put them in the supplemental index which is not good at all.
There are 3 different versons of site maps that you can use, depending on how you want it. I have used the other 2 until I reached my final which is the first I want to brief you about.
The First WordPress Site Map Example
This one is the nicest, most flexible and best if you write about different subjects but takes some time to set up. Once it is set up it is all automatic. If you have many categories and subcategories this is the best choice for user experience. You can fully decide the headings, order and basically everything. This is the final one for this blog which I currently use and developed myself.
Demo: See my site map here.
Guide how to set it up
- Download and activate the
PHP Exec plugin(for newer versions of WordPress use Exec-PHP) that makes it possible for you to parse PHP in your blog posts. - Download and activate the WP Category Post Plugin that makes it possible for you to list posts per category. (I revised the file a bit, credits to Brian Groce and CrazySerb).
- Create a new WordPress page (not post) with something like this:
<h1 style="margin-top:10px;">Major category</h1> <div style="margin-left:70px;"> <h2>Subcategory</h2> <ul> <?php wp_cat_posts(21); ?> </ul> <h2>Subcategory</h2> <ul> <?php wp_cat_posts(38); ?> </ul> <h2>Subcategory</h2> <ul> <?php wp_cat_posts(27); ?> </ul> <h2>Other posts on main category</h2> <ul> <?php wp_cat_posts(29); ?> <?php wp_cat_posts(30); ?> </ul> </div>
The numbers are the IDs of the categories. Repeat this code until you cover all your categories. You can then place a index with anchor links that jumps to sections like I did. You don't need to include all posts and you can choose the exact sequence you want. - In your template footer file and or at some other visible place, make a link pointing to your site map for full visitor and search engine link benefit.
The Second WordPress Site Map Example
Use the DDSitemapGen. It is an extensive plugin with a lot of options and is 100% automatic. Just follow the instructions on that site on a new site map page and then in your template footer file and or at some other visible place, make a link pointing to your site map for full visitor and search engine link benefit.
The Third WordPress Site Map Example
This is best if you have a blog in just one subject and is simply just a list of all pages of your blog which can be sorted by date.
Demo:
Here is a demo of just 5 posts:
Guide how to set it up
- Download and activate the
PHP Exec plugin(for newer versions of WordPress use Exec-PHP) that makes it possible for you to parse PHP in your blog posts. - Create a new WordPress page (not post) with some text and then the following lines:
<div style="width:300px;margin-left:50px;font-size:10px"> <br /><br /> <phpcode> <ol> <?php wp_get_archives('type=postbypost'); ?> </ol> </phpcode> </div>
There is more about wp_get_archives here.
- In your template footer file and or at some other visible place, make a link pointing to your site map for full visitor and search engine link benefit.
Which kind of site map do you use for your WordPress blog? If you are using the first version it would be nice if you commented with a link to it so we can see how it works for your WordPress blog.
Other posts
- My Recommendations for a Happy Life
- Budget 100 - an old school magic format
- My Favorite Board Games and How I Play Them
- Switching from Windows PC to Mac and why I switched back
- Creating The Space War - The Card Game of My Dreams
- 24 Characteristics That Geniuses Have in Common
- Setting up and Managing a MySQL Server
- Canasta - The Great Card Game
- Annual report number 13 + 14: My Success
- Selling my SEO business TodaysWeb
He is the Founder of DomainStats and N.nu. Read his full about page.