How To Redirect A Page In WordPress?

Go to Tools Redirection and scroll down to the Add new redirection section. In the Source URL field, type or paste in the URL you want to redirect from. In the Target URL field, type or paste in the URL you want to redirect to.


How do I redirect a WordPress page without plugins?

How To Redirect A Page In WordPress Without A Plugin

  1. Step 1: Get the “From” URL Slug and the “To” URL Slug. Before we get into the code, you need to specifically write down two things:
  2. Step 2: Code in functions. php to Redirect a Page in WordPress.
  3. Step 3: Add More Redirects.

How do I redirect a page?

Page redirection is a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection. To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute.

How do I redirect a WordPress page to another page?

Simply enter a login URL and logout URL into the ‘All Other Users’ section. Then, click the ‘Save Changes’ button. When a new user signs up on your website, WordPress redirects them to the login page. You can set up a redirect URL to send them to any other page on your website.

How do I automatically redirect a Web page?

To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value of the content is the number of seconds; you want the page to redirect after.

How do I redirect to another page after successful login?

To do the redirect, use: header(‘Location:’); Also, please consider my advice.

How do I redirect to another page in HTML?

You need to add ” id attribute” to the section you want to show and use the same id in href attribute with “#” in the anchor tag. So that On click a particular link, you will be redirected to the section that has same id mention in anchor tag.

How do I redirect a page in react?

How to redirect to another page in ReactJS?

  1. Create basic react app.
  2. Make different pages for routing.
  3. Install react-router-dom package.
  4. Implement routing using react-router-dom package.

How do I fix redirect in WordPress?

How to Fix the “Too Many Redirects” Error in WordPress (13 Methods)

  1. Force the Page to Refresh.
  2. Delete Cookies on the Site.
  3. Clear Your WordPress Site or Server Cache.
  4. Clear Your Browser Cache.
  5. Determine the Cause of the Redirect Loop.
  6. Temporarily Disable Your WordPress Plugins.
  7. Check Your WordPress Site Settings.

How do I redirect my WordPress dashboard?

Monitoring URLs for changes is also possible, so redirects can be created automatically should any URLs change. Creating a redirect is pretty straightforward. Once you activate the plugin, go to Tools > Redirection and fill in the blanks under the “add new redirection” section.

How do I create a redirect link?

Click the URL Redirects tab. In the upper right, click Add URL redirect. In the right panel, select the Standard or Flexible redirect type. A standard redirect is used to redirect one URL to another.

How do I create a redirect link in WordPress?

Go to ‘Settings’ in the WordPress admin menu and then click on ‘Website Redirect ‘. Enter the URL you want to redirect the site to, set the desired redirection type, set the status to ‘Enabled’ and save your changes!

How do I fix a website redirect?

How To Fix Too Many Redirects

  1. Clear cookies on the redirecting website.
  2. Clear your browser cache.
  3. Ensure your SSL certificate is installed correctly.
  4. Evaluate your third-party services and plugins.
  5. Reset your htaccess file.
  6. Contact your hosting provider.

How do I redirect one domain to another?

Redirecting a new domain or subdomain (legacy)

  1. Navigate to the Manage Domains page. The Manage Domains page opens.
  2. Click the Add Hosting to a Domain / Sub-Domain button.
  3. Scroll down to the Redirect section.
  4. Enter the information in the following fields:
  5. Click the Redirect this domain button to complete the set up.

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

In the event that you want to make significant changes to your website structure or to transfer it entirely from one host to another, taking the effort to redirect your WordPress pages will save you from having to deal with broken links later on. The purpose of this post is to educate you on what redirects are and why you would want or wish to utilize them. We’ll also go through three different approaches to putting them into action on your website. Let’s get this party started!

Understanding Redirects in WordPress

We refer to the process of mapping one URL to another when we talk about redirects. With this in mind, you may redirect users to Page B instead of Page A when they enter in a URL or click on a link that leads to Page A. Generally speaking, there are five different sorts of redirects that you may use:

  • 301.This form of redirection is irreversible. The page does not appear to exist at the original address, which implies that the original page has been moved. In order to ensure that your search results remain respectable, you should utilize this redirection code: 302. When the requested file exists at the provided location but cannot be discovered for whatever reason, this redirect delivers an alternate page. Due to the fact that this is a temporary redirect that has created issues for some browsers, most site administrators no longer use it
  • 303. This type, which was developed as a substitute for the less-than-helpful 302 redirect, helps protect sensitive data, such as credit card information, from being refreshed or bookmarked on the screen. 307. This redirect is only temporary and is essentially comparable to a 303 redirect in terms of functionality. The main difference between them is that a 307 uses the same technology to broadcast and receive information. A 303 employs two distinct procedures, whereas a 308 employs only one. This sort of redirect, which is related to the 303 and 307 redirects, accomplishes the same job as the others. However, it is permanent, as opposed to being transitory. The majority of its benefits are reserved for programmers rather than regular WordPress users.

Each kind serves a distinct function and has distinct advantages. For the sake of this essay, we’ll concentrate on 301 redirects because they’re the most common form of redirect you’ll face while dealing with WordPress.

Why You Might Need to Use a Redirect in WordPress

