How to Redirect URLs on WordPress


Redirecting URLs is a simple but important component of your website’s SEO. It can help you avoid duplicate content, improve user experience, and send traffic and authority to more relevant pages. 

In this guide, we’ll teach you how to redirect URLs on WordPress.

Let’s get started. 

What Is a Redirect? 

A redirect is a way to forward users and search engines to a different URL than the one they requested. 

For example, if you deleted a page on your site and didn’t set up a redirect, the user will get a 404 error response. 

Which isn’t good for your SEO. 

Search engines don’t index pages that return a 404. And the backlinks pointing to the page no longer hold any value. 

Ideally, when you delete that page, you’d set up a 301 redirect to a similar page serving the same intent. 

You can easily find broken pages and incomplete redirects using a tool like Site Audit. 

search for "redirect" in Site Audit "Issues" tab to find broken pages and incomplete redirects

How to Use Redirects

Redirects are often used to update a website that has migrated to a new server. 

You can also use them if you’ve done a major website update, changed any page URLs, or made updates to your website’s navigation. 

You can also redirect a page to avoid creating duplicate content. 

If you’re moving content o a new page with an updated URL, you can use a redirect to direct users from the old page to the new one.

Types of Redirects 

  • 301: These are “permanent redirects.” You’ll use 301 redirects when a page has been moved to a new destination permanently. 301 redirects hold the most link equity, and work best for SEO.
  • 302/307: Use these redirects when moving a page temporarily or when you want to redirect users to a new website or page temporarily. 
  • Meta refresh: You’ll usually see this type of redirect used client-side (i.e, in your browser) and not your server. They direct users to a new page after a specified amount of time. They’re not recommended for SEO purposes. 
  • HTTP to HTTPS: This type of redirect that forces browsers to display the HTTPS version of a page.

Each type of redirect can be slotted into two categories:

  • Client-side redirects: These redirects happen directly in the browser. A user can trigger a client-side redirect when selecting a link. For example, if you select a page and receive an option to “click on this link if you’re not redirected in 5 seconds,” you’ve encountered a client-side redirect. 
  • Server-side redirects: This redirect occurs when a web server answers with a server status code. When a user clicks on an outdated page or link and they are automatically redirected to a new page, you can thank a server-side redirect.

How to Redirect a URL on WordPress via htaccess

An htaccess file is a configuration file that tells your server how to display pages from the WordPress root directory. 

We only suggest you redirect using this method if you are, or have, a web developer. Or if you’re familiar with the technical backend of your WordPress CMS.

WordPress Redirects via htaccess File

  • Verify your web host’s htaccess editing rules. Double-check that you have edit-level access and can make changes to the file.
  • Backup your site and create a copy of your current htaccess file. If something goes wrong, you can revert back to your original website. 
  • In the root directory, add this line of code at the top:

Redirect 301 /current-page.html http://www.yoursite.com/new-page/

How to Redirect a URL on WordPress with a Plugin

You can easily implement WordPress redirects with a plugin. There are a ton of options. And they leave very little room for error. 

Plus, they all tend to follow the same process:

  1. Download and install the plugin
  2. Go to the “redirects” section
  3. Add the old URL and the new, target URL
  4. Test the redirect

Here, we’ll explore how to redirect URLs on WordPress with three plugins: YoastSEO, Redirection, and 301 Redirects — Easy Redirect Manager.

Note: Remember to back up your website before installing and using plugins. 

YoastSEO

YoastSEO is a trusted name when it comes to SEO and WordPress. This plugin addresses several aspects of SEO, including WordPress redirects.

  1. Log into the back end of your website and back it up
  2. Download the YoastSEO plugin from the WordPress plugins store
YoastSEO plugin install page
  1. Once installed, go to the Plugins page and click “Activate” 
  2. In the left-hand toolbar, select the Yoast menu (the “SEO” next to the “Y” symbol.) Select “Redirects
“Redirects” button highlighted in the left-hand toolbar
  1. Choose the type of redirect:
  • 301: moved permanently and will be the final destination
  • 302: found but moved temporarily
  • 307: temporarily redirected (might be useful for a cart or temporary page)
  • 410: content delete (for old, outdated content that you want to delete)
  • 451: unavailable for legal reasons
