If you have blogged as long as I have, over 13 years as of the date of this post. You often run into old posts that are just no longer valid for you site or valid for your readers. It could be because the content is no longer valid. It could be a post on how to do something and the directions are no longer accurate because times change. You may automatically think that you can just delete the post and be done with it. However, this is not the correct solution.
Yes, you can delete the post so that it no longer shows up in your feed or searches. However, it will still show up in searches used by Google, Bing, and Yahoo. Once they are indexed by the search engines they are there and will come up in searches. This means that if someone does a search and clicks a link to an old post of yours and that post is deleted they will come to a 404 Error page. This isn’t a good thing to happen because Google hates 404 error pages.
How to: 301 Redirect How to post using .htaccess
There is a fairly easy process to fix this error though. There are several ways of doing this, however, this is the one way I found to be the easiest and quickest. You can still delete the post from your site. However, you need to add a small bit of code into your .htaccess file for each post you want to delete.
In order to do this process you will need access to your .htaccess file on your server (where your blog is hosted), a small line of code to place in the .htaccess file, and then you can delete the post or you can leave the post there and it will still redirect the post if someone goes to it.
Editing your .htaccess file
Although this is a very easy thing to do, you do have to be very careful when working with this file because if you make a mistake it can break your site. You can fix the problem if this occurs but it is always better to be very careful and only change what you need to and always make a backup copy of the file before editing it.
In order to redirect a post or page from your WordPress blog, you will need to have the exact URL of the post and include it in a small line of code. This code should be placed at the beginning of your .htaccess file. Nothing should be before any redirect codes.
Redirect 301 /old-page-name https://www.shawnann.com/new-page-name
That may look a little confusing but it is really easy. Here is an example of how I would want to redirect this post to different pages of Shawn Ann.
Redirect to the main site:
Redirect 301 /how-to-301-redirect-how-to-post-using-htaccess https://shawnann.com
Redirect to Mom Tech Category page:
Redirect 301 /how-to-301-redirect-how-to-post-using-htaccess https://www.shawnann.com/category/mom-tech/
Delete Irrelevant Post
This is an optional step, you do not need to delete the post, but if you know that you will never need to refer back to the post then you should just delete it. The only time you may want to not delete the post is if is something you might be able to update and/or fix later or create a new post from the information within that post. That way you don’t necessarily have to completely rewrite a post.
Wow this is great info to know. Thanks so much for sharing this. I definitely need to do this with a few posts.
I will need to save this for future reference – most of the time I just try to go back and update the post so it will be more relevant.
I still do this also, however there are some posts that just can be updated to be more relevant.
Thanks for the tips. I would be interested in one for blogger as well.
I have it on my to do list for researching and writing a post up.
Good post. Do you know if there’s any way to do this in Blogger? We do this all the time at work but we use a content editing platform that has a way to do it.
Since I don’t use Blogger I don’t know how to do it off hand, but I can look into it for you.
Firstly, congrats on your 13 years of blogging, that is amazing! Second, thank you for posting this! On my other blog I have so many old coupon deal posts that I want to redirect.
wow- you have been blogging that long- that’s awesome! Congrats.
And thank you for the tip. I need to work on some of my old posts.
Yes Ma’am, I originally purchased shawnann.com back in 2000. I didn’t have a WordPress blog back then, everything was coded in HTML manually.