There are several types of redirects, some of which may be utilized to help your site and business directly, while others are intended to resolve different technical concerns. Some of the most common reasons why you might require a redirect on your website are as follows:

  • 404 Not Found errors. A page that cannot be found occurs when a user requests a page that cannot be located. This may occur when you relocate a page to a different location, or it may occur simply because a user has put in a URL in the wrong format. Permalink updates are another way to keep lost people interested and amused
  • Bespoke 404 pages may be used to do this. It is possible that changing your WordPress permalinks to something more legible would be beneficial to you. If you modify the default structure of your existing links, you’ll need to set up redirects to ensure that your site visitors don’t receive a 404 error
  • This is known as URL optimization. If your website has been in operation for some time, you can consider reviewing some of your older but still popular pages and articles to determine whether it would be more beneficial to optimize the URLs for mobile usage or readability. Ensure that any bookmarked favorites that your visitors have are updated to point to the new URL throughout this process. Because the directory will change, this will also keep Google pleased. You may need to relocate a directory on your website for a variety of reasons, including general rearrangement or even security concerns. A 301 redirect will assist in ensuring that site visitors continue to arrive at the correct location
  • Search Engine Optimization (SEO). In order to improve your search engine optimization, you should experiment with 301 redirects, whether you’re rebranding your website or simply want greater control over the URLs your visitors view. Consider the scenario in which you want all of the pages on your site to display the exact same URL. Yet another SEO boost is the redirection of all HTTP traffic to HTTPS

There are a few things you should be aware of before you begin redirecting one or more WordPress posts or pages, regardless of your motivations. It’s especially important to think about how you’ll organize your redirects and what Google Page Rank could do with them in advance. For example, it is critical that the page to which a broken link is redirected closely matches the content of the original page being redirected. Otherwise, search engines would evaluate the redirect as if it were a 404 error, which might have a negative impact on your SEO rather than a positive one.

How to Redirect a WordPress Page (3 Ways)

There are a variety of options for redirecting your WordPress pages. We’ll take a look at two different approaches that both entail altering your.htaccessorfunctions.php files. After that, we’ll go through how to set up a 301 redirect with the help of a WordPress plugin.

1. Create Manual Redirects in WordPress Through Your.htaccessFile

It’s likely that the easiest approach to set up a redirect is to change your WordPress files directly, in which case your.htaccessfileis the best option. This file is where WordPress stores and handles all of the permalinks for your site. Changing the contents of your.htaccess file is a good solution whether you want to redirect a single URL or your complete website. To begin, locate the URL you wish to redirect and decide on a new endpoint URL to redirect to. Make a note of the mapping in case you need it later.

Sollten you find any problems, you can always go back to the previous version of your website.

There are a couple different methods to get to it: Using your web host’s control panel, the WordPress file editor, or File Transfer Protocol (FTP) and an FTP client such as FileZilla, you may make the following changes: It is possible that you will have to uncover hidden files in order to examine and change your.htaccess file at some point.

For a single URL redirect, add the following lines at the end of the URL: 301 redirection to /old-page.html Modifyold-page.html to match the old URL in the first line, and in the new URL, adjust the URL to match the target URL in the second line.

To accomplish this, add the following lines to your.htaccess file without making any changes: On the RewriteCond, the RewriteEngine is invoked.

(*) $ Make the necessary modifications to your.htacessfile and save them.

If you made changes to the file on your local machine, don’t forget to upload it to the server hosting your website. You may check your redirect by typing in the URL for your previous page and seeing if you end up at the new location.

2. Edit Your WordPressfunctions.phpFile to Create a Redirect

In addition, you may update the functions.php file in a child theme to provide 301 redirection functionality for your WordPress website. A functions.php file may be found in any WordPress theme folder, and it includes critical code for your website. It is possible to customize the child theme’s functions.php file, which is located in the theme’s root directory. If you alter the functions.php file in a child theme, it is crucial to note that this is because the file in the parent theme can be replaced whenever the parent theme is updated.

Locate the functions.php file in your child theme using one of the similar ways we mentioned for locating the accessing.htaccess file earlier in this article.

Modify the URL to point to the redirect address.

Using a strategicslug structure on your website, you can also redirect some slugs to a different URL with the use of thewp redirect function.

3. Redirect Your WordPress Pages With a Plugin

Don’t be concerned if you don’t want to spend your time slicing and dicing your website files and adding new code strings. There are a variety of additional methods for implementing redirects on your website. As a matter of fact, there are several WordPress redirect plugins accessible that may be less harmful to your site. 301 Redirects – Easy Redirect Manager is a fantastic plugin that can be used to manage redirects. It has an import/export capability that allows you to handle redirection in large quantities.

  1. Another popular and highly regarded tool for this purpose is Redirectionplugin, which is as follows: It serves a similar function to a housekeeper for your website.
  2. Let us help you through the process of using it.
  3. The plugin makes use of Redirection communicates with WordPress over theWordPress REST API; the setup process tests this capability and notifies you if there are any issues.
  4. You’ll find a list of all of your current redirects in this section.
  5. When you’re ready, click the blueAdd Redirectbutton to save your changes.
  6. To keep track of your redirect log and 404 issues, you can also go to ToolsRedirection and utilize the tabs at the top of the screen to go around.

Which method is most appropriate for you will be determined by your scenario and skill level. The following are three ways you might want to consider:

  1. Using your.htaccessfile: This is the most effective method for rerouting the entire site. If you need more in-depth and precise redirection, editing your functions.php file is a better alternative. Installing a plugin is as follows: This feature is very useful for users who are not comfortable modifying core files or who want continual redirect and 404 error monitoring.
You might be interested:  How To Find A Blog On Wordpress? (Best solution)

Is there anything you’d want to know about employing redirects on your WordPress website? Comment below with your ideas.

About Will Morris

Will Morris works as a writer on the WordCandy team. Aside from blogging about WordPress, he enjoys performing his stand-up comedy routine around the local area.

How to Redirect a Page in WordPress

When it comes to WordPress redirects, have you ever pondered how to do it? If this is the case, this post is for you! In it, I’ll go into further detail regarding the rationale for creating WordPress redirects, as well as what they do. We’ll also teach you how to construct them in WordPress, as well as a few other plugins that can make the process of producing them a little easier. Even though there are many different sorts of redirects available, I’ll focus on 301 redirects because they are the most popular and are most likely to be exactly what you need.

What is the 301 redirect?

