Stop Losing Traffic: How to Set Up 301 Redirects in WordPress the Right Way

Stop Losing Traffic: How to Set Up 301 Redirects in WordPress the Right Way

You deleted a page, moved content to a new URL, or migrated your entire site to a fresh domain. A week later, your traffic drops. Your rankings vanish. You check Google Search Console and see a pile of 404 errors.

This is the moment most site owners panic. But you do not need to panic. You need a 301 redirect.

A 301 redirect is a permanent signal that tells search engines and browsers: “This page has moved. Here is the new address. Please update your records.” When you set it up correctly, you preserve your hard-earned SEO value. When you skip it, you lose everything.

Let me show you exactly how to set up 301 redirects in WordPress the right way, without guessing.

Key Takeaway

A 301 redirect passes most of the link equity from the old URL to the new one, protecting your search rankings and user experience. The easiest method for beginners is a free plugin like Redirection. For advanced users, editing the .htaccess file or using a PHP script offers more control. Always test your redirects afterward to avoid redirect chains.

Why a 301 Redirect Is Your Best Friend

Think of a 301 redirect like a change-of-address form at the post office. When you move to a new house, the post office forwards your mail to the new address. Without that form, your mail gets lost. On your website, a 301 redirect does the same thing for traffic and search engines.

Google and other search engines understand this signal. When they see a 301, they transfer most of the ranking power from the old URL to the new one. They also update their index to point to the new location. This means your visitors, your backlinks, and your SEO value all move together.

A 301 redirect is permanent. Use it when you are certain the old URL will never come back. For temporary moves, use a 302 redirect instead.

When You Need a 301 Redirect

Here are the most common situations where a 301 redirect saves your traffic:

  • You changed the slug of a post or page (for example, from /my-post/ to /my-updated-post/).
  • You deleted a page that had backlinks or traffic.
  • You restructured your site categories or permalink structure.
  • You merged two pages into one.
  • You migrated to a new domain name.
  • You switched from HTTP to HTTPS.
  • You moved from www to non-www (or the opposite).

If any of these sound familiar, you need a 301 redirect.

Method 1: Using a Free Plugin (Beginner Friendly)

This is the safest and easiest method for most WordPress site owners. You do not need to touch any code. A plugin handles everything inside your WordPress dashboard.

Step-by-step with the Redirection plugin

  1. In your WordPress admin panel, go to Plugins > Add New.
  2. Search for “Redirection” by John Godley. It is free and has over a million active installs.
  3. Install and activate the plugin.
  4. Go to Settings > Redirection.
  5. Click the “Add Redirect” button.
  6. In the “Source URL” field, enter the old path. For example, /old-page/.
  7. In the “Target URL” field, enter the full new URL. For example, https://yoursite.com/new-page/.
  8. Make sure the redirect type is set to “301 (Permanent)”.
  9. Click “Add Redirect” to save.

That is it. The plugin also logs every redirect hit, so you can see how many times the old URL gets visited. This is helpful for tracking.

Other plugin options

  • Yoast SEO Premium includes a redirect manager. If you already pay for Yoast SEO, you do not need a separate plugin.
  • Rank Math SEO also has a built-in redirect module in its free version.
  • Safe Redirect Manager is a lightweight option with no external dependencies.

Expert advice: Stick to one redirect plugin. Using two at the same time can cause conflicts and redirect loops. Pick one and disable the others.

Method 2: Editing the .htaccess File (Advanced)

If you prefer not to use a plugin, or if you need to set up many redirects at once, editing the .htaccess file gives you direct control. This method works only if your hosting uses an Apache server.

Step-by-step for .htaccess

  1. Connect to your site via FTP or use the file manager in your hosting control panel.
  2. Locate the .htaccess file in the root directory of your WordPress installation.
  3. Download a backup copy of the file before making any changes.
  4. Open the file with a plain text editor.
  5. Add a new line for each redirect using this format:
    Redirect 301 /old-page/ https://yoursite.com/new-page/
  6. Save the file and upload it back to your server, overwriting the old one.
  7. Test the redirect by visiting the old URL in your browser.

