Let’s take a look at how WordPress should be setup to run as an 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:

example.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 example.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 website 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:

example.com/awesome-site-on-keyword.html
example.com/awesome-site-on-keyword/
example.com/awesome-site-on-keyword
example.com/awesome-site-on-keyword.php

or many other ways to present your content.

I used to use the top version because Google used to spider webpages ending in .html faster than those ending in .php (Google assumed a page ending in .php might be dynamic and slowed spidering) and I liked to see 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 and if migrating from a website using *.php the .php option might be easier to use: no need for 301 redirects which cost link benefit).

Note: For a new WordPress install or one currently using the default dynamic URLs, I recommend the second option (example.com/awesome-site-on-keyword/.

SEO Optimize your WordPress URL’s

How to Change Permalinks in WordPress

How to Change Permalinks in WordPress

To change the WordPress permalinks is easy, it’s a few taps or clicks of the mouse for most WordPress users.

Under your WordPress Dashboard on the left menu hoverover/tap “Settings” and click/tap the “Permalinks” option.

On the Permalinks options page the “Plain” option will be ticked if this is a new WordPress installation or you’ve never changed this setting. This results in dynamic URLs with format

example.com/?p=1

To achieve the best SEO friendly URLs “example.com/awesome-keyword/” format, tick the Post name option and in the box below you’ll see:

/%postname%/

Save Changes and you should have SEO friendly WordPress URLs.

Like the screenshot below.

Best WordPress SEO Permalinks Settings

Best WordPress SEO Permalinks Settings

If you want a different setup use the variables on the WordPress Permalinks settings page (there’s a link with anchor text “number of tags are available”) to build your desired URL structure and tick the “Custom Structure” tick box. For example if you wanted example.com/category-name/post-name.html you would use this code:

/%category%/%postname%.html

For SEO reasons I recommend /%postname%/, adding the category isn’t required.

I also tended towards /%postname%/ for new websites as adding .html was making multi comment paged posts look messy (they work fine, but the URLs look messy).

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.example.com/?p=1 format (only for this format, not others) 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).

SEO Value of Changing WordPress Permalinks on Old Sites

That being said I have old sites using the /%postname%.html structure because Google used to spider html pages faster and to change it now would mean setting up a LOT of manual 301 Redirects (WordPress doesn’t 301 redirect /%postname%.html to /%postname%/ automatically) and a 301 redirect costs a little SEO link benefit, so to change permalink structure would cause SEO damage for no real SEO benefit. Generally speaking don’t change the permalink structure of an old site that’s indexed in Google, it will have a negative SEO impact: I would change this format www.example.com/?p=1 but not others on an old site.

This means if your WordPress URL’s currently look like www.example.com/?p=1 and you make the permalinks change advised above Google will automatically know www.example.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 (there’s a small dampening factor on 301 redirects, but you do get the benefit from the keywords in the URL: SEO swings and roundabouts) 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 lose some SERPs, but they will recover quickly (well under 6 weeks in my experience) and should improve after your WordPress blogs fully reindexed (this assumes you use relevant keywords in the titles of your posts). 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 Postname” 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 Postname” structure on one site and that meant I was stuck with it: I eventually bit the bullet and changed it mid 2010 by 301 redirecting the URLs manually. Don’t worry though, as long as you have 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 :)

Note 2: The WordPress SEO Tutorial you are reading now used to be on another domain, I managed to get the other domain penalized in Google: I added a footer link from the Talian 5 WordPress SEO theme (a theme I used to sell on the other site) to the old site this WordPress SEO tutorial was on.

This per se wasn’t an SEO problem until Talian 5 became the go to WordPress AdSense Theme for autobloggers and it was used on tens of thousands of WordPress autoblogs. Even though the footer link could be turned off (tick one box and it’s off) on the Talian 5 options page many (and I mean thousands) left it on and I had millions of backlinks.

SEO wise that’s great other than it’s millions of identical sitewide links from WordPress autoblogs which Google understandably didn’t like!!! Basically I shot myself in the foot by generating too many backlinks.

In Stallion Responsive I haven’t made that mistake, if a user leaves the footer link on it’s a single homepage backlink, not sitewide. So I moved the WordPress SEO tutorial to here in Feb 2014 and 301 redirected from the old site to here.

SEO Consultant Makes a Mistake

Note: As of 2014 the information below is no longer valid, WordPress solved the issue below so using the best permalink structure advised above is again recommended SEO wise: don’t you just love how things change.

I’ve had the above information on the site for about a year and recently discovered I 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.example.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.example.com/%postname% for your blog Posts can slow down WordPress generating a blog Post link URL under some scenarios 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).

Note: the above is no longer valid, left this information here for those who find the above advise on other websites and think in newer versions of WordPress you should add the post ID into the URL structure.

WordPress Category Base Optimization

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

On new WordPress installations I also change the optional “Category base” setting to something relevant or nicer, for example on this site I changed it to Topics (Topics is nicer than Category), see screenshot below:

WordPress SEO Category Base

WordPress SEO Category Base

This results in the default URL structure for categories changing from:

https://seo-gold.com/category/category-name/

to:

https://seo-gold.com/topics/category-name/

So I get Category URL’s like

https://seo-gold.com/topics/wordpress-seo-tutorial/

The benefit of this is all the Categories of this WordPress blog will now have a small boost for search results related to Topics without having to even use the word topics in the content (that’s how Google works). Topics isn’t a keyword I’m interested in, I made the change for users, topics looks nicer.

It’s only a small boost, but every little bit helps. so choose a word or short phrase (phrase format is hyphenate – keywords: wordpress-theme or travel-articles etc…) that has relevance to the majority of your WordPress content. Or just make it nicer, it’s a tiny SEO boost and sometimes putting your users first (Topics is for users) makes more sense.

**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 website, only do this for new WordPress installations since WordPress does NOT automatically redirect the old Category URLs to the new like it does for Post permalink settings. So if you went with the default /category/category-name I’m afraid you are stuck with it unless you manually setup 301 redirects or accept the SEO damage of changing 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.

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 Changes” under “Settings” >> “Permalinks” it will probably create the .htaccess file for you as long as your server allows WordPress to create the new file. If your server isn’t setup this way you might see a warning message like this:

“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.

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

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, inside you’ll find the .htaccess file with one line:

RewriteEngine On

WordPress Permalinks .htaccess Method One:

How to Change WordPress .htaccess Permissions

How to Change WordPress .htaccess Permissions

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.

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 Permissions”.

WordPress .htaccess Write Permissions

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. If it’s working change the permissions back to like you see in the image above, leaving the permissions at 777 is a potential security risk.

WordPress Permalinks .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:

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

Don’t use my code above, yours could be a little different, use what WordPress output on the Permalinks settings page.

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.

David Law

*
David Law : Technical SEO Expert with 20+ years Online Business, SEO, Search Engine Marketing and Social Media Marketing experience... Creator of multiple WordPress SEO Themes and SEO Plugins. Interests: wildlife, walking, environmental issues, politics, economics, journalism, consumer rights.

Website - SEO Gold Services