Heraclitus once said: “The only thing that is constant is change.” This applies to your blog as well. I find myself making constant little tweaks, adjustments and changes to my various blogs and websites. In some cases you can just delete things and change things with little to no risk. However, there are a few changes you have to really be careful with, and this is especially true if you have any search engine traffic coming to your blog. In particular, you have to be very careful when renaming or deleting WordPress pages or posts.
Don’t worry though, I’ll show you a trick that allows you to rename and delete and not lose any search engine traffic as a result.
The problem with renaming or deleting WordPress pages or posts
When you rename or delete a page or post in WordPress, that page or post is gone and no longer accessible using the prior permalink or URL. The problem with this in most cases, is that the search engines have already indexed the page and have it stored. When search engine users search, find your page or post, then click on it, they get the dreaded 404 error page which basically says “Page not found”.
This is not the experience you want visitors to your blog to have. You always want to do your very best to avoid having your visitors ever see an error message.
How do we fix this? Fortunately there is an easy solution.
301 redirects are a way to tell your visitor’s browser: “Hey, the content you asked for isn’t here anymore, but here’s the permanent replacement page”. The great thing about a 301 redirect is that to your blog’s visitor, the whole thing is seamless.
Fortunately, a 301 redirect works for search engines and search engine bots as well and is Google’s recommended way of handling renamed or deleted WordPress pages or posts.
A 301 redirect is done by adding a special statement to your .htaccess file. The .htaccess file is a double edged sword though. While you can do some amazing and powerful things using that little file, you can also really mess up your blog.
Unless you really know what you’re doing, I don’t generally recommend updating or changing this file directly.
For 301 redirects, I recommend using a plugin instead. There are a number of 301 redirect plugins available. The one I use and find easy to use is: Simple 301 Redirects. I did notice that as of the writing of this article, that the plugin hasn’t been updated in more than 2 years. I still actively run it though, with no issues.
Once installed and active, this plugin will add an option to your Admin console’s Settings menu named: 301 Redirects. Clicking on this will display the following screen (although your fields will be blank).
Adding redirects is easy. You just put the changed or deleted URL on the left and put your new URL on the right. You can see from my screen shot above, that I’ve renamed categories, renamed a few articles and deleted a few things. The deletes are the redirects that go from a page URL to my main site URL, as there isn’t really a replacement for them.
While it might be temping to redirect deleted pages or posts to other unrelated pages or posts, I don’t recommend this as this could confuse or frustrate your visitor. I always recommend redirecting deleted pages or posts to your main site URL.
Also, be sure to never redirect to a page that is redirected. This will result in a circular redirect, and an error being displayed to your visitors.
Test your redirects
Once you have your redirects in place, I recommend testing them. First confirm that your redirect works and that your browser redirects to the expected URL. Then I recommend that you test out other related URLs to insure they are still working. For example, if you redirected a category page, test out your other category pages.
If you want to be double sure, you can also use a redirect check tool.
Redirects can cause havoc with your site if you aren’t careful, so testing redirects is important.
Why delete or rename WordPress posts or pages?
If you’re fairly early in your blogging journey, you probably haven’t needed to rename or delete pages or posts just yet, but I can almost guarantee you will at some point. One of the most common reasons for renames is for search engine optimization. You may find that a keyword phrase that you initially targeted isn’t working or that you’re getting traffic for a different set of keywords and want to optimize for those instead. Including your target keywords in your permalink or URL is an important strategy in ranking well on search engine result pages (SERPs).
Unfortunately, I also find that sometimes what I think are great ideas, turn out to be, well, not so great. This often results in a delete and redirect to my home page.
In 99% of the cases, you should always redirect your renames or deletes, even if the traffic is minimal. While I am unable to confirm this, most search engine experts believe that 404 (page not found) errors can negatively impact the quality of your site from Google’s perspective and cause your site to rank lower on SERPs. Given how easy these plugins are to use, there really aren’t any good reason not to use redirects.
Photo credit: Ben Gillin