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

Subdomains treated like subdirectories?

Feel free to share...FacebookTwitterGoogle+RedditStumbleUponLinkedinemailI saw a Facebook reference to an article on SEJ that “Google treats subdomains and subdirectories the same“. It caught my eye because of something┬á I experienced recently. Feel free to share...FacebookTwitterGoogle+RedditStumbleUponLinkedinemail

Read More

Sherpa for Majestic Chrome Extension – Review

Ash Nallawalla

21 October 2017

SEO, SEO Tools

Feel free to share...FacebookTwitterGoogle+RedditStumbleUponLinkedinemailMost professional SEOs I know use Majestic.com for reliable backlink data. Majestic provides a lot of data about the links to a site, including data about the quality of those links. I have used it for many years, from the time it was known as Majestic SEO. I usually enter the URL […]

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