One of the main reasons why WordPress 301 redirect is necessary because Google crawls the internet on a regular basis, looking for new content as well as changes in existing content. When they crawl your site, if they can’t find what they’re looking for on their first pass, then it will be marked down as a 404 error which means that there were pages found but not enough information was given to satisfy the search engine’s request. This type of error will hurt your SEO rankings and should be avoided at all costs!

And the 301 redirect is a permanent redirect for obviously permanently moving or deleting a page.

Reasons to create a redirect include:

  • Renaming any page or post’s permalinks to make it easier for visitors to find their way to the newly created link
  • You are removing material from your website, and you want to direct visitors to current information if they happen to stumble onto a URL that is no longer functional.

After that, let’s get down to the business of actually generating a redirect in WordPress.

How to create a redirect?

It is possible to go the technical road and build a redirect using your site’s.htaccess file, but there is a more straightforward method to accomplish this, and you guessed it, there are plugins available for this purpose. Here are a few of examples that I’ll walk you through fast so you can decide which one you prefer. You may install redirection plugins directly from the plugin directory accessible from your WordPress dashboard. Simply check for the word “redirect.”

Beginner’s Guide to Creating 301 Redirects in WordPress (Step by Step)

You may be interested in setting up 301 redirects on your WordPress website. In order to resolve 404 page not found issues and guide people to the proper page, 301 redirects are used. It contributes to a more positive user experience as well as an increase in your keyword ranks. 301 redirects are explained in detail in this article, as well as how to implement them on your website.

What is a Redirect in WordPress?

Using a redirect, your website may send a brief message to your reader’s browser informing them that the page they were looking for has been relocated, allowing their browser to instantly route them to the new page of your choosing. It is possible to use numerous forms of redirects, including 301 redirects, 302 redirects, 307 redirects, and so on. 301 redirects are the most crucial type of redirect for your WordPress website, thus we will concentrate on them in this beginner’s guide.

A 301 redirect is a method of relocating a page to a different site permanently. It informs the browser that the page has been permanently relocated to the new site and that we have no plans to relocate it back. After that, let’s have a look at when you should make use of these tools.

When Do You Need a 301 Redirect in WordPress?

A 301 redirect is used when a page on your website or a section of your website has been moved and you want to lead users to a new page instead of the old one. When you intend on removing a post or page in order to make room for fresh material, you must first establish a 301 redirect. It is also required if you intend to change the permalinks of a certain post or page on your website. If you do not configure redirection, your users will be presented with a 404 page not found message. This is not only detrimental to the user experience on your site, but it may also have an influence on your WordPress SEO.

In turn, your domain authority and keyword ranks would suffer a severe decline as a result.

When you utilize them, you may inform search engines and your customers that the webpage that their browser is attempting to access has been permanently relocated.

After that, let’s have a look at the many techniques that you may use to establish 301 redirects in WordPress.

Video Tutorial

Subscribe to WPBeginner’s newsletter. Continue reading if you’d prefer textual instructions instead of audio.

How to Create Redirects in WordPress With Plugins

Using one of the many WordPress redirect plugins makes the process of creating and managing 301 redirects more simpler and less time consuming. This enables you to set up redirects without ever having to write a single line of code in your browser.

1. All in One SEO (AIOSEO)

The All in One SEO (AIOSEO)WordPress plugin is the quickest and most convenient way to manage and implement 301 redirects. More than 2 million professionals use it to boost the SEO of their websites, making it the greatest WordPress SEO plugin available. AIOSEO provides a robust redirection manager plugin that makes it extremely simple to identify broken links on your website and to set up 301 redirections to correct them in a matter of minutes. Please keep in mind that you will require the AIOSEO Pro version in order to utilize the redirection manager.

  • To begin, you must install and activate the AIOSEO Pro plugin on your website’s backend server.
  • Then navigate to All in One SEO » Redirects from your WordPress dashboard and click the ‘Activate Redirects’ button to make sure the redirects are working properly.
  • It is the most straightforward technique of setting redirects, and it does not need any server-side setup.
  • It does, however, necessitate the configuration of Apache or NGINX on your web server.
  • After that, navigate to the ‘Redirect’ option to begin creating 301 redirects.
  • To finish, click Save and then Close.
  • Once you’ve completed the form and input all of the necessary information, click the ‘Add Redirect’ option.

Scrolling down will reveal the logs for each of the redirects you’ve set up.

Aside from that, AIOSEO also assists you in tracking down and fixing 404 problem sites.

Then choose the ‘404 Logs’ and ‘Redirect Logs’ choices from the drop-down menu.

We recommend that you store them for no more than one month in order to maintain smooth and quick server performance.

In the Redirects section, you should now see a new tab labeled ‘404 Logs.’ Click on this to open it.

When you initially activate the 404 logs, however, you will not be able to discover any information.

Once enabled, you may navigate to the 404 Logs area and view the URLs of any broken links you’ve encountered.

Select the 404 error URL you’d want to redirect and then click the ‘Add Redirect’ button to complete the process.

You may now proceed to input your new URL, choose 301 Moved Permanently as your redirection type, and then click the ‘Add Redirect’ button to complete the process.

301 redirects will be created for you by AIOSEO as soon as possible. In order to verify that your redirections are functioning properly, simply navigate to the old URL and see if they redirect you to the new target address.

2. Redirection

Another option for adding and managing redirects in WordPress is to make use of theRedirectionplugin, which can be found here. First and foremost, make sure that the Redirection plugin is installed and active on your site. You may learn how to install a WordPress plugin by reading our comprehensive tutorial. Once the plugin has been active, navigate to Tools » Redirectionand then click the ‘Start Setup’ button to begin configuring it. You may then choose whether to monitor permalink changes in WordPress and whether to keep a log of all your redirects and 404 failures, among other choices.

  1. The Rest API will now be tested by the plugin.
  2. Afterwards, you may go toTools » Redirection » Redirectsand establish the 301 redirects that you require.
  3. However, if you select the gear icon, you’ll be presented with a number of other alternatives for selecting your redirection type.
  4. Following that, select ‘301 – Moved Permanently’ from the dropdown box for the HTTP code choice.

