Home » 301 redirect » How to create a 301 redirect in WordPress

How to create a 301 redirect in WordPress

Photo of author

Written by Group Buy Seo Tools

Last updated

Setting Up a 301 Redirect in WordPress: A Step by Step Guide

Has your site restructure and some site pages do not exist anymore? Or you have merged some of the content and want your users to appropriately land on pages without receiving a 404 error? In any case, ensuring a redirect is set up is very important for maintaining optimal user experience and SEO value of your website.

How to create a 301 redirect in WordPress

Automatically redirecting old URL requests to new ones is called “301 redirect.” It is the type of redirect that is both simple and quite handy in avoiding confusion due to misplaced server content.

If you are using WordPress, creating 301 redirects is easy. In this post, you will learn all that you need to know about 301 redirects and how you can configure them on WordPress, both manually and through plugins.

Why Are 301 Redirects Important?

Redirecting URLs with a 301 redirect is critical in ensuring the website stays intact. Here is the reason:

  1. Preserve Your SEO Rankings

When pages are updated or removed, not redirecting them results in a 404 page which is bad for websites. In this case, a 301 redirect would be helpful as it would help in transferring the “link juice” (ranking power) to the new address.

  1. Enhance User Experience

Having users land onto a 404 page is the quickest way to damage a website’s credibility. 301 redirects aid in improving the user experience by making the change between new and old URLs smooth.

  1. Simplify URL Updates

Websites are bound to change over time, and so do their URLs. A 301 redirect is helpful as it can assist in changing URLs (rebranding or optimizing for keywords) without the fear of traffic loss.

Walkthrough #1: Set Up 301 Redirects Through a Plugin

For people who don’t like fiddling with code, 301 redirects are best managed through plugins on WordPress. Here’s how it can be done:

Step 1. Get a 301 Redirect Plugin
Some of the most popular plugins for managing redirects are:

  • Redirection (Free)
  • Rank Math (Free + Paid)
  • Yoast SEO Premium (Paid)

To get started, go to your WordPress Admin Dashboard.

  • Go to Plugins > Add New, type “Redirection” or any other plugin you want to use into the search bar.
  • Hit Install Now, then click Activate .

Step 2. Find Redirects Settings
After the plugin is enabled, locate its options in the WordPress menu. For instance:

  • For the Redirection Plugin: Go to Tools then select Redirection.
  • Users of Rank Math or Yoast SEO Premium can find redirects on the list under the SEO section.

Section 3. Redirect Configuration

  • To configure the redirect, enter both the Source URL and Target URL under Add new Redirect. (The URL to redirect from and to redirect users to, respectively).
  • Here’s a sample:
  • Source URL: /old-page
  • Target URL: /new-page
  • Click on Save, then your redirect will be live.

Section 4. Validate the Redirect

Make sure to prioritize testing the redirect. Using the old URL and then checking if you are redirected to the Target URL should match. Using incognito window should help avoid caching issues.

Walkthrough #2: Creating a 301 Redirect with .htaccess File

For those users who prefer more control over their sites and are comfortable accessing the backend, you may wish to create 301 redirects manually by editing the .htaccess file. This can be beneficial for developers looking to gain complete control over their website.

Step 1. Getting to Your Site’s .htaccess File

Getting to your .htaccess file requires logging in via FTP or through your hosting provider’s file manager:

  • Access your files through cPanel or using FTP client FileZilla.
  • Navigate to /public_html/ to find the root directory of your WordPress installation and search for the .htaccess file.

Pro Tip: Always keep a copy of the .htaccess file handy as you may need it in case something goes wrong.

Step 2. Setup the 301 Redirect

Open the .htaccess file on your preferred code editor and implement the following changes:

Redirect 301 /old-page /new-page

• Change /old-page to the slug of the old URL, for instance: /about-old.

  • Change /new-page to the slug of the new URL, for instance: /about-us.

Store the changes you have made and put the file back on the server.

Step 3. Ensure the Redirect Works

Just like how you done it in the plugin method, enter the old URL in your browser and check if it leads you to the new page.

What Not to Do

While the basics of redirects are simple, you’ll want to steer clear of these common errors:

Redirecting To Yourself:

One of the simplest rules to get wrong and loop redirects between pages is not setting sensible boundaries is too common. Let’s say we set up a redirect for /old-page to /new-page and then back to /old-page. It will go on forever.

  1. No HTTPs

Using HTTP or HTTPS will result in errors if the right protocol isn’t used to set the redirect.

  1. After setting up a redirect, make sure you modify any pointed URL references in menus, internal or external links to the old URL.

Bonus Tip: Managing Redirects in Bulk

For those of you managing a large number of redirects, using a plugin like Redirection to import/export them through a CSV file is a huge time-saver. This is especially handy for site migrations or rebranding efforts.

Maintain Your WordPress Site Error-Free with 301 Redirects

Creating and maintaining a WordPress site comes with certain hurdles, but having the right tools such as 301 redirects will allow you to safeguard your SEO rankings and make sure every visitor goes to the correct page regardless of the pages they are arriving from.

Whether you use a simple, intuitive plugin or prefer the .htaccess file approach, setting up 301 redirects allows you to keep your site error-free and focused on delivering a great experience.

Looking for more ways to optimize your WordPress site? Subscribe to our newsletter and don’t fall behind!

Leave a Comment