Creating Redirects for WordPress (and the Best Plugins for the Job)
What do broken external links, organic search engine traffic to outdated content, and deleted pages that send visitors to a 404 dead-end all have in common?
Just another day at the office, right? Hopefully not. These sort of problems don’t have to stick around in the WordPress world because what they have in common is that they can all be fixed with redirection.
However, redirection has to be properly implemented. Do it wrong and redirection can hurt both user experience and organic search traffic. Do it right and redirection enhances UX by delivering the right content, and has a negligible or even positive effect on search engine results page (SERP) rank.
Note: If you’re still having trouble logging in after reading this post, let us help! Our awesome support team can help you with any WordPress issue, big or small – and for free! It doesn’t matter what time it is or whether it’s the weekend, our team is available 24/7.
Et Tu, WPMU DEV?
You’re shocked, aren’t you? You can’t believe that I’m about to recommend one of those annoying notices that says “In 5 seconds you’ll be redirected” and then proceeds to hijack your browser.
Well, good. I’m glad you’re shocked at the suggestion.
That’s a horrible practice that should’ve been abandoned years ago and I’d never tell you to do that. While that sort of technique is technically a type of redirection, that’s not what I’m talking about.
Redirection should happen on the server out of the visitor’s view, and should be designed to improve user experience.
Proper redirection works like this:
- A website visitor clicks on a link or types in a URL.
- The server looks at the link and returns a message that says (in effect): “That page is out of date, deleted, or temporarily unavailable. Try this page instead.”
- The user’s browser gives it another go with the new URL recommended by the server and receives a page that is current and not a 404 page.
Proper redirection happens seemlessly and delivers the content the user expects to see.
Types of Redirects
There are three types of common redirects:
- 301 permanent server redirects,
- 302 temporary server redirects, and
- Meta refresh browser redirects.
307 redirects were also once common. However, they are basically interchangeable with 302 redirects and some search engines don’t really understand 307 redirects. So you’re better off using a 302 redirect rather than a 307.
301 or: “That Page is Gone, Use This One Instead”
301 redirects are the right type of redirection to implement in the vast majority of cases.
A 301 redirect tells visitor browsers and search engine web crawlers that the requested URL has been permanently redirected to a new location.
When a search engine sees a 301 they remove the original URL from their index and replace it with the new URL. In addition, search engines pass link juice from the old URL to the new URL. This means that the new URL will appear more or less right where the old URL appeared in SERPs, assuming it contains similar content.
Let’s consider some scenarios where a 301 is the proper choice.
Say you wrote a post several years ago that is now badly outdated. Rather than remove that post — and lose any traffic it’s generating — you could write an updated post and use a 301 redirect to push traffic from the old post to the new post.
Another scenario where a 301 is appropriate is when you remove a post or page entirely. For example, let’s say you discontinued a product line. In that case, a 301 redirection to a related product category or your site homepage will produce a better user experience than letting visitors bounce to a 404 page.
Lastly, if you overhaul your site’s permalink structure you will want to add 301 redirects from every affected post and page to tie them to the updated post and page URLs.
302 or: “That Page is Unavailable, Here’s a Temporary Replacement”
A 302 redirect tells browsers and search engines that the requested URL has been temporarily redirected. Search engines will not remove a 302’d URL from their index or pass link juice from the 302’d link to the new URL. This happens because the 302 code tells the search engine that the redirection is just temporary and will be removed in the future.
So, when would you use a 302 redirection? Use a 302 redirect when you plan on removing the redirection in the future.
Let’s dream up a fictional scenario where a 302 would be appropriate.
Imagine with me that you’re managing a conference website that is catching flak because it contains seemingly inaccurate information. Specifically, imagine that your Speakers page is under fire for listing unconfirmed speakers. In that event, a 302 redirection to a related page, such as the Call for Speakers page, would be the right way to hide the Speakers page while the situation is squared away. Once the dust has cleared, just remove the 302 and the Speakers page will again be accessible.
Anytime you want to redirect users away from a specific page or post on a temporary basis, use a 302.
That’s So Meta, and I Hate It
Remember those annoying browser-hijacking redirects I mentioned? Those are meta refresh redirects.
Meta refresh redirects don’t happen on the server. Instead, a meta refresh is created with a meta element in the document head that redirects the user’s browser to a different web page after a preset time interval.
There are very few scenarios where a meta refresh redirect is appropriate. For the most part, avoid them. However, there is one exception.
That is one scenario where a meta refresh is an appropriate choice, but it really isn’t a redirect since it just refreshes the existing page. There are very few if any scenarios where meta refresh redirection produces a good UX.
Redirection: There’s a Plugin for That!
Can you believe it? Of course, you can. There’s a plugin for just about everything you want to do in WordPress.
You can create 301 and 302 redirection rules manually. If your site is hosted on an Apache server you can do so by editing the .htaccess file you find in the directory where WordPress is installed. If your site is hosted with a managed WordPress host, or on an NGINX or IIS server, things aren’t quite as straightforward, and you’ll probably be best served to have a talk with your host if you want to create redirection rules manually.
Better yet, just reach for the easy button and create redirects with one of these free plugins.
Who should use Redirection: Sites that need to create 301 redirections and want to keep a log of 301 redirections and 404 page hits.
More than a half-million active installs and a rating of 4.2 out of 5 stars based on over 200 user reviews can’t be wrong. Redirection is easily the most-used redirection plugin in the WordPress Plugin Directory.
Upon activation, this plugin adds a settings page which is accessed by navigating to Tools > Redirection in the admin dashboard. To create a redirect, first click on the Groups tab and create a new group. When creating the group you can choose WordPress, Apache, or NGINX redirects. If you aren’t sure which to use, stick with WordPress.
Once you’ve created a group, navigate back to the Redirects tab and use the Add new redirection form to add redirection rules. Keep in mind, Redirection can only be used to create 301 redirection.
Redirection includes several additional useful features, such as the ability to download your redirects in a variety of formats from the Modules tab, a log of redirection actions, a log of 404 page hits, and the ability to add redirection rules by importing rules in .htaccess or CSV format.
Interested in Redirection?
Who is Simple 301 Redirects right for: Users looking for a less-is-more plugin to create 301 redirection.
More than 200,000 WordPress websites use Simple 301 Redirects, and more than 90 users have reviewed the plugin and given it a rating of 4.3 out of 5 stars. Those are strong numbers and reflect the fact that this plugin does exactly what it says: make it simple to create 301 redirects.
This minimal plugin adds a single screen to the WordPress admin dashboard which is accessed by going to Settings > 301 Redirects. The resulting page displays a form, which is used to create manual redirection rules one at a time. If you want to bulk-upload CSV format redirections, there’s a plugin add-on for that.
Interested in Simple 301 Redirects?
Who will be interested in Eggplant 301 Redirects: Websites that need both 301 and 302 redirects and want to avoid creating mistyped redirects that lead to a 404 page.
Eggplant 301 Redirects is the under-the-radar redirection plugin that more WordPress users should know out. It has an excellent rating, with a score of 4.3 out of 5 stars based on between 25 and 30 reviews, and is active on more than 40,000 sites. That seems like a lot, but is really just a fraction of the installation base of competitors Redirection, Simple 301 Redirects, and Quick Page/Post Redirect Plugin.
Install the plugin and a new menu item will be added to the admin dashboard at Settings > EPS Redirects. The plugin page has a clean interface with three tabs:
- Redirects offers up a form for manually entering redirection rules.
- The 404s tab is inactive with the free version of the plugin but logs 404 hits if you upgrade to the premium version.
- Access the Import/Export tab to import a CSV formatted list of redirection rules or export a backup copy of your redirection rules. This tab also has a link to download an example CSV file which you can use to model your own list of CSV format redirects after.
The real reason Eggplant 301 Redirects is on this list is because it has two unique features worth mentioning. First, you can use it to create either 301 or 302 redirects — a feature missing from Redirection and Simple 301 Redirects. In addition, the redirect rule form includes a helper menu which ensures you don’t mess up the destination URL and accidentally bounce visitors to a 404 page when creating redirection rules.
Interested in Eggplant 301 Redirects?
Who is Quick Page/Post Redirect Plugin right for: WordPress users that want the ability to add custom 301 and 302 redirects to posts and pages right from the editor.
The name might make you think that this plugin provides a streamlined experience similar to Simple 301 Redirects. However, if you thought that, you’d be wrong. Active on over 200,000 WordPress websites, and with a rock-solid rating of 4.6 out of 5 stars, Quick Page/Post Redirect Plugin is a contender for the redirection plugin best bet award (if there is such a thing).
Upon activation, Quick Redirects adds a new top-level item the admin dashboard menu. The positioning of the menu item indicates something about this plugin: it isn’t simple or basic. It is the most feature-rich redirection plugin out of the bunch.
Adding redirects from the Quick Redirects from within the admin menu is easy but it does take a little trial-and-error to get the formatting exactly right. The most powerful way to use the plugin is from the post or page editor. To add a custom redirection rule to a specific post or page, open that page or post in the editor and scroll down until you see the Quick Page/Post Redirect meta box. From the editor you can add a highly-customized redirection rule and set it up as either a 301, 302, 307, or meta refresh redirections.
In practice, you’ll want to stick to the 301 and 302 options in almost all cases, but it’s nice to have the other options for rare instances where they’re appropriate.
The other pages available in the Quick Redirects admin menu offer a huge range of additional options. You can redirect an entire website to another URL, turn off all redirects, configure a custom meta redirection notice, open redirects in a new window, and more.
Interested in Quick Page/Post Redirect Plugin?
Who will be interested in Auto Refresh Single Page: Websites that need refresh a page automatically after a preset time interval.
This isn’t really a redirection plugin. However, as was mentioned earlier in the article, the most appropriate use of a meta refresh is to continuously update a live feed. If you’ve built a page that pulls in new data all of the time and want it to refresh automatically — say, every 30 seconds or so — this plugin will do the trick.
Activating the plugin adds a new meta box to the page editor. To automatically refresh that page add any number to the new meta box and the page will automatically refresh after that number of seconds.
Interested in Auto Refresh Single Page?
Now Go, and Meta Refresh No Longer
Well, at least meta refresh very rarely and responsibly. In most cases, stick to the 301 and 302 redirections the web has grown accustomed to.
Redirection is an important SEO and UX management tool. Understanding the different types of redirects and how to implement each is critical if you are going to manage your site effectively, ensure search engines keep your site’s content indexed, and provide the best experience possible for your site’s users.