How to Create 301 Redirects in WordPress: 4 Reliable Methods

A practical walkthrough of four ways to set up 301 redirects in WordPress, from beginner-friendly plugins to server-level configuration, so you can preserve SEO value and keep visitors on the right pages.

How to Create 301 Redirects in WordPress: 4 Reliable Methods

Moving or deleting a page on your WordPress site is a normal part of running a website. The problem is that any visitor, link, or search engine still expecting the old URL will hit a frustrating 404 error unless you tell the web where the content has gone. That is exactly what a 301 redirect does. It permanently forwards an old address to a new one, transfers the link equity the old page earned, and keeps both users and crawlers happy. In this guide you will learn how to create 301 redirects in WordPress using four different methods, ranging from a simple plugin to a hand-written server configuration, so you can pick the right approach for your skill level and hosting environment.

Key Takeaways

Technical illustration explaining Key Takeaways for 301 redirects in WordPress
Key Takeaways shows a practical part of 301 redirects in WordPress.
  • A 301 redirect is a permanent redirect that sends visitors and search engines from an old URL to a new one while preserving SEO value.
  • You should use 301 redirects whenever you delete content, move to a new domain, switch to HTTPS, or consolidate pages.
  • WordPress site owners can set up 301 redirects through a dedicated plugin, an SEO plugin, the .htaccess file, or a PHP server-side function.
  • Always back up your site before editing .htaccess or theme files, and test every redirect after creating it.
  • Choose the method that matches your comfort level and the redirect rules you need to manage over time.

What a 301 Redirect Actually Does

Technical illustration explaining What a 301 Redirect Actually Does for 301 redirects in WordPress
What a 301 Redirect Actually Does shows a practical part of 301 redirects in WordPress.

A 301 redirect is an HTTP status code that signals a permanent move from one URL to another. When a browser or search engine crawler requests the old address, the web server responds with the 301 code and the new location, and the request is completed automatically. Because the response is permanent, browsers cache the new URL and search engines transfer the ranking signals associated with the old page to the replacement page.

Without this signal, visitors land on 404 Not Found pages, bounce rates climb, and any backlinks pointing at the old URL stop delivering value. For a content-driven site, that combination can quietly erode organic traffic over weeks and months.

Common Situations That Call for 301 Redirects

You will reach for a 301 redirect in most of the same situations you would edit your site's information architecture. The most common triggers include deleting outdated posts while still sending visitors to a relevant replacement, migrating an entire site to a new domain, switching from HTTP to HTTPS after installing an SSL certificate, and merging several thin articles into a single comprehensive guide. Each of these changes alters the URL a visitor expects, and a permanent redirect is the cleanest way to communicate the new structure to both users and search engines.

Comparing the Four Methods Side by Side

Before diving into the step-by-step instructions, it helps to understand what each method requires and when it makes sense. The table below summarizes the four approaches supported by WordPress.

MethodSkill LevelBest ForMain Requirement
Redirection pluginBeginnerSite owners who want a GUI and 404 monitoringWordPress admin access
SEO plugin (Rank Math)BeginnerUsers already running Rank Math for SEORank Math installed and activated
.htaccess fileIntermediateApache servers and bulk redirectsFile manager or FTP access
PHP server-side redirectAdvancedDevelopers who need conditional logicTheme or mu-plugin edit access

Method 1: Install the Redirection Plugin

The most accessible way to set up a 301 redirect in WordPress is to install a dedicated redirect manager. The free Redirection plugin is widely used, well maintained, and includes helpful extras such as 404 monitoring and bulk import tools, which makes it a sensible starting point if you want to self host a WordPress website and manage redirects on your own.

  1. Log in to your WordPress dashboard and go to Plugins › Add New.
  2. Search for Redirection, install it, and click Activate.
  3. Navigate to Tools › Redirection and click Start Setup.
  4. Enable monitoring for permalinks and 404 errors if you want ongoing visibility, then click Continue.
  5. Confirm the REST API check returns a Good status and finish setup.
  6. Open the Add New section, type the source URL and the target URL, open the gear icon, and set the HTTP code to 301 Moved Permanently.
  7. Click Add Redirect.

Test the old URL in a private browser window to confirm it lands on the new page. The plugin also logs every 404 error it sees, which is invaluable when you inherit a site and need to map out broken links quickly.

Method 2: Create Redirects Inside Rank Math

If you already use Rank Math for SEO, you do not need a second plugin. Rank Math ships with a built-in redirect manager that supports 301, 302, 307, and 410 codes, plus regex-based rules for advanced scenarios. This is also a good fit if you want your redirect rules and SEO metadata to live in the same place.

  1. Install and activate Rank Math if you have not already, and complete the setup wizard.
  2. Go to Rank Math › General Settings › Redirection and make sure the Redirection module is turned on.
  3. Open Rank Math › Redirections and click Add New.
  4. Enter the source URL and the destination URL.
  5. Choose 301 Permanent Move from the redirection type dropdown.
  6. Save the rule and verify the destination.