Each line should be on its own line. Do not add extra spaces or special characters.

When to use this method

  • You need to redirect hundreds of URLs at once.
  • You are comfortable editing server files.
  • Your host blocks plugin installations on certain plans.

When to avoid this method

  • Your hosting uses NGINX (which does not use .htaccess).
  • You are not confident editing server files. A small typo can break your entire site.

Method 3: Using a PHP Script (Developer Friendly)

For WordPress sites hosted on NGINX or cloud platforms, you can add redirects directly to your theme’s functions.php file. This method is reliable but requires some caution.

Step-by-step for functions.php

  1. In your WordPress admin, go to Appearance > Theme File Editor.
  2. Click on functions.php to open it.
  3. Add the following code at the bottom of the file, before the closing PHP tag:
add_action( 'template_redirect', function() {
    $requested_url = $_SERVER['REQUEST_URI'];
    if ( $requested_url == '/old-page/' ) {
        wp_redirect( 'https://yoursite.com/new-page/', 301 );
    }
});
  1. Save the file.
  2. Test the redirect.

This method is best for a small number of redirects. For large lists, stick with a plugin or .htaccess.

Common Mistakes That Kill Your Redirects

Even experienced site owners make these errors. Avoid them to keep your SEO safe.

Mistake Why It Hurts How to Fix It
Using a 302 instead of 301 302 does not pass link equity. Always select “301 (Permanent)” unless the move is temporary.
Redirecting to a URL that also redirects Creates a redirect chain that slows load time and confuses search engines. Point directly to the final destination URL.
Forgetting to update internal links Users and crawlers still find the old URL through your own site. Go through your content and update links to the new URL.
Leaving the old page live Search engines see duplicate content. Delete the old page or set it to noindex after the redirect is active.
Not testing after setup A broken redirect looks like a 404 to users. Visit the old URL in a private browser window and check the result.

How to Test Your 301 Redirects

After you set up a redirect, always test it. Here is a simple checklist:

  • Open an incognito or private browser window.
  • Type the old URL directly into the address bar.
  • Press Enter and watch what happens.
  • You should land on the new URL. The address bar should show the new URL.
  • Use a free online redirect checker tool to confirm the status code is 301.

If you land on a 404 page or a different page than expected, go back and fix the redirect entry.

What to Do After Setting Up Redirects

Setting up the redirect is only half the work. Follow these steps to fully recover your traffic.

  1. Submit the old URL to Google Search Console. Use the URL Inspection tool to request indexing of the old URL. Google will see the redirect and update its index.
  2. Update your sitemap. Make sure your XML sitemap only contains the new URLs. Remove any references to old URLs.
  3. Monitor your 404 reports. Check Google Search Console for any new 404 errors that appear. You might have missed some old links.
  4. Audit your backlinks. Use a tool like Ahrefs or SEMrush to see which sites still link to the old URL. Consider reaching out to those sites and asking them to update their links.

For a deeper look at fixing indexing issues, read our guide on how to fix crawled currently not indexed in Google Search Console.

Your Redirect Action Plan

Here is a numbered list of steps to follow the next time you need a 301 redirect.

  1. Identify all old URLs that need redirecting. Use a crawler tool or check your analytics for top-traffic pages.
  2. Decide which method to use: plugin, .htaccess, or PHP script.
  3. Set up each redirect one at a time. Do not batch them until you are confident.
  4. Test each redirect immediately.
  5. Update your internal links to point to the new URLs.
  6. Submit the old URLs to Google Search Console.
  7. Monitor your traffic and 404 reports for the next two weeks.

Keep Your SEO Safe With the Right Redirects

Losing traffic after a URL change is frustrating. But it is also preventable. A properly set up 301 redirect protects the work you have already done. It keeps your visitors happy and your rankings stable.

Start with the plugin method if you are new to this. It is forgiving, visual, and easy to manage. As you grow more comfortable, you can explore the .htaccess file for larger batches.

The most important thing is to act fast. The longer a broken link stays live, the more traffic and authority you lose. Set up your 301 redirects in WordPress today, and give your site the safety net it deserves.

Leave a Reply

Your email address will not be published. Required fields are marked *