How to Redirect a WordPress Page

How to Redirect a WordPress Page (Manually and Using a Plugin)

This article was revised and republished in August 2023. Are you interested in learning more about using WordPress and Beaver Builder? You should check out our free course library.

If you’re planning to make big changes to your website structure or to move it all together from one host to another, taking the time to redirect your WordPress pages can help you avoid broken links. 

In this article, we’ll dig into what redirects are and why you might need or want to use them. We’ll also discuss three ways of implementing them on your website.

Understanding Redirects in WordPress

When we talk about redirects, we’re referring to the process of mapping one URL to a different one. In other words, when a user types in a URL or clicks on a link to Page A, you can redirect them to Page B instead.

There are five main types of redirects you can use:

  • 301. This type of redirect is permanent. and indicates that the original page no longer exists at its original address. This is the best redirect to use for making sure your search rankings stay respectable. 
  • 302. This redirect serves as an alternative page when the requested file exists at the specified address, but can’t be found for some reason. This is a temporary redirect that caused problems for some browsers, so most site managers no longer use it. 
  • 303. Created as a replacement for the less-than-helpful 302 redirects, this type helps prevent screen refreshing or bookmarking of sensitive data, such as credit card information. 
  • 307. This redirect is temporary and nearly identical to a 303 redirect. They differ only in that a 307 utilizes the same technique to send and get information. A 303 uses two different techniques. 
  • 308. A cousin to the 303 and 307 redirects, this type of redirect achieves the same functionality. However, it’s permanent rather than temporary. It’s most useful for programmers rather than everyday WordPress users. 

Each type has its own specific purpose and benefits. For this post, we’ll be focusing on 301 redirects, as they’re most often the type you’ll encounter when working with WordPress.

Why You Might Need to Use a Redirect in WordPress

Some redirects can be used to directly benefit your site and business, while others serve as fixes for various technical issues.

Some of the main reasons you might need a redirect on your website include: 

  • 404 errors. These occur when a user requests a page that can’t be found. This may happen when you move a page to a new address, or simply because a user has typed in a URL incorrectly. You can also use custom 404 pages to keep lost users engaged and entertained. 
  • Permalink changes. Changing your WordPress permalinks to something more readable might benefit your site. If you change your existing links’ default structure, however, you’ll want to set up redirects so your site visitors don’t receive a 404 error. 
  • URL optimization. If your site has been established for some time, you might look at some of your old yet still popular pages and posts and decide if it would be better to optimize the URLs for mobile use or readability. During this process, make sure any bookmarked favorites your visitors have redirected to the new URL. This will also keep Google happy.
  • Directory changes.  You might need to move a directory of your website, either for general reorganization or even for security reasons. A 301 redirect will help to make sure site visitors still get to the right place. 
  • Search Engine Optimization (SEO). Whether you’re rebranding your website or want more control over the URLs your visitors see, experimenting with 301 redirects is one way to boost your SEO. For example, you might want all your site’s pages to display the same URL. Another SEO booster is to redirect all HTTP input to HTTPS.

Regardless of your reasons for redirecting one or more WordPress posts or pages, there are some things to be aware of before you get started. In particular, it’s wise to plan how to structure your redirects and what Google Page Rank might do with them.

For example, it’s important that the page you redirect a broken link to closely matches the topic of the original page. Otherwise, search engines will treat the redirect like a 404 error, which could hurt your SEO instead of helping it.

How to Redirect a WordPress Page (3 Ways)

There are several ways to redirect your WordPress pages. We’ll take a look at two ways that involve editing your .htaccess or functions.php files. Then we’ll walk through setting up a 301 redirect using a WordPress plugin.

1. Create Manual Redirects in WordPress Through Your .htaccess File

If you’re comfortable editing your WordPress files directly, your .htaccess file is probably the quickest way to set up a redirect. This file is where WordPress manages all your site’s permalinks. Editing your .htaccess file is an effective option whether you’re wanting to redirect just one URL or your entire website.  

First, find the URL you want to redirect and decide on the new endpoint URL. Make a note of the mapping for later use.

Second, make sure to back up your WordPress site. If you encounter any issues, you can restore the previous version of your site.

Next, go to your site’s file directory. There are a few ways to access it: through your web host control panel, the native WordPress file editor, or using File Transfer Protocol (FTP) and an FTP client such as FileZilla:

Adding a new redirect using the Redirection plugin.

Here you’ll see a list of all your current redirects. Below that list, there are fields where you can enter a current URL and the target URL to create a new redirect. Click the blue Add Redirect button when you’re finished.

Don’t forget to test your redirects to make sure they’re functioning correctly. You can also visit Tools > Redirection and use the tabs at the top of the screen to monitor your redirect log and 404 errors.

Conclusion

Whether you’re planning to move your website, want to change your permalink structure, or are looking to use redirects to fix broken links and improve your SEO, there are several ways to implement them in WordPress. Which is best for you will depend on your situation and skill level.