3. Page Links to

Some posts or pages may need to be kept, but they may also need to be redirected to another post or page. Page Links can in helpful in situations like these. This simple plugin adds a meta box to your WordPress editor, where you can input the address of the new URL to which you wish to direct your readers. It is easy to use and install.

4. Simple 301 Redirects

Simple 301 Redirects is another simple-to-use plugin that can be found here. As the name implies, it simplifies the process of creating 301 Redirects. To begin, you’ll need to download, install, and activate the WordPress plugin on your website. If you need assistance, please refer to our article on how to install a WordPress plugin for more information. After that, go toSettings » 301 Redirects and input your old URL in the Request form and your new target URL in the Destination field to complete the process.

While utilizing a WordPress plugin to set up 301 redirects is simple, there are some small speed drawbacks to be aware of.

Making use of the code approach and the.htaccess file will allow you to make your redirection more efficient.

Setting Up 301 Redirects in WordPress using.htaccess

The.htaccessweb server configuration file, which is accessible to WordPress users, may also be used to configure 301 redirects. Please keep in mind that even a little error in your.htaccess code might cause your WordPress site to become unavailable, resulting in the appearance of an Internal Server Error. That is why it is critical that you create a backup of your.htaccess file before making any modifications. Using the All in One SEO plugin, make changes to your.htaccess file. The All in One SEO for WordPress plugin is the quickest and most convenient way to make changes to your WordPress.htaccess file.

  • In order to complete the process, you must visit theAll in One SEO » Toolspage and choose the.htaccess Editor option.
  • You may simply enter any redirect code that you like to include at the bottom of the webpage.
  • On Redirect 301 /a-very-old-post/, RewriteEngine is used.
  • The All in One SEO plugin will next make the necessary changes to your.htaccess file.
  • You may also make changes directly to your WordPress.htaccess file if you need to set up any redirects.
  • The.htaccess file is located in the root directory of your WordPress website.
  • For further information, see Why you can’t find the.htaccess file on your WordPress site.

Here is a straightforward redirection in which we are attempting to move a user who has arrived at an old post to a new one.

Remember to save your modifications and re-upload your.htaccess file to the server when you’re finished.

We hope that our beginner’s guide to setting up WordPress redirects was helpful in setting up redirects on your site or blog.

We encourage you to subscribe to our YouTube Channel for more WordPress video tutorials if you enjoyed this post.

Please be aware that our material is sponsored by our readers.

See how WPBeginner is supported, why it is important, and how you can help us by donating. The Editorial Staff at WPBeginner is a group of WordPress specialists, lead by Syed Balkhi, who provides guidance and support. Over 1.3 million readers around the world put their trust in us.


Take note that wp redirect() does not automatically exit, and that it should nearly always be followed by the command exit;:wp redirect($url); exit It is also possible to control exiting by using the conditional function wp redirect() in combination with the wp redirect’ and wp redirect location’filters, as seen below: if (wp redirect($url)) then exit; if (wp redirect($url)) then exit; a b c d


$location(string)(Required) The route or URL to which the redirect should be directed. To utilize the HTTP response status code, pass in $status(int)(optional). The default value is ‘302’. (Moved Temporarily). 302 is the default value. $x redirect by(string)(Optional) The program that is performing the redirection. ‘WordPress’ is the default value.Top


(bool)False if the redirection was canceled, and true if it was successful. a b c d


