Do you want to create 301 redirects on your WordPress website? When someone visits your site using an old link to a moved page, the 301 redirect automatically takes them to the new page so they don’t see the 404 “page not found” error. This provides a better user experience and will also improve your keyword ranking.

in this article, we will show you how to create 301redirects in WordPress. The

guide-to-create-301-redirects-in-wordpress-og

using .htaccess what is a redirect in WordPress?

redirection is a way for your WordPress site to automatically send users to a new address when the page they want to visit is moved or replaced. This is similar to the way the post office redirects messages when you move. There are many types of

redirects, which are identified by numbers such as 301,302 and 307. When a user tries to visit a page that does not exist, they automatically point the user’s Web browser to a different URL.

in the beginner’s guide, we will focus on 301redirects because they are the most important types. They tell the browser that the page has been permanently moved to a new location and that you do not intend to move it back.

, that is, let’s see when we should use 301redirection. When does

need to redirect 301s in WordPress? The main reason

uses 301redirection is that when your site or a page on your site has moved, you want to point the user to a new page.

you also need it when you plan to change the permanent link to a post or page.

if you do not set the redirection, it will cause your users to see a 404 error when they cannot find the page. This provides a poor user experience and can affect your WordPress SEO.

303wpbeginner404page

if you have many broken links on your site, you may also lose valuable backlinks. This will result in a significant decline in your domain permissions and keyword rankings.

this is why the 301redirection is so important. They allow you to tell search engines and your users that the page they are trying to visit has been permanently moved to a new location. Like

, all traffic and backlinks from your old page will be transferred to the new page.

now, let’s look at how to create 301redirects in WordPress. We’ll show you how to do this easily using multiple WordPress redirect plug-ins and manually using code.

  • method 1: use AIOSEO plug-in to create 301 redirect
  • method 2: use redirect plug-in to create 301 redirect
  • method 3: use simple 301 redirect plug-in to create 301 redirect
  • method 4: redirect existing pages with page links to plug-in
  • method 5: manually create 301 redirect

method using .htaccess method 1: use AIOSEO plug-in to create 301 redirect The easiest way to direct

management and create 301redirects is through the All in One SEO (AIOSEO) WordPress plug-in. It is the best SEO plugin for WordPress, and more than 2 million professionals use it to improve the SEO of their websites.

AIOSEO provides a powerful redirect manager plug-in that makes it easy to find broken links on your site and set 301redirects to fix them.

Note: you need AIOSEO Pro to use the redirect manager. There is also a free version of AIOSEO, but it does not include 301 redirects.

first, you need to install and configure the AIOSEO Pro plug-in on your website. For more information, see our step-by-step guide on how to set up the all-in-one SEO correctly. After the

plug-in is activated, you need to go to “All in One SEO »Redirects” on the WordPress dashboard and click the “Activate Redirects” button.

303aioseoactivateredirects

next, you can click the Settings tab and select “PHP” as the redirect method.

this is the easiest way to create redirects and does not require any server-side configuration.

303aioseosettingsphp

AIOSEO also allows you to select the Web server redirection method. However, it requires either Apache or NGINX to be configured on your Web server. This requires technical knowledge and is not recommended for beginners.

Create 301 redirection

you are now ready to create 301redirects. To get started, go to the Redirect tab.

first, you need to enter the link you want to redirect in the source URL field. You should then enter the new destination of the link in the destination URL field.

303aioseo301redirect

now ensures that the redirection type is 301 permanent move, and then click the add Redirection button.

if you want to redirect multiple URL to a new location, simply click the add URL button under the Source URL field.

next, you can scroll down to see the redirect log you created. It shows the number of people who visit the redirect link under the Click column, as well as the toggle option to enable or disable a single ​​ redirect.

303aioseoredirectlog

Add 301 redirection to fix 404 error

AIOSEO can also help you track 404 error pages and fix them.

to turn on this option, you must scroll down to the Redirect Log section of the Settings tab. Then enable the 404 log and redirect log options.

you can also choose to keep the log for a period of time. We recommend that you keep them for up to one month to ensure smooth and fast server performance.

303aioseosettingslogs

When these options are enabled, be sure to click the Save changes button.

you should now see a new 404 Log tab in the redirect section. This is where AIOSEO will track and display your broken links and allow you to set redirects. You will also see the number of visits to the link and the date and time of your last visit under “Click”.

303aioseo404logs

Note: when you first enable 404 logging, you will not find any data. The plug-in starts logging 404 error pages only after the settings are enabled. Next, click the “add redirection” link next to the

error URL you want to redirect. This is not the button at the bottom.

you will now see the option to enter the target URL and select the redirect type from the drop-down menu.

303aioaseoredirectinga404error

continues and enters your new URL and selects “permanent move” as your redirection type. You should now click the add Redirect button.

AIOSEO will now create 301redirects for the links you broke. To see if the redirection is working properly, simply visit the old URL to check that you are being taken to the new destination.

Add 301 redirects directly from posts or pages

AIOSEO also allows you to redirect a post or page when you edit it.

if you scroll to the bottom of the page in the WordPress editor, you will find an AIOSEO settings section. You need to click the Redirect tab. The

303aioseoredirectfrompost

source URL has been filled in for you. Simply enter the new URL in the Target URL field and select 301 permanent move from the Redirect Type drop-down menu.

in addition, if you change the permanent link of a post while editing, AIOSEO will provide the ability to redirect the old URL to the new URL.

either way, click the add Redirect button to complete.

Redirect the full site

if you move the site to a new domain name, your visitors may encounter a broken link and your website SEO may be affected.

you can use AIOSEO to move your entire site to a new location without losing traffic or search engine rankings. This is a complete site 301 redirect. It is important that