The three methods you might consider include: 

  1. Via your .htaccess file: This is the best option for whole-site redirects.
  2. Editing your functions.php file: A better option for more in-depth and specific redirects. 
  3. Installing a plugin: Ideal for users who aren’t comfortable editing core files, or who want ongoing redirect and 404 error monitoring. 

Do you have questions about using redirects on your WordPress website? Share them with us in the comments section below!

Screenshot of the Redirection plugin settings page.

After you’ve completed the setup wizard, you can create redirects by navigating to Tools > Redirection:

Adding a new redirect using the Redirection plugin.

Here you’ll see a list of all your current redirects. Below that list, there are fields where you can enter a current URL and the target URL to create a new redirect. Click the blue Add Redirect button when you’re finished.

Don’t forget to test your redirects to make sure they’re functioning correctly. You can also visit Tools > Redirection and use the tabs at the top of the screen to monitor your redirect log and 404 errors.

Conclusion

Whether you’re planning to move your website, want to change your permalink structure, or are looking to use redirects to fix broken links and improve your SEO, there are several ways to implement them in WordPress. Which is best for you will depend on your situation and skill level.

The three methods you might consider include: 

  1. Via your .htaccess file: This is the best option for whole-site redirects.
  2. Editing your functions.php file: A better option for more in-depth and specific redirects. 
  3. Installing a plugin: Ideal for users who aren’t comfortable editing core files, or who want ongoing redirect and 404 error monitoring. 

Do you have questions about using redirects on your WordPress website? Share them with us in the comments section below!

Screenshot of the WordPress plugin administration dashboard with the Redirection plugin Install Now button highlighted.

After you install and activate the plugin, you’ll be greeted with an introductory screen with information and an option to start the setup wizard, which provides some simple options for your redirects. The plugin uses Redirection uses the WordPress REST API to communicate with WordPress, the setup wizard also checks that functionality and reports any problems. Here’s a screenshot of the information screen:

Screenshot of the Redirection plugin settings page.

After you’ve completed the setup wizard, you can create redirects by navigating to Tools > Redirection:

Adding a new redirect using the Redirection plugin.

Here you’ll see a list of all your current redirects. Below that list, there are fields where you can enter a current URL and the target URL to create a new redirect. Click the blue Add Redirect button when you’re finished.

Don’t forget to test your redirects to make sure they’re functioning correctly. You can also visit Tools > Redirection and use the tabs at the top of the screen to monitor your redirect log and 404 errors.

Conclusion

Whether you’re planning to move your website, want to change your permalink structure, or are looking to use redirects to fix broken links and improve your SEO, there are several ways to implement them in WordPress. Which is best for you will depend on your situation and skill level.

The three methods you might consider include: 

  1. Via your .htaccess file: This is the best option for whole-site redirects.
  2. Editing your functions.php file: A better option for more in-depth and specific redirects. 
  3. Installing a plugin: Ideal for users who aren’t comfortable editing core files, or who want ongoing redirect and 404 error monitoring. 

Do you have questions about using redirects on your WordPress website? Share them with us in the comments section below!

Screenshot highlighting the htaccess file in an FTP application.

Sometimes you may have to reveal hidden files in order to view and edit your .htaccess file. 

Open the .htaccess file in a text editor and enter the appropriate 301 redirect code. To complete a single URL redirect, add the following lines: 

Redirect 301 /old-page.html http://www.mydomain.com/new-page.html

In the first line, modify old-page.html to match the old URL, and in the new URL modify the URL to match the target URL,

If your site has an SSL certificate, it’s good practice to redirect users who have “HTTP” in the URL to a more secure “HTTPS” URL. For this, add the following lines to your .htaccess file without modification:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Finally, you can redirect your entire website to a different URL by adding the following lines to your .htaccess file and changing the URL in the third line to match your target location:

#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(>*)$ http://www.mynewdomain.com/$1 [R=301,L]

Save the changes to your .htacess file. If you edited the file on your local system, don’t forget to upload it to your site’s server. To test your redirect, type in the URL for your old page to see if you land at the new address.

2. Edit Your WordPress functions.php File to Create a Redirect

Another way to create a 301 redirect for your WordPress website is by editing the functions.php file in a child theme. Any WordPress theme folder has a functions.php file, which contains important code for your site. The child theme has its own functions.php file, which is the place to put customizations. It’s important to edit the functions.php file only in a child theme because that file in the parent theme can get overwritten any time there’s an update. Luckily it’s easy to create a child theme if you don’t have one yet, either with a plugin or manually.

Locate the functions.php file in your child theme via one of the same methods we described for accessing .htaccess. Here’s a screenshot of a typical WordPress installation with a child theme:

functions-php-in-child-theme

To redirect your entire site to a single new location, open functions.php in a text editor and add the native WordPress wp_redirect function by appending the following lines to the end of the file: 

wp_redirect( "http://www.my-blog.com/a-new-destination", 301 );
exit;

Change the URL to the redirect target. 

Embedded in additional PHP code, the wp_redirect function can be used to redirect a single URL. If you use a strategic slug structure on your website, you can also use wp_redirect to redirect certain slugs to a new URL. This can be handy if you want to redirect all your posts after changing your default permalink structure, for example.

