In this blog post, I will show you how to remove the date from your WordPress blog posts without losing traffic. WordPress is the most popular blogging platform out there, it is widely used not just for blogs but also for full featured websites by professionals and businesses. One of the reasons of its popularity is that you can get a simple blog started within minutes. There are a multitude of free plugins and themes available to you to help you create and launch your blog in a short amount of time.
One of the most common mistakes people new to WordPress do when starting a blog is to leave the default permalink option. The default permalink option often includes a post id or the date and name of a post. While the date and name of post isn’t the worst option, it is also not the best one if you care about search engine optimization (SEO).
What are Permalinks?
What are permalinks? Permalinks are the permanent URLs to your individual blog posts, as well as categories and other lists of blog postings. A permalink is what another blogger will use to link to your article (or section), or how you might send a link to your story in an e-mail message. The URL to each post should be permanent, and never change — hence permalink.
Below are the permalink options WordPress offers which you can find here: WordPress Dashboard -> Settings -> Permalinks
Why are Permalinks important? The default Permalink option isn’t search engine friendly. That reason alone should keep you from using it. In my opinion, the best permalink structure option for a WordPress blog is Post Name (see image above). Post name permalinks are short and sweet, and it will help your SEO.
Using the Category in a permalink is sometimes recommended, as long as the category name is short and you don’t have a lot of them. Personally, I am not a fan of using the Category as part of the permalink.
Another permalink method which I highly recommend against is the use of dates in your permalink. This takes away your ability of republishing your post at a later date. Having dates in your permalink literally dates your posts and it will work against your content. Up until recently, I was using dates in my blog’s permalink and this post is the result of the changes I had to make to my blog to fix this.
After you create a blog and start using specific permalinks in your posts, changing it can be devastating. If you change your permalink after you’ve published blog posts in your website, those links won’t work anymore. The result will be a multitude of page-not-found results (404s). The problem increases if you have a large number of blog posts published. How do you fix this?
Update your Permalinks and create permanent 301 redirects
There are a couple of ways you can create permanent redirects when changing your site’s permalink. A 301 permanent redirect tells the browser and search engines that a link (permalink) has been updated permanently to a new location. You can either log into the server hosting your WordPress site and update the .htaccess file OR install a plugin and make your life a bit easier. Both of these methods will allow you to remove the date from your WordPress blog posts without losing traffic or existing SEO.
Add a 301 Permanent Redirect to .htaccess
Updating the .htaccess file isn’t hard to do, in fact below are the changes you’ll need to make if you do have access to that file and to update it.
Assuming your current permalink includes the date and post name:
Then add this .htaccess code:
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ /$4 [R=301,NC,L]
Add a 301 Permanent Redirect using a plugin
I had to recently update my blog’s permalink to get rid of the dates and just use the post name. However, the hosting company I use for my blog doesn’t make it easy for me to update the .htaccess file. Also, the plugin mentioned below allows me not only to redirect my existing blog posts’ URLs, but it also shows me details on all the pages that have been redirected and all the page-not-found items (404s).
I tried several plugins and finally ended up selecting Redirection. This free plugin will allow you to remove the date from your WordPress blog posts without losing traffic.
This plugin is really easy to use, it shows you 404s and allows you to add permanent redirects easily.
After installing and activating the Redirection plugin, go to WordPress Dashboard -> Tools -> Redirection
Under the Source URL field you need to add (?i)/([0-9]+)/([0-9]+)/([0-9]+)/(.*) – this finds all the URLs requested from your site that include a date and name of post as follows:
and redirects it to a URL that only includes the name of the post:
Blog posts that you created prior to updating the permalink, will now be redirected to a URL using the new format that doesn’t include the date.
That is all you need to change your permalink and to make sure existing blog posts are redirected correctly. If you do have any questions or need help with this let me know. If you find this tutorial useful, please share it in your social media networks.