For months, I had a goal to remove the dates from WordPress URLs (or permalinks) on my site. It seems like everyone is doing this, but nobody explains how to do it simply or easily. So I’m going to share my method.
Why I was apprehensive about removing dates
When you remove the dates, it means all of your URLs change. Web servers have a way of dealing with that, called redirection. They take your old URL and translate it to the new one transparently. Search engines recognize it and they don’t penalize you for duplicate content. Eventually they improve your search rank, yet everything else still works like nothing happened, and everyone’s happy.
Redirecting made me nervous because it usually means editing .htaccess files. I run a security plugin that’s constantly editing my .htaccess file to block threats–effectively it’s using .htaccess as a simple web application firewall. It shouldn’t clobber my redirects. But if you’ve been around computer systems any length of time, you know how that goes.
I’m perfectly comfortable editing plaintext files, but I realize not everyone is.
Enter the Redirection plugin
By using the Redirection plugin, you can manage your redirects from within WordPress. The other thing Redirection does is log your 404 errors. These logs are very helpful. You can use them to watch how bad guys are trying to get into your site. Seeing a handful of people trying to hack your site every day is enlightening.
I happen to have legacy content from the days before I ran WordPress; so I had about 200 redirections in place before I decided to change my URLs. If you don’t, then this is going to be really easy.
In my case, I had to export my existing redirections, edit them to remove the dates, then reimport to avoid a redirect to a redirect. Using search and replace, it didn’t take me long.
Two steps to remove the dates from WordPress URLs
Yes, you really can remove the dates from the URLs in just two steps, which seems rather anticlimactic. If you don’t have Redirection installed, installing Redirection counts as step 0.
First, click Settings, then Permalinks. Select Post Name. Click Save changes.
Next, click Tools, then Redirection. Click Groups and create a group if you don’t have any redirects yet. Then click Redirects and scroll down to the section called Add New Redirection.
Under Source URL, enter the following:
Be sure to check the box next to Regular Expression.
Under Destination URL, enter your URL followed by /$3 — here’s mine:
Leave the fields labeled Match and Action alone. Pick your group, then click Add Redirection.
Here’s what it looks like in the user interface:
Again, make sure you enter your URL, not mine. You and your readers don’t want your traffic going to me.
That’s it. Your mission to remove the dates from WordPress URLs is done. Visit your site and click around a bit to make sure everything works. Navigate back to Tools -> Redirection -> 404s and look for errors just to make sure.
Your backout plan
Always have a backout plan. If anything goes wrong, click Settings, then Permalinks. Select Month and Name. Click Save Changes.
Click Tools, then Redirection. Scroll to the redirection you created above, then hover under it and click Disable. Now your blog is back in the state you began with.
Why remove the dates?
OK, now we can talk theoretical stuff. If you’re not interested, just skip the rest of this entry and go back to what you were doing.
SEO experts recommend removing the dates from your URLs. There was a time when having them helped. Today, some experts believe having the dates penalizes you unless you’re a news site. At the very least, the year and month are taking up valuable space in the middle of the URL, pushing the important search terms further in the back.
I look at the search queries people use to find my site, because I want to know if I answered people’s questions. I can tell you I almost never see a year in a search query. So why put something so important up front in the URL? There’s no reason.
Playing the SEO game
I wrote off the effects of SEO (search engine optimization) until I saw the effects of modern SEO firsthand. Modern SEO is a lot harder to game than it was in years past.
SEO extends on what they teach professional writers in school. When I was in journalism school, they taught us to use the first paragraph to hook in a reader, and to use the last paragraph to wrap everything up. In between, you inform the reader, tell a story, solve a problem, and make the reader want to keep reading. That part of writing will never be obsolete.
But there are some tricks you need to do to get search engines to get you a reader. Changing your URL structure is one of them. I may also interject one sentence in the first paragraph that’s designed for the search engine. My former professors, instructors and teachers would bristle at some of those lines, but without them, I might not get that click. Today you have to hook the search engine and the reader. I use the rest of that paragraph trying to hook the reader. If they don’t bounce right back to the search engine, the engines notice, they rank me a bit higher, and the cycle starts all over again.
It’s an inexact science, and I don’t claim to have mastered it. But I’m in the game.