303aioseofullsiteredirect

do this in the right way, so we have created a step-by-step beginner’s guide on how to use WordPress for complete site redirection.

method 2: another way to use the redirect plug-in to create a 301 redirect

to add and manage redirects in WordPress is to use the redirect plug-in.

first, you need to install and activate the plug-in. You can follow our detailed instructions on how to install the WordPress plug-in.

Note: although it is easy to set up 301redirects using the WordPress plug-in, it has some minor performance problems. Depending on your WordPress managed service provider, your redirection may be a few microseconds slower than other methods.

if you want to redirect as quickly as possible, you can do so by editing the .htaccess file using method 5 below. After

is activated, access the tool »redirect, and then click the start setup button. Next, you can select the option to monitor persistent link changes in WordPress and log all redirects and

303redirectionstartsetup

errors.

you just need to enable these options and click the continue setup button.

303redirectionbasicsetup-1

the plug-in will now automatically test Rest API.

when the state returns to good, continue and click the finish setup button. The

303redirectionrestapi

redirect plug-in will perform more tasks to complete its setup. When the progress bar reaches 100%, you can click the continue button, and then click the ready to start button.

the plug-in is now ready for you to create 301redirects. First, navigate to the tools »redirection section of the WordPress panel. You should check the add New Redirection section at the bottom of the screen.

303redirectionaddnewredirection-1

you will see the basic settings for adding redirects. However, if you click the gear icon, you will see more options to select your redirection type.

simply enters the source URL of the old page and adds the “destination URL” to redirect to. You should also make sure that the HTTP code option is set to 301-permanent move. After

303redirectionaddinga301redirect

has entered all the details, continue and click the add Redirection button.

method 3: one of the easiest ways to create a 301 redirect

using a simple 301 redirect plug-in is to use the Simple 301 Redirects plug-in. As the name implies, it makes 301 redirection very simple.

first, you must install and activate the plug-in on your website. After

, you need to access the settings »301 redirection. Here, you can enter the old URL in the request field and your target URL in the destination field. When the

303simple301redirects

is complete, click the add New button to create the 301redirection. okay.

‘s simple 301 redirection will start working immediately.

method 4: redirect an existing page with a page link to the plug-in

sometimes, you may want to keep the post in the feed of the site or list the page on the site in some way, but host the content elsewhere. This is where page links to plug-ins come in handy. After

installs and activates the plug-in, it adds a meta box to your WordPress editor. Here you can enter the address of the new location to which you want to send the user.

303pagelinksto

when you press Update or publish, WordPress will process posts or pages as usual, but when someone visits it, they will be redirected to the custom URL of your choice.

for example, you might have a blog that occasionally creates downloadable content, but you want users on online store sites to treat certain posts as products. You can use this plug-in to do this without risking repetitive content from Google or splitting your user base.

Method 5: manually create 301redirects using .htaccess

WordPress users can also set 301redirects by editing the .htaccess Web server configuration file.

remember that a small error in your .htaccess code may make your WordPress site inaccessible and may start to display Internal Server Error.

this is why it is important to back up .htaccess files before making any changes.

Use the All in One SEO plug-in to edit your .htaccess file

if you have installed the All in One SEO plug-in, it provides an easy way to edit your .htaccess file.

Note: you need All in One SEO Pro to use the .htaccess editor.

just needs to visit the All in One SEO »Tools page and switch to the .htaccess Editor tab.

303aioseohtaccess

from here, you will see the contents of the .htaccess file in the editor. You can simply put any redirection code you want to add at the bottom, after the “# END WordPress” line.

this is a simple redirect, we are trying to send users who visit old posts to new posts.

RewriteEngine OnRedirect 301 /a-very-old-post/ http://yoursite.com/a-very-new-post/

Don’t forget to change the old post and the new post URL. When you are finished, click the Save changes button to store your settings, and All in One SEO will update your .htaccess file.

Edit your WordPress .htaccess file directly

you can also edit the WordPress .htaccess file directly to set any redirects.

to edit the .htaccess file, you need to connect to your Web site using the FTP client. The .htaccess file is located in the root directory of your WordPress site.

if you can’t see the .htaccess file, please refer to our guide to see why you can’t find the .htaccess file on the WordPress website.

you can download .htaccess to your computer and edit it using a text editor such as notepad.

you can use the following redirection code to send users who visit old posts to new posts. You should paste the code to the end of the .htaccess file, after the “# END WordPress” line.

RewriteEngine OnRedirect 301 /a-very-old-post/ http://yoursite.com/a-very-new-post/

makes sure to change the old post and the new post URL. You can then save the changes and upload the .htaccess file back to the server.

you can now test your redirection to make sure it redirects correctly as you expect.

编辑 .htaccess 文件

in addition, you can access and edit your .htaccess files through the managed service provider’s dashboard and built-in file manager.

for example, you can find your .htaccess in SiteGround’s file manager by going to the site tools »site »file manager and navigating to your site’s / public_html/ folder.

Siteground-file-manager-htaccess

, you can then right-click the .htaccess file and select Edit.

only needs to add the 301 redirection code directly and save the file. Similarly, be sure to download the original .htaccess file for backup to ensure security.

Siteground-file-manager-htaccess-edits

We hope that this beginner’s guide to creating WordPress redirects will help you set up redirects on your website. You may also want to check out our guide to how to launch the WordPress blog in the right way, or check out our list of the best email marketing services for small businesses.

Disclaimer: All articles on this website, unless otherwise specified or marked, are original and published on this website. Any individual or organization is prohibited from copying, stealing, collecting, or publishing the content of this site to any website, book, or other media platform without the consent of this site. If the content on this website infringes on the legitimate rights and interests of the original author, you can contact us for assistance.