How to Redirect a Page or URL in WordPress

Trending 3 years ago

In this post, I’ll show you really to redirect a page aliases URL successful WordPress. You’ll study really to group up automatic redirects, manual redirects, and wildcard redirects successful WordPress.

What is simply a WordPress Redirect? 

Ever clicked connected a nexus expecting to onshore connected a peculiar page, only to find yourself whisked distant to a different one? That, my friend, is nan magic of a WordPress redirect successful action. It's for illustration a integer sleight of manus wherever 1 URL deftly hands disconnected to another. Now, why does this matter to you? 

When you negociate a website, pages sometimes get deleted, posts get updated, and full websites acquisition revamps. This is wherever WordPress redirects play a captious role. Think of them arsenic nan friends postulation cops of nan web, guiding visitors to nan correct destination erstwhile nan original 1 is nary longer disposable aliases has moved.

Redirects successful WordPress are peculiarly important for maintaining a soft personification acquisition and preserving SEO rankings. Imagine you’ve put successful loads of effort to rank a circumstantial page. Without a redirect, if that page moves, each your hard-earned SEO juice goes down nan drain, and visitors deed a frustrating dormant end.

There are various types of page redirects successful WordPress, but nan astir communal ones are 301 and 302. A 301 redirect is for illustration saying, "Hey, this page has moved permanently. Update your records, please!" It's a firm, last move, signaling hunt engines to transportation nan aged page's SEO worth to nan caller one.

On nan flip side, a 302 redirect is much of a impermanent detour sign, hinting, "We're conscionable making immoderate changes here. The original page will beryllium backmost soon."

Why Redirect Pages aliases URLs successful WordPress?

There are galore times erstwhile you mightiness request to redirect a post, page, aliases URL successful WordPress. That’s erstwhile a WordPress redirect page comes successful useful. 

Maybe you’ve changed nan slug for a station aliases page. Maybe you’ve amended your permalink settings. Or possibly you’ve written a caller station and want to redirect an aged station to that. 

In each of these cases, you’ll request to study how to redirect a station successful WordPress. This tells browsers to spell to nan caller URL alternatively of nan aged one.

Why Not Use Redirects successful WordPress?

Setting up redirects successful WordPress isn’t ideal. It slows things down for nan personification because nan browser will spell to nan first URL, get nan redirect message, and past spell to nan 2nd URL. And there’s a consequence that you’ll group up nan redirect incorrect aliases simply hide to do it aft changing a URL. Not only that, but links coming done a redirected page aren’t worthy arsenic overmuch for SEO -- Google conscionable doesn’t worth them arsenic highly.

So it’s a bully thought to debar changing your URLs altogether. To minimize changing URLs, make judge you optimize them correct from nan start:

  • Configure your permalink settings to usage beautiful permalinks erstwhile you first group up your tract and earlier you adhd immoderate posts aliases pages.
  • Configure nan slug for each station aliases page earlier you people it. Make judge it’s suitable some for hunt motor optimization (SEO) and for personification acquisition (UX).
  • But if you haven’t already done this, and you request to redirect your URLs successful WordPress, really do you do it?

How to Set Up Page and URL Redirects successful WordPress

There are a fewer different kinds of redirects that you mightiness want to group up for WordPress. The kinds you’ll astir apt beryllium utilizing are:

  • automated redirects
  • manual redirects
  • wildcard redirects

Let’s return a look astatine each of these WordPress redirects arsenic they use to directing a WordPress page aliases URL.

Setting Up Manual Redirects successful WordPress

Sometimes, nan WordPress redirect plugin won’t prime up connected nan page redirect you need. Maybe you want your WordPress tract to redirect 1 station to different aliases you want to redirect a URL connected your domain to a different domain, but nan WordPress redirect plugin won’t activity for that.

In this case, you’ll request to group up a manual redirect successful WordPress without a plugin.

WordPress Redirect Tutorial adhd caller redirectWordPress Redirect Tutorial adhd caller redirectWordPress Redirect Tutorial adhd caller redirect

  1. Go to Tools > Redirection and scroll down to nan Add caller redirection section.
  2. In nan Source URL field, type aliases paste successful nan URL you want to redirect from.
  3. In nan Target URL field, type aliases paste successful nan URL you want to redirect to.
  4. In nan Group field, either time off it arsenic Redirections (the default) aliases prime Modified posts if you’re directing from an aged station to a newer version. This will show browsers what benignant of redirect it is.
  5. Finally, click nan Add Redirect button, and your manual redirect will beryllium added to nan database of redirects. You've now completed each that you request to redirect a page successful WordPress.

Setting Up Wildcard Redirects

Use a wildcard redirect erstwhile you want to redirect a group of URLs that stock definite elements. For example, if you alteration your permalink structure, a wildcard redirect will nonstop anyone utilizing a nexus from your aged building to nan aforesaid nexus utilizing your caller structure.

If you’ve changed your permalink building for posts from /blog/post-name to /category/post-name, for instance, you’ll request to usage a wildcard redirect to guarantee anyone utilizing nan aged links is redirected to nan caller URL.

Wildcard redirects usage thing called Regex, which lets you create precocious redirects. You’ll request to alteration Regex functions first to group up a wildcard WordPress redirect. To do this, complete nan pursuing process: 

Setting up a wildcard redirect pinch nan Redirection pluginSetting up a wildcard redirect pinch nan Redirection pluginSetting up a wildcard redirect pinch nan Redirection plugin

  1. Go to Tools > Redirection and scroll to nan Add caller redirection conception of nan screen.
  2. In nan Source URL field, type nan aged way to categories, pinch a wildcard. It needs to return nan shape /oldslug/(.*)$.
  3. The introduction for Target URL needs to return nan root /newslug/$1.
  4. Then click nan Add Redirect button.

Watch nan Video and Learn How to Redirect successful WordPress 

Wondering really to redirect a URL successful WordPress? Knowing how to redirect a station successful WordPress is simply a bully instrumentality to have. Here’s a speedy video to study much (and don’t hide to subscribe to nan Tuts+ YouTube channel for much regular videos!): 

The Best WordPress Themes and Plugins connected Envato Market

Explore thousands of nan best WordPress themes ever created connected ThemeForest and leading WordPress plugins connected CodeCanyon. Purchase these high-quality WordPress themes and plugins and amended your website acquisition for you and your visitors. 

Get More WordPress Resources

Now you cognize really to redirect a URL successful WordPress. Here are a fewer of nan best-selling and up-and-coming WordPress themes and plugins disposable for 2022.

Redirect successful WordPress nan Proper Way

If you alteration nan URLs successful your WordPress tract aliases create a caller station to switch an aged one, you’ll request to group up a redirect. Depending connected nan changes you’ve made, you mightiness usage an automatic redirect, manual redirect, aliases wildcard redirect. Hopefully, this guideline has helped you to study really to group up redirects successful WordPress for different circumstances.

Did you find this station useful?

Rachel McCollin

WordPress Developer and Writer, Birmingham UK

Rachel McCollin is simply a WordPress developer who writes books, articles and tutorials astir web creation and development, pinch a attraction connected WordPress and connected responsive and mobile development. She runs a web creation agency successful Birmingham, UK and has published 3 books connected WordPress, including WordPress: Pushing nan Limits, an precocious assets for WordPress developers. She's presently penning her 4th book.

More
Source Tuts Plus
Tuts Plus