SEO Permalink for WordPress – the real deal

Reading Time: 2 minutes

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$ https://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>

3 Replies to “SEO Permalink for WordPress – the real deal”

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

  1. /%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: 😆

Mastodon