Beginner‘s Guide to Creating 301 Redirects in WordPress

Redirecting web pages is an essential aspect of managing a WordPress site. When you change URLs or move pages, redirects ensure visitors and search engines can still find that content at its new location.

In this comprehensive guide, we‘ll explain what redirects are, when to use them, and provide step-by-step instructions for setting up 301 redirects in WordPress.

What is a 301 Redirect?

A 301 redirect is a permanent redirect that passes between 90-99% of link equity (ranking power) to the new page.

When a visitor types in an old URL that no longer exists, a 301 redirect automatically forwards them to the correct page. This prevents dead pages and "404 page not found" errors which frustrate users.

301 redirects also tell search engines like Google that a page has permanently moved. This passes the SEO value of backlinks and rankings to the new URL.

Other types of redirects include:

  • 302 Temporary Redirect – Used for short-term redirects. Passes little-to-no equity.
  • 307 Temporary Redirect – Temporary redirect that passes along POST data.
  • Meta Refresh Redirect – HTML redirect using a meta tag. Low transparency for bots.

301 redirects are preferable in most cases because they clearly signal a page has permanently moved while retaining SEO value.

When Should You Use 301 Redirects?

There are a few common instances when you need to set up a 301 redirect in WordPress:

1. Changing a Post Slug or URL

If you change the URL structure of a post or page, a redirect is needed to pass link equity and rankings to the new address.

For example, changing:

https://example.com/old-post-name 

To:

https://example.com/new-post-name

Requires a 301 redirect from the old URL to the new one.

2. Moving Content to a New Location

When moving a page or reorganizing site content, you‘ll need to redirect old URLs to the new pages to avoid broken links.

For example, redirecting:

https://example.com/old-url

To:

https://example.com/new-section/new-url

3. Switching Domain Names

If you change domain names entirely, 301 redirects are crucial for redirecting all old URLs to your new domain. This retains your site‘s traffic and SEO authority.

For example, redirecting:

https://olddomain.com/page  

To:

https://newdomain.com/page

4. Fixing 404 Errors

When broken links appear, you can set up redirects to fix the 404 issues and improve user experience.

For example, redirecting:

https://example.com/broken-link 

To:

https://example.com/working-page

5 Methods for Creating 301 Redirects in WordPress

Now that you know what 301 redirects are and when you need them, let‘s go through how to create redirects in WordPress.

There are several options available:

  1. Using an SEO plugin like All in One SEO
  2. A dedicated redirect plugin like Redirection
  3. Editing the .htaccess file
  4. Page builder redirects
  5. Manual PHP redirects

The easiest methods involve using a plugin. But manually editing the .htaccess file gives you the most speed and flexibility.

Let‘s look at how each method works:

Method 1: All in One SEO Redirects

All in One SEO is the most popular SEO plugin for WordPress. The premium version offers an excellent redirection manager.

Benefits

  • Very easy to create and manage redirects.
  • Automatically tracks and redirects 404 errors.
  • Can do full-site redirects to new domains.
  • Nice reporting to see redirect usage.

Drawbacks:

  • Need the Pro version which has a cost.
  • Adds a slight performance impact vs .htaccess redirects.

To set up redirects in All in One SEO:

  1. Install and activate the All in One SEO Pro plugin.

  2. Go to Plugins > All in One SEO > Redirects.

  3. Click Add New Redirect.

  4. Enter the old URL in the From field.

  5. Add the new URL in the To field.

  6. Select 301 Permanent Redirect for the type.

  7. Click Add Redirect to save.

That‘s it! All in One SEO will now automatically redirect the old URL to the new one with a proper 301 status code.

You can also enable 404 logging in the plugin settings to auto-track and fix 404 errors on your site by redirecting them.

Overall, All in One SEO provides the fastest way to add redirects without any technical knowledge required.

Method 2: Redirection Plugin

Redirection is a free WordPress plugin dedicated to managing redirects.

Benefits

  • Simple interface for adding redirects.
  • Actively monitors 404 errors.
  • Handles full site redirects.
  • Nice reporting.

