Mass Redirections With WordPress [How To]

I have been forced to do tons of mass URL redirections on several of my WordPress sites as of late.

It’s an unfortunate, but necessary biproduct of messing around with URL structures.

For instance, on this blog, a URL to a post used to be: http://eliteeternity.com/category/post-name/

But now, it is http://eliteeternity.com/post-name/

(If you want to learn more about permalinks (wordpress URL structures), and how to modify them on your wordpress blog, there is some really good information here.)

But back on point …

In the example above, I removed the “category” portion of the URL, so since I did that, all of the posts that I have indexed in Google with the “/category/” prefix are now dead links.

This is bad.

For instance, if someone were to search for something in Google, and my site was ranked for what they were searching for, and then they clicked the link to that specific post on my blog, there is a really good chance that they would get a “page not found” error.

That’s obviously not good for the user; nor is it good for me.

So how do we fix this?

How do we redirect all of the OLD URL permalinks to the NEW permalinks that no longer have the “/category/” prefix in them?

How To

  1. Download & Install the Redirection plugin for wordpress. Found here.
  2. Get the list of old OLD URL’s that you need to redirect. If you have Google Webmaster Tools set up for your site, this is easy. Go to Diagnostics > Crawl Errors > Not Found … then “Download this table” (at the bottom of the error’d URL’s).
  3. Point OLD URL’s to NEW URL’s. Once you’ve got the list of old URL’s, you’re going to need to point them to the new URL’s. Download this spreadsheet I created, and make appropriate edits for your site.
  4. Make Edits. Open the file redirection-worksheet.csv you just downloaded, and paste your old URL’s in the specified column. Now, right next to the old URL’s, you’re going to find the updated URL on your website, and paste it into the NEW URL column. Leave the “hits” column blank.
  5. Important: Once you’ve updated that spreadsheet with the old and new URL’s, SAVE IT AS a WINDOWS COMMA SEPARATED (.csv). This is especially important if you are on a Mac, I think. If you don’t save it in the proper format, it won’t work, as I pointed out in this support thread.
  6. Now, go to the Redirection plugin settings within your WordPress admin, under “Tools” on the left sidebar. Click the “Options” tab at the top.
  7. Import .csv. Now you will see a headline that says “Import”. Click Choose File, and select the updated redirection-worksheet.csv that you just updated.
  8. Now upload as Redirections, and you should be all set.
  9. Now just wait for Google Webmaster Tools to realize that you made all of the redirections.
About Jeremy Blake

Jeremy is a self-proclaimed socially-awkward penguin living in Utah. He makes money online. As he sleeps.

  • Brakk

    There is an easier way to do this since all the changes are the same for every URL. You can use a regex filter in The redirection plugin to watch for any urls that contain /category and just strip that part out. Here is a guide I left in their forums a while back. http://urbangiraffe.com/support/topic/redirections-i-use

  • http://www.facebook.com/michaelbrentecklund Michael Ecklund

    @Brakk Using the regex option for batch processing of URLs is not always an option. For example, I had a site located in domain.com/wp/ and it moved to domain.com, I used regex for that scenario, but then none of the template files would load, users couldn’t log in or out because all of the URLs were being redirected. Not sure if it was a plugin glitch or what, but it most definitely didn’t work for me. In that case, individual URL redirecting VIA CSV was the best route to take. This is also a great post for those who use Webmaster Tools.

  • Spencer

    Michael,

    You have NO idea how much I appreciate this. I can’t tell you how many hours I’ve wasted trying either figure out how to do this or find a replacement plugin.

    Your directions are PERFECT!

  • Kirk Salisbury

    You rock man! You rock so much! You just saved us $100′s in saved time!

  • http://twitter.com/cassim56 Cassim Zahid

    Thanks so much Jeremy you legend! This is going to save a lot of manual work.

  • http://www.aioarena.com/ Naman Agrawal

    Thanks for this. Special thanks for Spreadsheet.