How to remove dates from existing permalinks?

After doing some research about dates on blogs, it seems like it is a good idea to remove them from the existing posts.

Consider:

  1. Self-hosted (on Bluehost)
  2. Over 1,000 existing posts
  3. All posts are indexed by Google and many are linked to from other domains. Many posts are linked to within the blog. Don’t want to break links.
  4. Don’t want to lose Pagerank or age of the posts within Google. This is very important because most of the traffic is from Google, and many pages rank well.
  5. The current URL is: http://www.thedomain.com/blog/2012/07/01/blah-blah-blah-blah/
  6. New URL should be http://www.thedomain.com/blah-blah-blah-blah/

I know that it can be done with ModRewrite, but is this the best way? Will Google know that it is the same post?

Is it possible to change permalinks?

1
1

You’ll find this post by Joost De Valk on changing WordPress permalinks to only include /%postname% very helpful.

How many posts you have doesn’t matter anymore if you are using the latest version of WordPress (at least > v3.3.1).

I believe your permalink structure initially was — this /blog/%year%/%monthnum%/%day%/%postname%/ — and now, you are planning to use a much simpler one — /%postname%/ — amirite?

If the above is true, you just have to add this rule to your .htaccess file, and it should take care of all the 301 redirects for you:

RedirectMatch 301 ^/blog/([0-9]{4})/([0-9]{2})/([0-9]{2})/([^/]+)/$ http://www.thedomain.com/$4

And since it’s a 301 redirect, yes, Google will eventually know that the post has been moved to a new URL.

EDIT: By the way, the redirect rule doesn’t require mod_rewrite. It uses mod_alias which is enabled by default by most (if not almost all) hosts.

Leave a Comment