Drawbacks

  • Performance impact vs .htaccess redirects.
  • Interface isn‘t as clean as premium SEO plugins.

Here is how to use Redirection to add 301 redirects:

  1. Install and activate the Redirection plugin.

  2. Go to Tools > Redirection in your WP dashboard.

  3. Scroll down and click Add New Redirection.

  4. Enter the old URL in the Source URL field.

  5. Add the new URL in the Target URL field.

  6. Select 301 Moved Permanently as the type.

  7. Click Add Redirect to save.

Much like All in One SEO, the Redirection plugin offers an easy way to create redirects without code. It also tracks 404 errors and allows bulk importing redirects.

For a free plugin, it works quite well. But occasionally the setup and redirect importing fails, so it‘s not quite as reliable as premium alternatives.

Still, Redirection is a solid free option for basic redirects management in WordPress.

Method 3: Simple 301 Redirects Plugin

If you want a really lightweight plugin strictly for adding 301 redirects, Simple 301 Redirects is a good option.

Benefits

  • Very simple interface.
  • Gets the job done without extra features.
  • Helpful for quickly adding individual redirects.

Drawbacks

  • No advanced reporting or management.
  • More limited than all-in-one SEO plugins.
  • Doesn‘t handle 404 monitoring or imports.

To use Simple 301 Redirects:

  1. Install and activate Simple 301 Redirects.

  2. Go to Settings > 301 Redirects.

  3. Enter the old URL in the Request URL field.

  4. Add the new URL in the Target URL field.

  5. Click Add Redirect to save.

That covers the basic functionality. As you can see, the plugin does one thing and does it well.

While Simple 301 Redirects won‘t replace a full-featured SEO plugin, it‘s great for quickly adding redirects on budget sites whenever you need them.

Method 4: Page Builder Redirects

Many popular WordPress page builders like Elementor have built-in options for setting up redirects.

For example, Elementor has a 301 Single Redirect widget that lets you create redirects right within your pages.

Benefits

  • Convenient when the redirect is related to a specific page.
  • Lets you manage redirects within page builder edits.

Drawbacks

  • Only useful for individual redirects.
  • No reporting or importing tools.
  • Requires page builder subscription.

Here is how to create a quick redirect using the Elementor 301 Single Redirect widget:

  1. Edit the page where you want the redirect.

  2. Drag the 301 Single Redirect widget onto the page.

  3. Enter the old URL you want to redirect in the Redirect From field.

  4. Add the target URL in the Redirect To field.

  5. Set the Redirect Type to 301.

  6. Click Publish and the redirect will be live.

This method works if you just need a quick redirect from within the page builder while editing. But overall, a dedicated plugin gives you more power and flexibility.

Many other top page builders like Beaver Builder, Divi, and more have similar redirect widgets as well.

Method 5: .htaccess Redirects

The most direct way to add redirects in WordPress is by editing the .htaccess file directly.

This is located in the root folder of your WordPress installation and can be modified with custom redirects.

Benefits

  • Maximum speed and performance.
  • Complete flexibility for advanced redirects.
  • Handles site migrations and bulk redirects.

Drawbacks

  • Requires coding knowledge and FTP access.
  • Risk of breaking site if .htaccess is misconfigured.
  • No reporting or management interface.

Here is how to properly add a 301 redirect to the .htaccess file:

  1. Connect to your site via FTP and navigate to the root folder.

  2. Locate the .htaccess file and download a backup copy.

  3. Open the .htaccess file in a text editor.

  4. Add the following redirect code above the #End WordPress line:

Redirect 301 /old-url /new-url
  1. Save changes and upload the file back to your server.

Be sure to replace /old-url with the page you want to redirect from, and /new-url with the destination.

The full WordPress .htaccess file looks like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add 301 redirect here
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Ideally, work with your developer when editing WordPress .htaccess files to avoid errors. But this method is powerful for fine-tuned control over redirects.

Method 6: Manual PHP Redirects

You can also manually add PHP redirects directly in your WordPress theme files. This involves editing your theme‘s header.php file.

Benefits

  • Allows precise redirect implementation.
  • Helpful for quick redirects during development.

