Friday, 31 May 2013

Remove Dates From Permalink




How do you you remove the dates from your permalink structure without ruining all the hard earned links you have developed?


Glad you asked… It really is very simple… (Note I tried the various plugins first but had issues… In the end this solution is faster for the visitor, quicker to implement, and simpler.)



Assuming your current permalink structure is /%year%/%monthnum%/%day%/%postname%/


  1. First change your permalink structure to /%postname%/

  2. Create a .htaccess file (or modify an existing file)

  3. Add this line above any other WordPress declarations: RedirectMatch 301 /dddd/dd/dd/(.*) /$1

  4. Make sure the .htaccess file is in the root of your blog

Here is an example .htaccess file direct from one of my blogs…
RedirectMatch 301 /dddd/dd/dd/(.*) /$1


# BEGIN WordPress


RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]


# END WordPress


By 301 redirecting you are telling the search engines that the content has moved to a new location. While there is typically some drop off during the transition, your blog will come back stronger for making the change.


As an example of the effectiveness…

Here is an old url: http://www.golfballdriver.com/2008/03/18/michelle-wie-and-robin-lopez-at-charity-auction-pic/

which now redirects to the new url: http://www.golfballdriver.com/michelle-wie-and-robin-lopez-at-charity-auction-pic/



Remove Dates From Permalink

A Day at Norte Shopping Porto in 2024