Remove Dates from Permalink for a WordPress Blog

In this Tutorial you will learn: How you can Remove Dates from the Permalink without losing your Posts / Links.

Say, your current blog post display is “http://www.blogtrafficexchange.com/2015/10/26/hello-bloggers/”.

After dates removal from permalink, it will display as http://www.blogtrafficexchange.com/hello-bloggers/.

How to Remove Dates from Permalink for a WordPress Blog

There are 3 steps involved in this process. The Step 1 involves change of Permalink Setting inside your Wordpress Blog Admin Panel.  Step 2 is for finding relevant “RedirectMatch 301 …” code to be added to .htaccess file. Step 3 is for adding required code to .htaccess file. The first step is quite easy and will be done via your website WordPress Admin Control Panel. Second and the third steps are more technical.

STEP 1

(Configure Wordpress Permalink Structure Setting)

  1. Login to Wordpress Admin Control Panel of your WordPress Blog.
  2. Inside Dashboard Click on:  Settings ==> Permalinks (you will see a screen like below image)
  3. Click on Radio Button “Post name”
  4. Click “Save Changes”
Remove Dates from Permalinks

Permalinks Setting

 

STEP 2

(a) Find appropriate “RedirectMatch 301 …” code for your WordPress Blog, to be placed inside your .htaccess file – from the below options.

(b) Once you pick relevant  “RedirectMatch 301 …” code then; REPLACE “http://www.blogtrafficexchange.com” by your own domain name, before you add this code to your .htaccess file.

==> WHEN YOUR WORDPRESS BLOG IS INSTALLED IN:  ‘ROOT’ FOLDER OF YOUR WEBSITE

  • If Permalink Type used by you for date is: “Day and Name /%year%/%monthnum%/%day%/%postname%/”

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

  • If Permalink Type used by you for date is: “Month and Name /%year%/%monthnum%/%postname%/”

RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(.*)$ http://www.blogtrafficexchange.com/$3

==> WHEN YOUR WORDPRESS BLOG IS INSTALLED IN:  SUB FOLDER ‘BLOG’ OF YOUR WEBSITE

  • If Permalink Type used by you for date is: “Day and Name /%year%/%monthnum%/%day%/%postname%/”

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

  • If Permalink Type used by you for date is: “Month and Name /%year%/%monthnum%/%postname%/”

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

STEP 3

Modify .htaccess File. This file is located in the directory, where WordPress Blog is installed. If it does not exist then you will need to create it.

In Step 2, you have already picked appropriate “RedirectMatch 301…”  code  and updated it with your own Domain Name. Now you should add this code to your .htaccess file using FTP and a Text Editor like Notepad or Notepad++, or via cPanel File Editor or any other method. This tutorial is not including, ways to modify .htaccess file.

Add the “RedirectMatch 301 …..” updated code to the the top of your .htaccess file (must always be before “# BEGIN WordPress” statement)

By RedirectMatch 301, you are telling the search engines that this content has moved to a new specified location. There may be some drop off during the transition, but in the long run your blog will turn stronger in the long run, owing to making this change.