Do you want to know how to add 301 redirects in WordPress?
When managing your website’s content, you sometimes have to delete or move it. It’s then important to redirect your old URLs to avoid 404 errors and dead-ends since it can hurt your SEO rankings, make you lose hard-earned backlinks, and give users a bad experience.
In this post, we’ll show you how to add 301 redirects in WordPress step by step. We’ll also cover what a WordPress 301 redirect is, when you should use it, and how to check if it works.
You can use our table of contents to jump straight to any section:
- What Is a WordPress 301 Redirect?
- When to Use 301 Redirects?
- Add 301 Redirects in WordPress (Step by Step)
- Check If Your Redirects Are Working
What Is a WordPress 301 Redirect?
A WordPress 301 redirect is a setting that automatically sends your website visitors to a different URL than the one they landed on. It’s a simple line of code that tells a web browser that the page it’s trying to load is no longer available, and tells it to navigate to a different page of your choice instead.
When a redirect is set up properly, it happens instantly, and your visitors often won’t even notice they’ve been redirected to a different page.
Not Redirecting Broken URLs Can Hurt Your SEO
It’s important to redirect your old URLs to avoid 404 errors and dead-ends.
If you don’t, those 404 errors can hurt your rankings and traffic:
- Your Deleted Pages Are Still Indexed — Your deleted pages will remain in the search engine index and users can still find and click on them. But when they do, they’ll see a 404 error, which is confusing and frustrating for users.
- Your SEO Rankings Will Drop — When too many URLs are changed, it can take Google a lot of time to reprocess and rediscover them. This results in significant drops in rankings.
- You’ll Lose Valuable Backlinks — If you’ve managed to get backlinks to your website, you’ll lose them when the content is moved or deleted, which can hurt your SEO.
- Google Will Pay Less Attention to Your Important Content — By not fixing 404 errors and redirecting to your new pages, you can lose visibility for your important content. If Google has to spend time crawling your non-existing or unnecessary pages, it may not get to index your important pages.
Luckily, when redirecting your old or changed pages to your new ones, you’ll keep your hard-earned rankings on Google and keep visitors on your page.
So when should you use 301 redirects? Let’s show you that next.
When to Use 301 Redirects?
You should use 301 redirects when:
- You’ve changed the URL of an existing post or page
- You’ve deleted your content and want to redirect visitors to a related post or page
- You’re moving your website to a new domain
There are various different types of redirects such as 301 redirect, 302 redirect, 307 redirect, etc. But to keep this post simple, we’ll only cover 301 redirects as these are by far the most common when deleting or moving content on your website.
Alright, let’s take a look at how to easily create 301 redirects using the best WordPress 301 redirect plugin, All in One SEO (AIOSEO) next.
Add 301 Redirects in WordPress (Step by Step)
With All in One SEO’s built-in Redirection Manager, you can easily manage your 301 redirects. It’s the simplest way to perform redirects and boost your SEO without needing to have any server knowledge.
If you didn’t know this already, AIOSEO is the best WordPress SEO plugin that comes with many advanced and powerful SEO tools and features:
- Smart XML Sitemaps — automatically generate a WordPress XML sitemap to notify all search engines of any new updates.
- Unlimited SEO Keyphrases — optimize your content on unlimited keyphrases and add related keywords in a single click.
- Analyze Your Competitors’ SEO — analyze your competitors’ SEO and find out what keywords they’re using to get ahead and gain an edge.
- Rich Snippets Schema — add schema markup to your pages and get more clicks and traffic with Google rich snippets.
- Local SEO — boost rankings for all your Business Listings, and get featured in Google’s Knowledge Panel and Google Maps.
- …and more.
With AIOSEO, you’ll get access to all the advanced SEO tools you need to optimize your website to rank high in search engines and drive more traffic.
With that said, let’s get started!
Enable Redirects on Your Site
To get started, you first need to get AIOSEO Pro or Elite license, then download and install the plugin. For detailed instructions, see our guide on how to install All in One SEO.
After installation, you need to enable redirects on your website. Simply go to Redirects in the All in One SEO menu, and click on the Activate Redirects button.
Now, you’ll see the Redirects screen and the option to Add New Redirection.
In the Source URL field, you enter the URL you want to redirect from. And the URL must be a relative URL. That means the part after your domain, such as https://example.com/. For example, if the URL is https://example.com/my-page, you’d only need to include my-page.
Like in this example:
In the Target URL field, enter the URL you want to redirect to. It can be either a relative URL or an absolute URL, meaning either example.com or https://example.com.
Choosing the Redirect Type
The next step is to choose your redirect type.
In the Redirect Type drop-down, you select the type of redirect you want to use. In this case, we’re going to choose the 301 Moved Permanently type.
Then, click on the Add Redirect button at the right bottom corner to add your redirect.
Your new redirect will now be shown in the Redirects table.
And in case you want to disable it without deleting it, you can switch the Enabled button so it turns grey instead of blue.
In addition, the Hits column shows how many times the redirect has been used by visitors on your site.
It can’t get much easier than that to manage your 301 redirects.
To make things even easier, you can set to automatically redirect users and search engines to your new content whenever you delete or change an URL.
In the Automatic Redirects setting, you simply choose if you want to include All Post Types or certain Posts or Pages.
And if you want, it even monitors the trash for you, so no 404’s will ever go unnoticed.
That said, let’s take a look at how to check if your redirects are working next.
Check If Your Redirects Are Working
You can test that your redirect is working by clicking on the Check Redirect link.
And if you need to edit your redirect, you can simply do so by clicking on the Edit link.
Finally, if you want to delete your redirect, you just click on the Delete link and it gets removed.
We hope this helped you learn how to add 301 redirects in WordPress. By redirecting your old pages to your new ones, you’ll help search engines and users not to get lost while browsing your website. It’ll help keep visitors on your page, as well as your rankings on Google.
You may also want to check out our post on how to easily find and fix 404 errors and how to set up bulk 301 redirects in WordPress.
One more thing…
….if you’re looking for more ways to improve your SEO, you should check out our posts on SEO best practices and 30 SEO hacks guaranteed to grow your traffic.
Not using AIOSEO yet? What are you waiting for?