Now that’s we’ve covered how great WordPress is as a general SEO CMS on the first page of this WordPress SEO tutorial let’s take a look at how WordPress should be setup to run as a SEO CMS or to make a general WordPress blog do better in the search engines (especially Google).

If your new to WordPress out the box your new WordPress URL’s will be along the lines of:

www.domain.com/?p=1

This is called a dynamic URL and contains variables (?p=1 is a variable), when Google was first created their search engine algorithm couldn’t read URL’s like this, in layman terms you were pretty much stuck with URL’s lacking variables (meaning no question marks ?) simple URL’s like www.domain.com/page1.html. Today Google and all other major search engines have no problem at all with dynamic URL’s like this and so your site will be fully spidered/indexed by Google etc… However, there is a MUCH better way to present your URL’s for better search engine rankings and that is the SEO friendly WordPress permalinks that can look like this:

www.domain.com/awesome-site-on-keyword.html
www.domain.com/awesome-site-on-keyword
www.domain.com/awesome-site-on-keyword.php
or many other ways to present your content.

I usually use the top version because Google spiders pages ending in html faster than those ending in php (Google assumes a page ending in php might be dynamic and slows spidering) and I like to see end content pages ending in .html and archive pages like your Category archive to lack .html (just my preference, any of the above are good SEO wise).

Optimize your WordPress URL’s

To achieve this is relatively easy.

WordPress SEO Permalinks

Under your WordPress dashboard in WordPress 2.7 on the left menu find “Settings” and click the down arrow (you get this arrow by hovering over the Settings links and it will show to the right of the link) to open up more options, click “Permalinks”.

On the new page the “default” box will be ticked if this is a new WordPress installation or you’ve never changed this setting.

To get the www.domain.com/awesome-site-on-keyword.html type format tick the “Custom Structure” tick box and enter the following text precisely in the box:

/%postname%.html
or
/%postname%

They both do pretty much the same thing, so doesn’t matter which one you use.

If you want a different setup use the variables on the Permalinks settings page to build your desired URL structure. For example if you wanted domain.com/category-name/post-name.html you would use this test:

/%category%/%postname%.html

For SEO reasons I recommend /%postname%.html or /%postname% if you don’t like the .html. I’m tending towards /%postname% for new sites as adding html is making multi comment paged post look messy (they work fine, but look messy).

WordPress SEO Permalinks Settings

If this is a new WordPress blog installation (content not indexed in Google yet OR you don’t mind loosing current search engine listings) I strongly advise making this permalinks settings change, it will give your pages a small boost in the major search engines as long as you use relevant keywords (this is VERY important and covered later) to your content in your blog post titles.

If this is an old WordPress installation and you currently have the default www.domain.com/?p=1 format you can still make this change in WordPress 2.7+ and experience an increase in search engine rankings for your WordPress blog. The latest versions of WordPress now automatically 301 redirect the dynamic URL’s to whatever version you choose under these permalinks options: very impressed with the WordPress development team adding this feature (well done guys).

This means if your WordPress URL’s currently look like www.domain.com/?p=1 and you make the permalinks change advised above Google will automatically know www.domain.com/?p=1 goes to one of the new page URL’s and your site will work when people come to your site from either type of link. This means you can make this change if your site is years old and since 301 redirected pages are not penalised in anyway in Google your old search engine rankings and backlinks will transfer to the new page URL’s. I’ve made this change on a few old WordPress installations that had quite good Google rankings with good results. Please be aware short term you may loose some SERPs, but they will recover quickly (well under 6 weeks in my experience) and should improve after your WordPress blogs fully reindexed. Can be well worth making this change on a large keyword rich (where your posts titles are keyword rich) WordPress blog.

Note: if this is an old WordPress installation and you used another URL structure like the “Month and name” structure you can’t make this change without damaging current SERPs and messing up backlinks (you could manually fix this with 301 redirects and possibly plugins, but that’s beyond the scope of this WordPress SEO tutorial article). I used the “Month and name” structure on Make Money Online Guide and that means I’m stuck with it (I changed it mid 2010 by 301 redirecting the posts manually). Don’t worry though, as long as you got the name of the post (%postname%) in there somewhere it helps a lot, if not we’ll just have to make sure everything else is fully search engine optimized :)

SEO Consultant Makes a Mistake

I’ve had the above information on the site for about a year and recently discovered I’ve made a mistake on advising the above without adding a warning.

WordPress works in a way that it reads a URL with the format www.domain.com/%postname% (and the similar structures I advised) by looking for WordPress Pages (the static Pages) first because they have the same structure. If you have a WordPress blog with a lot of static Pages having a permalink structure like www.domain.com/%postname% for your blog Posts can seriously slow down WordPress generating a blog Post when a visitor accesses your site (it’s because WordPress Pages use the same URL format).

I’ve been using this structure on many sites for years (sites with thousands and even tens of thousands of posts), with no obvious problems, though I tend not to use many static Pages. As I understand things as long as you don’t have lots of static WordPress Pages (static Pages are like the About page) the impact is minimal on the average WordPress site.

If worried about this use something like:

/%post_id%-%postname%
/%post_id%/%postname%

This is not ideal SEO wise as it adds the posts ID number to the URL which won’t help with SERPs. It’s not a massive SEO loss, so if you plan to have a lot of static Pages consider the above. When I make new sites I’m using /%pageid%-%postname%.

The benefit of this is anyone visiting with a broken URL like

/%post_id%-truncated-title

Will still get to the right page (as long as /%post_id% is in the URL it works).

WordPress Category base Optimization

**Warning do not make this next change on an old site that’s fully indexed**

WordPress SEO Category Base

On new WordPress installations I also change the optional “Category base” setting