Drawbacks

  • Requires coding knowledge.
  • Must re-add code on theme switch.
  • Easy to forget to remove redirects later.

Here is an example PHP redirect you can add to header.php:

<?php
//set old and new url
$old_url = "/old-url"; 
$new_url = "/new-url";

//check requested url
if($_SERVER[‘REQUEST_URI‘] == $old_url){
   //redirect permanently to new url   
   wp_redirect( $new_url, 301 );  
   exit;
}
?>

This basic PHP redirect lets you quickly send traffic from one page to another. But generally, a plugin or .htaccess update is preferable for long-term redirects.

301 Redirects and SEO

301 redirects are important for SEO because they pass link equity and rankings to new pages. However, there are a few best practices to ensure proper SEO benefit:

  • Use 301 permanent redirects when possible – this clearly signals a page has moved. 302 and other types are seen as temporary.

  • Keep redirects active – don‘t delete old redirects over time or it may result in dead links.

  • Don‘t chain multiple redirects – stick to redirecting from old URL directly to new URL.

  • Use accurate redirect mapping – be sure redirect structure matches old site structure.

  • Maintain clean redirects – delete unused redirects and fix broken ones.

  • Check redirect headers – verify server is sending proper 301 status codes.

When set up properly, redirects allow you to move WordPress content while maintaining SEO authority. Just be sure to install them correctly whenever site structure changes.

301 Redirects for Site Migrations

One of the biggest uses of 301 redirects is migrating websites to new domains or content management systems.

Whether you are moving from WordPress to Shopify, or from Blogger to WordPress, visitors and search engines need to know where your new site lives.

Here are some tips for using redirects during a major site migration:

  • First, map out the old site structure and URLs. You want to mirror this in the new site.

  • Create CSV files with lists of old URLs to redirect to new URLs for import into SEO plugins.

  • Use find and replace to quickly update URLs in bulk across site content.

  • Set up a catch-all redirect from old domain to new domain in .htaccess.

  • Install an SEO plugin on new site and import redirect CSV files.

  • Activate the redirects and verify site receives proper 301 codes.

  • Submit new sitemap to Google Search Console and check for crawl errors.

  • Monitor redirect usage and traffic flow over time; tweak redirects as needed.

Migrating systems while maintaining SEO comes down to proper planning and strategic use of 301 redirects. This keeps the transition smooth for both users and search engines.

301 Redirects FAQs

Let‘s cover some common questions about setting up redirects:

When do I use a 302 temporary redirect vs 301 permanent?

302 redirects are only necessary for very short-term, temporary changes. For example, redirecting traffic during maintenance or a limited promotion.

301s indicate a permanent change. This passes SEO value, so 301s are appropriate in most cases.

How soon does a redirect take effect?

Redirects via plugins or .htaccess are instant, taking effect as soon as they are added and saved. Users entering an old URL will immediately get forwarded.

How do I check if my redirects are working?

The easiest way is to simply visit an old URL and verify you are redirected to the proper new page.

You can also check the server response codes. A properly set up 301 redirect will return a 301 Moved Permanently status.

Can I redirect multiple old URLs to one new URL?

Yes, you can absolutely set up multiple redirects all pointing to one new target URL if needed.

How many redirects is too many?

Search engines may ignore pages with massive redirect chains (10+). But having hundreds of reasonable redirects from an old domain is fine.

Should I redirect blog feed URLs?

Yes, you should redirect old feeds like /feed and /rss to your new domain‘s feed URLs to maintain subscriptions.

Do redirects affect site speed?

Minimally. A good host can process redirects with no noticeable slowing. But huge lists of redirects may add a few milliseconds of load time.

Carefully managing your redirects will maximize both site speed and SEO benefit.

Wrapping Up

Understanding how to properly set up 301 redirects is a key WordPress skill. Whether you are updating permalinks, moving individual pages, or migrating domains, permanent redirects are crucial.

The fastest methods involve editing the .htaccess file directly or using a well-optimized SEO plugin. But even quick redirects from a basic plugin or page builder can get the job done.

Now you have a full guide to creating and managing redirects in WordPress like a pro!

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.