3. Redirect Your WordPress Pages With a Plugin

If you’re not keen on slicing and dicing your website files and adding new code strings, don’t fret. There are other ways to employ redirects on your website. In fact, there are many WordPress redirect plugins available that might pose less of a risk to your site. 

A great plugin option is 301 Redirects – Easy Redirect Manager:

Screenshot of the 301 Redirects-Easy Redirect Manager plugin banner.

It offers an import/export feature for bulk management of redirects. If you’re working on a one-time restructuring or moving to a new host, it can be helpful. 

Redirection plugin is another popular and highly rated tool for this purpose:

The Redirection plugin.

It acts as a bit of a housekeeper for your website. It can keep track of 404 errors, manage 301 redirects, and make sure your links stay tidy so your page rank remains respectable.

Let’s walk you through how to use it. 

Start by navigating to Plugins > Add New in your WordPress dashboard and searching for it:

Screenshot of the WordPress plugin administration dashboard with the Redirection plugin Install Now button highlighted.

After you install and activate the plugin, you’ll be greeted with an introductory screen with information and an option to start the setup wizard, which provides some simple options for your redirects. The plugin uses Redirection uses the WordPress REST API to communicate with WordPress, the setup wizard also checks that functionality and reports any problems. Here’s a screenshot of the information screen:

Screenshot of the Redirection plugin settings page.

After you’ve completed the setup wizard, you can create redirects by navigating to Tools > Redirection:

Adding a new redirect using the Redirection plugin.

Here you’ll see a list of all your current redirects. Below that list, there are fields where you can enter a current URL and the target URL to create a new redirect. Click the blue Add Redirect button when you’re finished.

Don’t forget to test your redirects to make sure they’re functioning correctly. You can also visit Tools > Redirection and use the tabs at the top of the screen to monitor your redirect log and 404 errors.

Conclusion

Whether you’re planning to move your website, want to change your permalink structure, or are looking to use redirects to fix broken links and improve your SEO, there are several ways to implement them in WordPress. Which is best for you will depend on your situation and skill level.

The three methods you might consider include: 

  1. Via your .htaccess file: This is the best option for whole-site redirects.
  2. Editing your functions.php file: A better option for more in-depth and specific redirects. 
  3. Installing a plugin: Ideal for users who aren’t comfortable editing core files, or who want ongoing redirect and 404 error monitoring. 

Do you have questions about using redirects on your WordPress website? Share them with us in the comments section below!

About Will Morris

Will Morris is a staff writer at WordCandy. When he's not writing about WordPress, he likes to gig his stand-up comedy routine on the local circuit.

7 Comments

  1. Matt on December 2, 2019 at 1:33 pm

    I actually find the easiest way to edit the .htaccess file is the File Editor tool that is built into Yoast SEO. Lets us do it straight from the WP Dashboard!



  2. Tanya Sharma on February 10, 2020 at 4:19 am

    Great info! Thanks for sharing..



  3. Fayum on March 27, 2020 at 3:34 am

    Redirecting a Wordpress page is not that hard. All you need to install is a 404 Plugin.



  4. Molly on April 1, 2020 at 10:33 pm

    This is such a great content. All you need is to use plugins wisely. Like using 404 Redirection Plugin would help you in the same



  5. Matt Eastwood on April 3, 2020 at 12:23 am

    Yeah but guys, why bloat your website with plugins you don’t need? They just introduce more potential security risks. Most of us are already using Yoast SEO anyway. All you need to do is to go to Yoast > Tools > File Editor and edit your .htaccess right there. Keep your WordPress site slim and safe!



  6. Madhuri on May 6, 2021 at 11:53 pm

    It is really helpful for me



  7. Walter on August 21, 2023 at 2:06 am

    Very well explained, no doubt redirecting manually is better than using any plugin for this purpose if you are a technical person



Our Newsletter

Our newsletter is personally written and sent out about once a month. It's not the least bit annoying or spammy.
We promise.

Try Beaver Builder Today

It would be totally gnaw-some if you could share this post with your friends.

Related articles

Spotlight on 48in48 | Beaver Builder nonprofit website builder

48in48 Spotlight: Beaver Builder’s Nonprofit Website Builder

For the past ten years, Beaver Builder has been the go-to nonprofit website builder for 48in48. This incredible initiative brings…

Read More...
Bento Grid Design with Beaver Builder's Box Module

Bento Grid Design in WordPress with Beaver Builder’s Box Module

The Bento Grid Design seamlessly combines clean lines, balanced proportions, and intuitive organization, drawing inspiration from Japanese bento boxes. Beaver...

Read More...
The best WordPress online training courses | Beaver Builder blog

10 Best WordPress Training Courses (Updated 2024)

It’s true, you can teach yourself WordPress by learning as you go. There are plenty of blogs, YouTube videos, and…

Read More...

Join the community

We're here for you

There's a thriving community of builders and we'd love for you to join us. Come by and show off a project, network, or ask a question.

Since 2014

Build Your Website in Minutes, Not Months

Join Over 1 Million+ Websites Powered By Beaver Builder.