File:wp-includes/pluggable.php function wp redirect($location, $status = 302, $x redirect by = ‘WordPress’) is a function that redirects to another page. $is IIS is a global variable. *** This filter determines where the reroute will take place. **Since version 2.1.0** $location is a string that is sent as a parameter. The route or URL to which the redirect should be directed. * @param int$status The current state of the int$status variable. The HTTP response status code that should be utilized.

  1. ** Since version 2.3.0** @param int$status The current state of the int$status variable.
  2. * $location is a string that is sent as a parameter.
  3. **if (!
  4. $status) return false; */$status = apply filters(‘wp redirect status’, $status, $location); ($status300 ||

399) $status) wp die( (‘HTTP redirect status code must be a redirection code, 3xx.’);wp die( (‘HTTP redirect status code must be a redirection code, 3xx.’);wp die( (‘HTTP redirect status code must be a redirection code, 3xx.’);wp die( (‘HTTP redirect status code must be a redirection code, 3xx.’); $location = wp sanitize redirect($location);if (!

You might be interested:  How To Add A Sub Page In Wordpress? (Perfect answer)

@param string $x redirect by The name of the application that is doing the redirect.

@param string The string to use as a parameter.

When $x redirect by is equal to apply filters(‘x redirect by’, $x redirect by, $status, $location); if (is string($x redirect by)) is true, the redirection is successful.

header(“X-Redirect-By: $x redirect by”);header(“Location: $location”, true, $status);return true;header(“X-Redirect-By: $x redirect by”);header(“X-Redirect-By: $x redirect by”); Obtain the whole source code Full source code should be collapsed. on GitHubTop, you can see TracView in action.


Version Description
5.4.0 On invalid status codes,wp_die()is called.
5.1.0 The$x_redirect_byparameter was added.
1.5.1 Introduced.

User Contributed NotesUser Contributed Notes

Do you wish to redirect a page on your website using a way that is user-friendly for beginners? We’ve taken care of everything. Using this tutorial, you will learn how to redirect a WordPress page, both with and without the use of plugins.

Types of Redirect in WordPress

There are several forms of redirections, including:

  • 301: This is the most often used type of redirection. Permanent redirection is another term for this technique. This form of redirection will notify search engines that the target page has been relocated permanently, and they will pass along all of the link advantages associated with the redirection. This may provide the new destination link with greater ranking prospects
  • However, this is not guaranteed. 302: This is a temporary redirection code that can be utilized. It informs search engines that the destination link has changed for a brief period of time, but not permanently. In terms of link juice and ranking, we shouldn’t expect to see much of a difference with this redirection
  • Redirections with the code 303 are also known as “See Other” redirections, because they signal that a page has been temporarily changed and is now available at a new address. This sort of redirection is most commonly used on a page that has a payment form or on a page that contains personal data. The advantage of using a 303 redirect is that the website administrator can block the page from reloading
  • However, this is not recommended. 307: This redirection is identical to 303, however it is referred to as a ” Temporary Redirect ” instead of ” Permanent Redirect “. It indicates that the page the user is attempting to access has been temporarily relocated to a new URL
  • 308: This is another form of permanent redirect, and it is used in conjunction with 301. As we’ll see later in the essay, these sorts of redirects are a smart choice when you’re redesigning your website or transferring it from HTTP to HTTPS.

With a better understanding of the various sorts of redirects, let’s have a look at the advantages of redirecting a page on the WordPress platform.

Why Redirect a WordPress Page?

There are a variety of circumstances in which you may need to redirect a WordPress page, including:

  • A change in primary domain name will result in all internal links going to the old domain and posts if you have changed your primary domain name. The most effective method of dealing with this scenario is to put up a redirection
  • Improve your SEO by doing the following: Online companies rely on search engine optimization (SEO) to increase sales, conversions, and income. If your permalink isn’t optimized for search engines, you should change it. When you make changes to a permalink, you must create a redirection so that users do not see a 404 not found page on the front end of the website. You have removed the following pages: It is not a good practice to delete pages that have been ranked in search engines. Furthermore, if you are removing already published pages or posts, you must establish a redirection so that readers do not receive a 404 page. It is necessary to update the following page: When you redesign a page or conduct an A/B test, you have the choice of enabling maintenance mode or configuring the redirection feature. In order to avoid displaying visitors an under-construction page, it is a good practice to show them content instead. Offering limited-time discounts as a marketing strategy: If you run a WooCommerce store and sell both physical and digital items, you may want to consider offering limited-time bargains as part of your marketing plan. You are not required to maintain the page once the transaction has concluded. As an alternative to removing it, we propose that you redirect the page to the original product page instead.

Regardless matter how hard you try and how many redirects you set up, your users will eventually land up on a 404 page on your site at some time. You should personalize it in order to get the most out of it. For further information on how to alter the 404 page in WordPress, see our article on how to edit the 404 page in WordPress. Now that you understand why redirecting a WordPress page is a smart practice, let’s have a look at how to accomplish it.

How to Redirect a WordPress Page

It is possible to redirect a WordPress page using one of two methods:

  1. With plugins (for beginners)
  2. Programmatically (for more experienced users)

Let’s have a look at both of them so you can decide which way you prefer from the options listed below.

1) Redirect a WordPress page with plugins

In order to personalize a WordPress installation, plugins are the most effective and easy method available. Check out Redirection if you’re seeking for a tool to redirect your web pages. It is one of the most often used redirection plugins, and it is also completely free.

1.1) Install Redirection

First and foremost, install the plugin. Go to PluginsAdd New in your WordPress dashboard and type in Redirection to find the plugin. Once you’ve located the plugin, you’ll need to install and activate it. Following that, you will be able to access the plugin’s settings through the WordPress Tools area.

1.2) Set it up

The settings page provides detailed instructions on how to use the plugin as well as a description of some of its most beneficial features. After you’ve finished reading it, click on theStart Setupbutton. Afterwards, you’ll notice some basic configuration choices for permalinks, a log of all redirects and 404 errors, and the IP addresses of the people who made the redirects and 404 errors, among other things. Choose the choices you desire and then click on “Continue Setup.” The REST API capability will now be tested by the plugin.

1.3) Start using Redirection

Following that, you will be presented with the plugin’s dashboard, which is divided into two sections: For the sake of this lesson, we shall create a new redirection. To create a redirection, you’ll need the following items: Consider the following example: if you need to redirect traffic from your old site, the source URL should be used, but the destination URL should contain the new URL (). You are not required to put your domain name in the submit box. As an alternative, you may simply enter the section of the URL that comes after the /, which can serve as the page’s permalink.

  • You will be able to set up whatever redirection you choose in this manner.
  • You can, for example, select the sort of reroute you want.
  • Once you’re finished, save the modifications, and you’ll be able to view all of the redirected URLs, as well as their HTTP code and URL visits, in the dashboard.
  • Fortunately, as you can see, this straightforward solution allows you to redirect a WordPress website in a matter of seconds.

If, on the other hand, you make use of an SEO plugin such as Rank Math, you will have the redirection option built right in. The redirection option is included by default in the majority of SEO plugins. To enable or disable the plugin, just navigate to the plugin’s settings page/modules.

2) Redirect a page programmatically

If you don’t want to use third-party solutions and are comfortable with scripting, there is another option for redirecting your sites. Using the functions.php and.htaccess files, we will demonstrate how to redirect WordPress pages in this portion of the tutorial. NOTE:Because we will be editing some theme files as well as WordPress core files, we recommend that you create a complete website backup before to continuing with this procedure. If you are unsure of how to generate a backup, please refer to our step-by-step tutorial.

You may either design one from scratch or make use of a specialized plugin.

2.1) Functions.php file

We’ll utilize a site-specific plugin called Code Snippets to make changes to ourfunctions.php file. It is one of the greatest tools available for this sort of work, and it is completely free. Installing and activating the plugin on your website is the first step. To create a new snippet, go to the plugin’s settings and selectAdd New from the drop-down menu. Create a name for your snippet and then paste the following snippet into your document. quadlayers redirect is a function () else $currenturl = $protocol.