drop-down menu with different redirect types
  1. Enter in the old URL slug you want to redirect. And the new destination URL. Then, Click “Add Redirect
"old URL" and "URL" fields
  1. Plug the URL into your browser’s address bar to rest the redirect. If it doesn’t work, clear your cache from your browser history and try again.

Redirection by John Goodley

This is a very simple and easy-to-use plugin that focuses solely on WordPress URL redirects.

  1. Download and install the Redirection plugin from the WordPress plugins store
Redirection plugin install page
  1. Go to “Tools” on the left side menu panel, and select “Redirection
“Redirection” button highlighted in the "Tools" section of the menu
  1. At the top of the page, click “Add New” 
  2. Enter the slug of the old URL in the “Source URL” field. And enter the slug of the new URL in the “Target URL” field. Then, select “Add Redirect
"Add new redirection" page
  1. Test that the redirect works by visiting the page’s old URL and see if it redirects to the new URL. If it doesn’t, clear your browser’s cache and try again.

301 Redirects — Easy Redirect Manager

Much like the Redirection plugin, this plugin makes redirects clean and easy-to-understand.

  1. Download, install, and activate the 301 Redirects plugin
301 Redirects plugin
  1. Go to the Plugins page. Under “301 Redirects,” select “Manage Redirects
"Manage Redirects” highlighted in 301 Redirects plugin
  1. Choose the ID, or redirect type (301, 302, or 307)
  2. Add the slug from the old URL in the “Redirect From” field. And the new URL you want to the “Redirect To” field. Then, click “Save
"Redirect Rules" section
  1. The 301 redirect should now be live. Test that it works by visiting the page’s old URL. If it doesn’t, clear your browser’s cache and try again.

It’s crucial to find and fix broken links and redirect errors in WordPress as soon as you encounter them. 

If a user clicks on a link and doesn’t find what they’re looking for (or worse, receives a 4xx error), they’re much more likely to bounce off the page—and your website altogether. 

A terrible user experience. And detrimental to your SEO.

Running a regular site audit can help you spot any site issues that arise as you update your website. 

If you forget to add a redirect to an updated or moved page and it results in an error, a site auditing tool can spot it.

To audit your site for broken links, use Site Audit. 

Enter your domain and click “Start Audit.”

Site Audit search bar

After you configure your settings, click “Start Site Audit.”

"Site Audit Settings" page

In the dashboard, head to the “Issues” tab, and type “broken” into the search bar. 

Like this:

search for “broken” in Site Audit "Issues" tab

You’ll see all of the errors, warnings, and notices on your site related to broken links. Fix as many of these as you can. 

Issue: Pages with temporary redirects

Temporary redirects aren’t 100% SEO-friendly. 

Search engines can index the redirected page, but the page won’t receive any of the page authority from the backlinks pointing to it. 

This can negatively impact the page’s ranking and traffic.

Within Site Audit, type “redirect” into the search bar to see if you have any temporary redirect issues.

search for “redirect” in Site Audit "Issues" tab

Internal linking occurs when you link from one page to another on your website. 

Site Audit also indicates any broken internal links it can find on your pages. Just type “internal” into the search bar.

Like so:

search for “internal” in Site Audit "Issues" tab

Set Up Recurring Redirect Audits

Broken links and pages hurt your ranking. Redirecting is an easy way to avoid taking a hit to your rankings.

They can be easy to implement or fix, depending on the tools you use. Run audits regularly to see if there are any broken links. 

To schedule audits to run automatically, click on the “settings” icon in the top right of the Site Audit dashboard. 

“settings” icon highlighted in the top right of the Site Audit dashboard

Then, scroll down in the Site Audit Settings and click on “Schedule.”

Site Audit Settings

Now, click the dropdown and select your preferred day of the week. 

Then, check the box next to “Send an email every time an audit is complete.” 

And click “Save.”

schedule how often should the tool audit your site in Site Audit Settings

Fix any redirect issues on your WordPress site as soon as they pop up. 



Source link : Semrush.com

Social media & sharing icons powered by UltimatelySocial
error

Enjoy Our Website? Please share :) Thank you!