Rank Math also lets you set up redirects from the post editor itself, which is convenient when you change a slug and want to forward the old address immediately. If you are testing a newer workflow, our coverage of WordPress 7 1 beta 3 what to test highlights other changes that may interact with redirect behavior.

Method 3: Edit the .htaccess File Directly

On Apache servers, WordPress uses an .htaccess file to control how URLs are handled. Editing this file gives you a fast, plugin-free way to issue 301 redirects and is especially useful when you need to redirect many URLs at once. Because a small typo can take your site offline, always back up .htaccess before making changes.

  1. Connect to your site over FTP or open the File Manager in your hosting control panel.
  2. Locate the .htaccess file in your WordPress root directory and download a backup copy.
  3. Open the file and add a redirect block above the standard WordPress rules.
  4. For a single page, use Redirect 301 /old-page/ https://example.com/new-page/.
  5. For a domain move, use Redirect 301 / https://newdomain.com/.
  6. Save the file, upload it back to the server, and test several old URLs in your browser.

If something goes wrong, replace the modified file with your backup and your site will return to normal. Site owners who run into trouble after editing core files can also review our guide on how to fix critical error in WordPress for recovery steps.

Method 4: Issue a PHP Server-Side Redirect

Developers who need conditional logic, such as redirecting based on the user's role or a query string, can use a PHP function hooked into WordPress. Place the snippet in a child theme's functions.php file or, better, in a small site-specific mu-plugin so it survives theme updates.

add_action('template_redirect', function () { if (is_singular('post')) { global $post; if ($post && $post->post_name === 'legacy-slug') { wp_redirect('https://example.com/new-slug/', 301); exit; } } });

This example sends visitors of a specific post to a new URL with a 301 status code. Because the redirect is generated by WordPress itself, it works on any server configuration, including Nginx hosts where .htaccess is not available. After saving the file, clear any caching layers and test the old URL.

Best Practices for Managing WordPress Redirects

Regardless of the method you choose, a few habits will keep your redirects clean and effective. Always favor 301 over 302 when the move is permanent, because search engines treat temporary redirects differently. Avoid redirect chains, where one URL forwards to a second and then a third, since they slow pages down and dilute link equity. Audit your redirects every few months to remove rules that are no longer needed, and keep an eye on the 404 log in the Redirection plugin to catch new broken links early. Finally, layer a web application firewall in front of your site to reduce malicious traffic that can pollute your logs; our notes on Cloudflare waf WordPress vulnerabilities explain how this fits into a broader security posture, and a quick walkthrough of how to install WordPress in your domain is useful if you are setting up a fresh site.

Frequently Asked Questions

What is the difference between a 301 and a 302 redirect?

A 301 redirect is a permanent redirect that passes the SEO value of the old URL to the new one, while a 302 redirect signals a temporary move and does not transfer link equity. Use 301 whenever a page has been moved for good, and reserve 302 for short-lived situations such as A/B testing or maintenance windows.

Will a 301 redirect hurt my WordPress SEO?

A correctly configured 301 redirect should preserve your SEO and often protect it, because the ranking signals attached to the old URL are forwarded to the new one. Problems only appear when redirects are misconfigured, for example when chains and loops form, or when 302 codes are used for permanent moves.

How long should I keep old 301 redirects in place?

Most SEO professionals recommend keeping 301 redirects live for at least one year, and longer if the old URL still attracts backlinks or traffic. Removing them too early can reintroduce 404 errors for visitors who arrive from external links that have not yet been updated.

Can I create 301 redirects without installing a plugin?

Yes. You can edit the .htaccess file on Apache servers or add a small PHP function to your theme or a mu-plugin. These approaches avoid extra plugins but require careful editing and a backup, since a syntax mistake can take your site offline.

How do I test that a 301 redirect is working?

Open the old URL in a fresh browser window and confirm it lands on the new page. You can also use a redirect checker tool or the curl command to inspect the HTTP response code, which should read 301 before the final destination. If the response reads 302 or 404, revisit the rule and save it again.

Conclusion

Setting up 301 redirects in WordPress is one of the highest-impact maintenance tasks you can perform, and it is well within reach even for beginners. Begin with the Redirection plugin if you want a guided experience, switch to Rank Math if you are already managing SEO from a single dashboard, edit .htaccess when you need speed and bulk control, or use a PHP function when you need conditional logic. Whichever method you choose, follow this short checklist every time you make URL changes:

  • Identify every old URL that needs to redirect and the matching destination.
  • Back up your site, and back up .htaccess or functions.php if you plan to edit them.
  • Create the redirect using the method that best fits your hosting stack and skill level.
  • Verify each redirect returns a 301 status code and lands on the correct page.
  • Review the 404 log monthly and prune redirects that no longer serve a purpose.

With those habits in place, your visitors will always reach the right page, and your search rankings will carry over to the new URLs without interruption.