To something relevant, for example on
45 Year Old Millionaire
I added the word

money

To this optional setting and this results in the default URL structure changing from:

www.45-year-old-millionaire.co.uk/category/category-name

to:

www.45-year-old-millionaire.co.uk/money/category-name

So I get Category URL’s like

https://www.45-year-old-millionaire.co.uk/money/revenue-reports

The benefit of this is all the Categories of this WordPress blog will now have a small boost for search results related to money without having to even use the word money in the content (that’s how Google works). It’s only a small boost, but every little bit helps. so choose a word or short phrase (phrase format is hyphenate - keywords: easy-money or travel-articles etc…) that has relevance to the majority of your WordPress content.

For example the site above is number one in Google for “Money Revenue Reports”-

This isn’t a real money SERP that will pull in a lot of search engine visitors, but it shows how this small change helps a little bit.

**Warning do not make the above change on an old site that’s fully indexed**

As indicated above do not make the above change on an old site, only do this for new WordPress installations since WordPress does NOT automatically redirect the old Category url’s to the new like it does for the first permalink setting. So if you went with the default /category/category-name I’m afraid you are stuck with it. Don’t worry this is a small boost and I have plenty of WordPress installations that I created before understanding what this setting did doing very well in Google etc…

The other optional “Tag base” should ideally be left as is, this controls the URL’s of your tags. Social networking sites like Technorati look for sections with a tag URL to index, so you don’t want to change it. Before WordPress added tags I changed the Category base setting to the keyword tag on some sites to benefit from social networking links. If you have a diverse content site that you haven’t added tags to and can’t think of a relevant keyword for the “Category base” setting you might want to change your “Category base” setting to tags (at least it’s not fully wasted then).

When complete click the “Save Settings” button.

WordPress SEO and the .htaccess File

With a new WordPress installation or one you’ve never changed the permalinks settings, you will now be lacking a .htaccess file. After clicking “Save Settings” It will probably say

“If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.”

With a box below it with some code, these are WordPress .htaccess rules that use mod_rewrite to rewrite your WordPress URL’s from dynamic looking to static looking.

WordPress .htaccess Rules

If you don’t get this information you already have a .htaccess file that’s got the right file permissions and SEO friendly permalinks should be working fine (check your WordPress blog). If not we are now going to create a .htaccess file which isn’t as easy as it sounds or should be :)

Interestingly it’s not as simple as you might think to create this simple text file with a strange name, personally I take a .htaccess file from another site and edit it because many text editors won’t let you create a file called .htaccess (try it in Notepad for example, it’s the . that’s the problem!). For this reason I’ve added a blank .htaccess files in zip format for downloading at:

Blank .htaccess file

This will make life so much easier.

Download the file above and unzip it.

.htaccess Method One:
Upload the blank .htaccess file to the same place you uploaded your wp-config.php file using a FTP program like Filezilla. Just to make our lives a little more difficult some FTP programs don’t show the .htaccess file after upload, (it’s considered a system file!) so if you can’t see your new blank .htaccess file after upload use Filezilla which does show it by default (it’s free and better than many commercial FTP packages) or follow method two (see below).

If you can see the .htaccess file in your FTP program we now need to change the .htaccess files permissions so WordPress can edit it.

WordPress .htaccess Permissions

In Filezilla after uploading the .htaccess file we do the following, first click “View” followed by “Refresh Views” (F5 does this as well) on the file menu (if you miss this step sometimes the permissions box has a bug on newly uploaded files and no tick boxes are ticked!).

Next “right click” the .htaccess file you’ve uploaded (in the right bottom pane window) and select “File Attributes”.

WordPress .htaccess Write Permissions

In the new box tick all the boxes so it says 777 in the “Numeric Values” box, click OK.

This gives WordPress full write access to the file so it can make changes to it. If you use another FTP program there will be a similar way to change file permissions.

Go back to the Permalinks settings page in WordPress and click the “Save Changes” button again, if you’ve done everything right the writable warning and the box with the code in it will disappear and WordPress has written those .htaccess rules to your blank .htaccess file. Check your WordPress blog to see if everything is working correctly.

.htaccess Method Two: (easier in some respects as you skip the file permissions step)
Edit your blank .htaccess file in a text editor like Notepad (weird Notepad will edit this file, but not create it!) on your computer before uploading via FTP. Load the file in Notepad etc… and copy the code WordPress created on the Permalinks setting page. It’s the code in the box below the “Save Changes” button, it will look something like this:

<!IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
<!/IfModule>

Save the .htaccess file and upload the file to your websites server using FTP (Filezilla etc…) to where your wp-config.php file is. No need to save changes again on the permalinks page this time.

Check your WordPress blog to see if it works with the new URL structure, if it does you’ve done everything right.

This gets us to a WordPress blog with SEO friendly URL’s.

I know the above sounds like a LOT of effort, but the truth is this takes a few minutes at worst in practice.

Assuming everything went to plan your URL structure is SEO friendly, you have SEO URL’s.

SEO Tutorial for WordPress

1. WordPress SEO Friendly Permalinks

2. Naming Your WordPress Blog for Better Search Engine Rankings

3. WordPress SEO Title Tag Optimization

4. WordPress SEO Meta Tags Optimization

David Law : AKA SEO Dave, Search Engine Optimization Consultant, Internet Marketer, WordPress SEO Theme Developer and Nice Guy :-)

Google Plus WordPress SEO Friendly Permalinks Facebook WordPress SEO Friendly Permalinks Twitter WordPress SEO Friendly Permalinks Linkedin WordPress SEO Friendly Permalinks StumbleUpon WordPress SEO Friendly Permalinks WordPress SEO Themes YouTube Channel RSS Feed
Website - WordPress SEO