Ash Nallawalla's blog

SEO Permalink for WordPress – the real deal

Ash Nallawalla

4 July 2009

SEO

I must credit my friend Prashant Karandikar tipping me off to an intriguing post entitled “Many SEO Experts Give Wrong Advice Regarding WordPress Permalinks” by Weberz-Rob. That’s a great linkbait title if you ever saw one, particularly when he began naming these well-known SEOs who gave this “bad advice”, such as:

For good measure, he also listed other well-known SEOs who weren’t giving this “bad” WordPress permalink advice but had “bad” URLs, e.g.

So how does this unknown (to me) person presume to give advice to the A-list of SEOs? Read his post for the details, but he has WordPress Codex on his side. It says:

For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text “page slug” as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to start your permalink structure with a numeric field, such as the year or post ID.

The permalink structure of this blog used to be:

/%category%/%postname%-%post_id%.html

So, this was not the optimum URL structure according to the WP Codex, as the code would waste time evaluating whether a URL is a post or a page. Now this blog is not heavily visited enough for me to care about fractions of a second, but I like to use best practices. I have opted not for the advice of Weberz-Rob or the WP Codex, but the following:

/%postname%-%post_id%.html

I agree with Andy Beard‘s comments in that post and have also settled on the filename ending in .html because I’d like an easy .htaccess solution for my indexed pages that would otherwise lead to 404s. Removing the %category% from the URL was easy.

Revised .htaccess

This is what my .htaccess file looks like:

Options +FollowSymLinks -Indexes
<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteRule ^[^/]+/([^/]+)\.html$ http://www.netmagellan.com/$1.html [NC,R=301,L]
 # BEGIN WordPress
 RewriteCond %{SCRIPT_FILENAME} !-f
 RewriteCond %{SCRIPT_FILENAME} !-d
 RewriteRule . /index.php [L]
 # END WordPress
</IfModule>

Ash Nallawalla

Search strategist experienced in large, complex websites. Ash's Google+ profile

Related Posts

President Obama’s whitehouse.gov pages archived

Ash Nallawalla

22 January 2017

Other, SEO

Feel free to share...After Mr Donald Trump became the president at noon today (USA EST), many reported that the whitehouse.gov website removed references to Climate Change and LGBT. That isn’t entirely accurate. The website up to that point has been archived and can be found at https://obamawhitehouse.archives.gov/. The LGBT URL was https://www.whitehouse.gov/lgbt but it redirects […]

Read More

Coding Australian 13 and 1300 “tel:” numbers – 404 errors

Feel free to share...Australia has six- and ten-digit local numbers that begin with 13 and 1300 respectively. The 13 xx xx numbers connect you to a local number in your city so it is a local call. The 1300 xxx xxx number is similar but is usually a single destination for the price of a […]

Read More

3 Comments

  • Fragmentedblog on 29 August 2009

    First off what is Permalink? I have both free and self hosted blog. But never needed to think about it.

    • Ash on 29 August 2009

      A permalink is the permanent URL of a post. It is the one you get to when you click the title of a post.

  • dNoxs on 1 October 2009

    /%category%/%postname%-%post_id%.html was real ?

    hmm I like use permalink /%category%-%postname%.html to user and seo friendly.

    so I change / white – to Interactive permalink :mrgreen: 😆

Comments are closed

Older Posts