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?
- Download & Install the Redirection plugin for wordpress. Found here.
- 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).
- 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.
- 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.
- 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.
- Now, go to the Redirection plugin settings within your WordPress admin, under “Tools” on the left sidebar. Click the “Options” tab at the top.
- 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.
- Now upload as Redirections, and you should be all set.
- Now just wait for Google Webmaster Tools to realize that you made all of the redirections.