Search Engine Optimization (SEO) with WordPress

WordPress is a great blogging tool, no doubt about it. (It powers this blog.) What you may not know is that it has some great features for search engine optimization (aka SEO). Here are a few tips on getting the most out of WordPress for SEO.

Optimize the Template

As it happens, the default WordPress template is pretty search engine friendly. In particular, it uses Cascading Style Sheets for positioning, which means there isn’t a lot of crufty <table> markup to bloat your html. However, I would recommend one change to the “out of the box” template: change the title of posts to <h1> instead of <h3>. Why? Because Google places higher emphasis on content that is inside of <h1> tags. If your titles are keyword rich (they should be – look at the title of this post for an example), making this change elevates the post’s importance oh-so-slightly in Google’s eyes.

Making the change is simple. Login to WordPress and click on the “Templates” menu item. Open the index.php file (the default), and search for <h3 class=”storytitle”. Change h3 to h1. Click “Update File” and you’re all set.

Optimize the File Name for Your Post

For added Google mojo, you want the title of your post (which is keyword-rich, remember) to also be the name of the file. When Google sees your keywords in the name of the file, it assumes those keywords must be important. Why else would you name it that way?

By default, WordPress uses query strings for the names of your files, so a post’s URL will look something like http://www.yoursite.com/index.php?page=123. Looking at this, you can’t guess what the post is about, can you? Wouldn’t it be better if it were something like http://www.yoursite.com/search-engine-optimization.html? Google thinks so too.

Happily, it’s pretty easy to configure WordPress do this for you automatically.

First, you need to configure WordPress to show you the “post slug,” which is WordPress’s term for the file name. As an example, the post slug for this post is “search-engine-optimization-seo-with-wordpress.” To do this, click on the Options menu, then click on the “Writing” submenu. Next to “When starting a post, show:” select “Advanced Controls.” Save your changes by clicking the “Update Options” button.

Next you need to configure the permalink structure. The permalink is the link the WordPress generates for a specifc post. For example, the permalink for this post is http://www.askderekscruggs.com/search-engine-optimization-seo-with-wordpress.html. To do this, click again on the Options menu, then on the Permalinks submenu. Scroll down the first text box and enter the following:

%postname%.php

This tells WordPress to use the name of your post in the permalink and add “.php” to the end of it.

Click the button labelled “Update Permalink Structure.” Once it’s done updating, at the bottom of the page you will see a new text box with abunch of code in it that looks something like this:

RewriteEngine On
RewriteBase /
RewriteRule ^categories/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?category_name=$1&feed=$2 [QSA]
RewriteRule ^categories/?(.*) /index.php?category_name=$1 [QSA]
RewriteRule ^author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?author_name=$1&feed=$2 [QSA]
RewriteRule ^author/?(.*) /index.php?author_name=$1 [QSA]
RewriteRule ^([_0-9a-z-]+).html([0-9]+)?/?$ /index.php?name=$1&page=$2 [QSA]
RewriteRule ^([_0-9a-z-]+).html/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?name=$1&feed=$2 [QSA]
RewriteRule ^([_0-9a-z-]+).html/trackback/?$ /wp-trackback.php?name=$1 [QSA]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1 [QSA]
RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1&withcomments=1 [QSA]

This is code for Apache’s mod_rewrite functions. Basically, this tells your Apache web server to transform (using the example above) http://www.yoursite.com/search-engine-optimization.html into the format that WordPress understands: http://www.yoursite.com/index.php?page=123

If that seems confusing to you, don’t worry about it. The main thing to know is that you need to copy and paste this text into a text file, name it .htaccess (yes, that’s a period at the beginning of the file name) and place that file in the same directory as your WordPress installation. Assuming you followed these instruction correctly, the changes should take place immediately. Simply navigate to your blog page and click on the permalink to verify that it works. QED, no?

Doing these two things alone will do wonders for your search engine traffic. Give them a try and let me know what you think.

This entry was posted in Uncategorized. Bookmark the permalink.