Want to know what a redirect is? Are you trying to create a redirect in WordPress? Our beginner’s guide to WordPress redirects will help you understand what a redirect is and how to create a redirect in WordPress easily and quickly.
Before we jump in to this guide, we’re firstly going to explain what a redirect in WordPress actually is. This will help you establish whether you need a redirect, and if so, how to create one.
Table of Contents
What is a Redirect in WordPress?
A redirect is a method for your website to let your user’s browser know that a page they’re trying to visit has moved to a new location. The browser will automatically direct them to the new page that you choose to redirect them to.
There are multiple redirects, some of which you may have heard of before, including 301 redirect, 302 redirect, and 307 redirect.
The number of redirects can be confusing, so for the purpose of this article, we’re just focussing on 301 redirects. Let’s take a look at when you would need to use a 301 redirect in WordPress.
When Should You Use a 301 Redirect in WordPress?
The main reason people use 301 redirects is when your website or page on your website has moved. It’s an easy way for your user’s to be redirected to the new page without encountering a 404 error or something else.
Here are a couple of scenarios that you would want to use a 301 redirect in WordPress:
- If you plan to delete a post or page and replace it with new content
- If you plan to change the permalinks of your posts or pages
This is why 301 redirects are very important. It tells your user’s browser and search engines that the page they’re trying to access has moved. Any old traffic or backlinks can be transferred to the new post or page, meaning you won’t lose out on your efforts.
If you encountered a 404 error, the likelihood is that you’ll abandon the current website and move onto another one. With a 301 redirect, you can be sure your website’s traffic won’t take a hit if the content is no longer available.
How to Create a 301 Redirect in WordPress
We’re going to look at multiple ways in which you can create 301 redirects in WordPress. We’ll be talking about plugins first, then moving onto using .htaccess. Don’t worry, we’ll walk you through every step so you can be sure your 301 redirects are successful.
The quickest way to manage redirects in WordPress is to use the Redirection plugin. You’ll need to install the free plugin and activate it to set up your redirects.
Once activated, click on Tools > Redirection so you can setup your redirects.
Redirection plugin allows you to setup redirects and locate 404 errors on your WordPress website. Once you’ve located any 404 errors, you can redirect the URLs to the correct destination.
This is a great plugin, allowing you to boost your website’s SEO and improve user experience. I highly recommend it.
Page Links To Plugin
If you want to keep a post or page but redirect users to another place, the Page Links To plugin is extremely helpful. The plugin adds a meta box to your post edit screen, allowing you to enter the URL of the new location where you want your users to be redirected to.
The Page Links To plugin is free to use and has over 200,000+ active installations. There are multiple uses for this plugin which are worth exploring.
While setting up 301 redirects using a plugin is easy to do, you may experience some slight performance issues. Depending on your WordPress hosting provider, your redirects may perform a little slower. However, if you want to ensure there are no performance issues, you can follow the next method.
Setting Up 301 Redirects Using .htaccess
WordPress users can setup 301 redirects using the config file .htaccess. Before messing around with this file, it’s important you backup your .htaccess file as the smallest mistake can cause an error.
To edit your .htaccess file, you’ll need to use an FTP client like FileZilla. The .htaccess file lives in your WordPress site’s root directory, so you’ll need to connect to your website via FTP.
You can find your FTP details through your WordPress hosting account. If you’re not sure where these are, speak to your web host and they’ll be able to point you in the right direction.
You can edit your .htaccess file using Notepad. Add the following line of code to the end of your .htaccess file:
Remember, if you make a mistake or your website displays an error, you can copy your old (backed up) .htaccess file back to the server.
I hope that you’ve found this article useful. Not only should you now understand what a 301 redirect is, you’ll know when do use one and how to create a 301 redirect in WordPress.
If you’re looking to expand your WordPress knowledge, feel free to check out our other WordPress resources like how to add a site icon to your website, how to change your WordPress site’s font size, and how to fix the error establishing a database connection.