$_SERVER; $currenturl relative = wp make link relative($currenturl); $currenturl relative = wp make link relative($currenturl); add action(‘template redirect’, ‘quadlayers redirect’); if ($currenturl relative!= $urlto) exit(wp redirect($urlto); if ($currenturl!= $urlto) switch ($currenturl relative)if ($currenturl!= $urlto)

Customizing the snippet

To better understand what the code is doing, let’s take a closer look at it. To add a redirection, we’re using a function called quadlayers redirect(), and we’re using theHTTPSprotocol whenever possible, as you can see in the code below. The next part is something you should double-check: switch ($currenturl relative) is used to switch between two URLs. Those are the old and new slugs, respectively. These values will be used as your from and to URLs, therefore you should make sure they are customized.

and the corresponding to would be/blog/tips.


Then you should activate the snippet.

Adding multiple redirections

In the preceding section, we demonstrated how to redirect a page in WordPress. The question arises, though, when you wish to include several redirections on your website. By putting an if conditional in the snippet, you may include a number of different alternatives. Take, for example, the following extract from the text: Case ‘/first-url’: $urlto = home url(‘/first-to’); break; case ‘/second-url’: $urlto = home url(‘/second-to’); break; case ‘/third-url’: $urlto = home url(‘/third-to’); break; You may incorporate this information into the original snippet as follows: quadlayers redirect is a function () else $currenturl = $protocol.

$_SERVER; $currenturl = $protocol.

$_SERVER; switch($currenturl);wp make link relative($currenturl);switch ($currenturl relative) $currenturl relative = wp make link relative($currenturl);$currenturl relative case ‘/blogging-tips’: $urlto = home url(‘/blog/tips’); break; case ‘/second-url’: $urlto = home url(‘/second-to’); break; case ‘/third-url’: $urlto = home url(‘/third-to’); break; default: return; case ‘/first-url’: $urlto = home url(‘/first-to’); if ($currenturl!= $urlto) exit(wp redirect($urlto)); add action(‘template redirect’, ‘quadlayers redirect’); if ($currenturl!= $urlto) exit(wp redirect($urlto)); After making changes to the snippet, make sure to update it.

You may then use the Code Snippets plugin to redirect a WordPress page in this manner, if desired. Let’s have a look at how to accomplish the same thing using the htaccess file.

2.2).htaccess File

It is recommended that you download the.htaccess file to your local computer and keep a hard copy of it before editing it. The.htaccess file is one of the most important files for any WordPress installation, so we recommend that you download it to your local computer and keep a hard copy of it as well. The.htaccessfile approach will be used to redirect a WordPress page, which will be demonstrated next. To begin, you must get access to the.htaccessfile. This may be accomplished through the use of an FTP client such as FileZilla or through the use of a dedicated file manager.

Alternatively, if you do not have access to the site, are locked out, or do not want to install third-party programs, you can use the FTP approach.

Installing and activating the plugin

In this lesson, we will be utilizing a plugin referred to as File Manager. Simply go to yourdashboardPluginsAdd New, search for the plugin, install it, then activate it by following the on-screen instructions. After activation, launch the plugin and you will be able to access the settings from the left-hand navigation menu. By default, the.htaccessfile will be found in the WordPress core directory. As previously said, it is recommended that you download the file before proceeding with the procedure.

Editing the.htaccess file

Now, the plugin will begin downloading the file to your local computer’s hard drive. Afterwards, click on theCode Editorbutton to begin modifying and changing the.htaccess file. Copy the code below and paste it on your website to create a 301 redirection. 301 redirection to /old-url As soon as a visitor arrives at theold-url(permalink), they will be automatically routed to thenew-url (slug). Simply modify the code to meet your own needs and requirements. The use of ifconditionals, in a manner similar to what we saw earlier, allows you to include numerous redirection alternatives.

That’s all there is to it!

You may test it by going to the old URL in your browser and inputting it in an incognito window.

Bonus: How to Redirect HTTP and WWW to HTTPS

It is recommended that HTTP or WWW traffic be redirected to HTTPS wherever available. By employing the HTTPS protocol, you can ensure that all web traffic that comes into your site is encrypted, therefore adding an additional degree of protection to your website. An SSL certificate is required in order to use the HTTPS protocol. When you sign up for one of their plans, the majority of web hosting companies will provide you with a free SSL certificate powered by Let’s Encrypt.

A CDN (Content Delivery Network) such as Cloudflare, on the other hand, will provide you with a free SSL certificate that will automatically renew if you use it for speed optimization. Using two alternative ways, we’ll demonstrate how to redirect HTTP and WWW traffic to HTTPS in this section.

1) Cloudflare

Cloudflare is a content delivery network (CDN) service utilized by millions of blogs and businesses worldwide. The good news is that if you are using Cloudflare and you need to transfer all website traffic to HTTPS, you won’t need to use any additional technologies to do this. To begin, go into your Cloudflare account and, from the dashboard, pick the website that needs to be modified. 2. Once you’ve selected the SSL/TLS option, double-check to see that the SSL certificate for your domain has been enabled.

  • Continue to scroll down until you see theAlways Use HTTPSoption.
  • That’s all there is to it!
  • This is an example of how you can use Cloudflare to reroute traffic.
  • If you have any questions or want extra assistance, you should contact Cloudflare’s support staff.

2) Coding Method

In this part, we’ll go through how to manually reroute your traffic if you’re not utilizing a content delivery network (CDN). In this section, we will demonstrate how to convert HTTP visitors to HTTPS using snippets of code. In order to accomplish this, we will change the.htaccess file. If you followed the procedures we outlined above, you should already be aware of where to look for and change the.htaccess file. Once you’ve located the.htaccessfile, copy and paste the code from below into it.

  • RewriteRule (.*) is discounted by percent.
  • If that line already exists in your.htaccess file, you do not need to include it.
  • That’s all there is to it!
  • Check to be that your domain has a current SSL certificate installed before proceeding with this step.
You might be interested:  Where Is Functions.Php In Wordpress? (TOP 5 Tips)

How to Fix the Mixed Content Error

After you have completed the migration of your website from HTTP to HTTPS, you may see certain mixed content issues in the website’s front end. This is most likely to happen if your website is providing files using both the HTTP and HTTPS protocols at the same time. If you are having this problem, we have a fast fix for you. Please see below. Mixed content problems may be corrected with the help of the free Really Simple SSL plugin. Installing and activating the plugin will take place after you’ve reached your WordPress dashboard.

Generally speaking, it should be enabled by default, but it’s always worth checking to make sure it’s working properly. That’s all there is to it! The mixed content warnings will be removed as a result of this.


In summary, there are several sorts of redirections, each of which performs a particular role and can be either temporary or permanent in nature. When it comes to the following conditions, redirections are critical:

  • When you changed your domain name, you should notify us. If you want to boost your search engine optimization
  • When you have made changes to your website and eliminated certain pages
  • A page needs to be updated
  • There is one such page. When you conduct sales that are only available for a limited period

In this lesson, we’ve covered the two most common methods for redirecting a WordPress page: Because the plugin technique is basic, it is ideal for novices to learn. For those who are more comfortable with coding, you may also set up redirections using a programmatic approach. Finally, we looked at how to redirect the WWW and HTTP to HTTPS in order to make your site more secure, as well as how to solve mixed content issues. Is it true that you’ve begun diverting pages on your website? So, which way do you favor the most?

How To Redirect A Page In WordPress Without A Plugin

Allow us to assume that when reviewing your Google search console data, you discover that some people have clicked through to a non-existent page on your website that looks something like this: No, not at all! A poor user experience leads in a quick return to the search results, as well as a likely signal to Google that your site isn’t providing users with what they’ve come to expect. The problem is that such pages do not even exist on your website, which is a red flag. Alternatively, they used to exist but are no longer in existence.

  1. What are we going to do about it?
  2. If it doesn’t already exist, make it happen!
  3. You must take advantage of the situation.
  4. That is not a bad concept in and of itself, but it is overkill if you only want to redirect one or two pages at the most.
  5. Either through the use of your functions.php file located in your themes directory, or through the use of a PHP code insertor.

Step 1: Get the “From” URL Slug and the “To” URL Slug

It is necessary to expressly jot down two things before we begin working with the code.

  1. How to determine which URLs need to be redirected
  2. How to determine which URLs visitors should visit

The following section contains a number of roadblocks. To begin, examine your website’s URLs to see if they have a “trailing slash” or not. To put it another way, are you this: or something like In order to redirect a page in WordPress, we’re going to use code to match strings together. It is critical that you understand how your URLs are constructed in their entirety. Once you have the URLs, you can start creating the URLslugs for each. The “slug” is the component of the URL that does not contain the domain name, or(orIn the example above, the slug will be: /test-page In the same way, if your URL is;the slug will be:/05/18/some-page Take note of the first slash “/” that appears in front of the slug.

Why Use Slugs and Not URLs?

There’s a simple rationale for this, in case you’re wondering why we don’t just use a basic URL matching. We want to protect ourselves from any future developments that may occur. Perhaps you’ll build a subdomain for a certain page or relocate your blog to a different directory. Perhaps you’re now utilizing the HTTP protocol and would like to switch to HTTPS in the future. All of your efforts to match the URL will fail if you do not include the slug since the first section of the URL is changing.

The slug is here to stay!

Step 2: Code in functions.php to Redirect a Page in WordPress

The second step is to open the “functions.php” file, which can be found in your theme’s root directory (preferably a child theme). Now, copy and paste the following code into the box: redirect page is a function () If (isset($ SERVER) ($_SERVER= ‘on’ || $_SERVER= 1) || isset($ SERVER) $_SERVER=’$ SERVER=’if (isset($ SERVER) ($_SERVER= ‘on’ || $_SERVER= 1) || isset($ SERVER) $_SERVER=’if (isset($ SERVER if $protocol is not equal to ‘ $currenturl = $protocol. $_SERVER. $_SERVER; $currenturl relative = wp make link relative($currenturl); $currenturl relative = wp make link relative($currenturl); switch ($currenturl relative) is used to switch between two URLs.

For example, this one: case ‘: $urlto = home url (‘); break; This is where you insert your “from” and “to” slugs.

Save your modifications, and now when you visit the “from” page, you should be routed to the “to” page.

Step 3: Add More Redirects

Because I’ve organized the code in such a manner that you can quickly add more redirections if you so choose, you should have no trouble doing so. Simply add a new section like this under the previous one for each new redirection: case “: $urlto = home url (“); break;case “: $urlto = home url (“); break;case “: $urlto = home url (“); break; You should be alright as long as you remember to maintain the line “default” after all of these “case” blocks in place. You may now redirect as many pages as you want to other sites without the need to need a WordPress plugin to do this!

Since 2008, I’ve worked in the entertainment sector.

You may get out to me through my website,!

Beginners guide on how to redirect a page in WordPress

Whether you’re attempting to redirect a page in WordPress or simply want to learn more about it and why it’s essential, this article will assist you in getting ahead of the game and learning everything there is to know. We will all find ourselves in a scenario where we need to redirect a post or a page on our WordPress blog or website at some point in our lives. And to ensure that you are well prepared for when the time comes, here is all you need to know about it and conduct it on your own.

Being aware of things like this not only helps you understand how things surrounding your site operate, but it also helps you learn more about how to be more visible online and perform better in search engine optimization.

What is a WordPress redirect, and why do we need it?

Remember when you were searching for something and instead of getting a result, you got a 404 error page or anything along those lines? Broken links like that, for one, are detrimental to SEO since they signal to Google that something is wrong with the site, which is especially true if there are many broken links on the same page. Second, it is poor user experience (UX) practice, not to mention that consumers will leave the site in greater numbers if there are broken links, resulting in a larger bounce rate.

Top-Rated Web Hosting Meks has suggested this website.

How to look for broken links?

If you’re encountering this sort of issue for the first time and aren’t sure where to turn, here’s what you should do. Take a peek at the coverage by going to theGoogle Search Console. It is here that you will be able to observe any technical troubles your site is experiencing, as well as any broken links on it. If this is the case, you’ll need to implement a redirect to ensure that you don’t lose traffic or rankings.

What are some other reasons to redirect a page in WordPress?

Aside from broken links, there are a few other instances that need the use of this specific operation. To mention a few of the most often encountered:

  • Changing the permalinks on your website
  • Outdated material is being deleted or replaced with fresh stuff
  • Changing the url of a page or post to another link
  • Bringing two websites together
  • Changing to a different domain

Five types of redirects

Regardless of whether you are using WordPress or another content management system, there are numerous sorts of redirection to evaluate and pick from, depending on your end activities. You should be familiar with them so that you can determine which one to utilize and why. 301 This page has been moved permanently. This is the one you use when you’re completely removing a page or a post and you want to redirect visitors to another, more relevant place instead. 302 results were found It was formerly known as a Temporary Redirect, and it informs search engines that your article or a page has been temporarily relocated without providing any other information.

  1. However, it’s useful to know.
  2. In this case, the server is notifying the user agent that it is redirecting the user agent to a different resource.
  3. 307 Temporary Redirection to another page It works in a similar way to 302 redirects, with the tiny distinction being that it really delivers you to the other temporary location.
  4. The distinction between the two is as follows:
  • An HTTP 301 status code indicates that all future requests should be routed to the specified URL, whereas an HTTP 308 status code indicates that all future requests should be sent to an alternate URL.

Two ways to redirect a page in WordPress

Now, assuming none of this has daunted you (and it shouldn’t, because it’s not difficult), here’s how to implement redirects on your website. There are two methods for accomplishing this: manually and via the use of a Plugin. Read up on it and decide which option is best for you. But keep in mind that you should always make a backup of your site before implementing any type of redirection. Isn’t it better to be cautious than sorry?

How to redirect a page in WordPress manually

Manually redirecting a page will be a piece of cake if you are familiar with HTML and CSS codes. To establish a redirect through a server, you’ll need to log in through FTP and view your.htaccess file, which you’ll need to alter by adding the following piece of code:


That’s all there is to it. Please keep in mind that this method only works if you are using an Apache web server.

How to redirect a page in WordPress with a plugin

For some, using a plugin to fix redirection in WordPress may be a faster and more convenient method, which is why we propose the following plugins.

301 Redirects

301 and 302 redirection are taken care of by a free WordPress plugin that is available here. This is a straightforward plugin that is simple to install and use, regardless of whether your site is new. Upon installation, click on the Configure Redirects link or navigate to the dashboard inside the Settings to make the following changes to your redirects: to view a larger version of the image It’s as simple as selecting the appropriate status code, entering the old URL and the new URL you wish to redirect it to, and clicking Save.

All In One Redirection

Another handy and free WordPress plugin that allows you to manage and generate redirections is Redirection Manager. The usage of this plugin will allow you to move a post, a page, or even a whole website to a different place. In the case of the redirection from HTTP to HTTPS, Simply download and install it, then navigate to the Settings menu to add and configure new redirecting: to view a larger version of the image Apart from that, All In One Redirection includes some other interesting characteristics, such as:

  • Logs of all redirected URLs in their entirety
  • Tracking of 404 error pages automatically
  • Redirection on a customized basis
  • Remove the URL redirection option from the menu


A free WordPress plugin called Redirection allows you to handle 301 redirections while also keeping track of 404 problems all in one place. What is the best way to utilize it? When you have finished setting up, you should do the following: to view a larger version of the image larger photos may be viewed by clicking on them To put it another way, you need to decide on a source URL / the old / and a destination URL / the new / and then start the redirection process. That’s all there is to it! to view a larger version of the image Among the other features are the following:

  • Monitor 404 errors, gather extensive information on the visitor, and resolve any issues that may arise. It is possible to import data from.htaccess files, CSV files, and a number of other plugins
  • Improved URL matching, incorporating regular expressions and other criteria
  • More powerful URL matching
  • Verify that a URL is being redirected.

SEO Redirection

This freemium plugin not only takes care of 301, 307, and 306 status code redirections, but it also takes care of the following:

  • Full logs for all rerouted URLs are kept on file. Supports redirection using wildcards
  • Access to the index.php, index.html, and index.htm pages should be redirected. Is it GDPR compliant, and so much more

You may use it to set up a Post or Custom redirect, as well as to keep track of your redirect history: to view a larger version of the image The premium edition contains additional features such as:

  • Manage 404 errors
  • Redirect cache
  • Manage 404 errors Auto redirects are enabled when a change in a post’s URL is detected
  • Import and export redirects are also enabled. Supports all post kinds, as well as others

The cost of premium SEO Redirection is $29 per month.

Yoast SEO

As you may be aware, Yoast SEO started off as a free WordPress SEO plugin. However, the premium edition has several sophisticated features, one of which is a Redirect manager, which allows you to build and manage redirects on your website. to view a larger version of the image Consequently, if you alter your URL, delete an old post or a page – instead of receiving a 404 error page, the plugin will alert you to the need to convert it into an appropriately redirect. Bringing everything to a close You are now aware of the situation.

Once again, let us highlight the need of regularly backing up your website before making any changes to it.

WordPress plugins, WordPress tips, SEO tips, WordPress plugins, SEO tips

Leave a Comment

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