WordPress Redirects Creation Guide

Are you trying to create a redirect in WP? This beginner’s guide & tutorial to WordPress redirects creation, 301, how to set up & much more

By Claudio Pires
Updated on March 18, 2023
WordPress Redirects Creation Guide

Are you trying to create a redirect in WordPress? Not sure what a redirect is and why it is essential? Don’t worry. We have covered you in this beginner’s guide and tutorial to WordPress redirects creation, 301, how to set up, and much more.

We will cover what a redirect is, how to create a redirect in WordPress, why you need it, and when you should use redirects.

Technically, it’s not just a WordPress redirect but a web redirect that tells browsers that X URL isn’t available anymore and that it should go to Y URL instead. Whether your site is on Wix, on Drupal, or just a plain-old HTML site, URL redirection can be done the same way. No matter what platform you use.

When to Utilize Rewritings in WordPress

Typically, you should conduct a 301 redirect when moving a webpage on your website from one URL to another and wanting to send any traffic from the old URL to the new URL. If you don’t construct a redirect, users will receive a 404 error (not found) when visiting the old URL.

Here are instances in which a permanent redirection would occur:

  • Replacing an outdated page: If you’ve added a new page to your website with more current information than the other pages. You can redirect the old page’s URL to the new one.
  • Removing a page from your website: If you intend to remove a page. Be aware that URLs don’t simply vanish. So, search engines and some visitors will have retained the link to the page that was taken. To prevent a 404, redirect the URL of the removed page to a similar page. The home page, or a page that explains to users that the content or product is no longer available.
  • Modifying the design of your website: Reorganizing the design of your website involves moving pages around. Which typically necessitates redirects to ensure visitors are directed to the correct pages using WordPress redirects guide.
  • Altering the permalinks: You may want to alter the structure of your permalink. To make your URLs more appealing to the eye, have a greater readability, and enhance your search engine optimization. In this instance, redirect your old URLs to your new, updated URLs in order to prevent broken links.
  • Altering the domain name: If you acquire a new domain name, this will be reflected in your URL. Old URLs should be redirected to URLs that include your new domain name.
  • To have multiple domains redirect to one page. Website owners may buy domain names that are similar to their primary domain name. This facilitates the conversion of a visitor who enters the wrong domain into the intended website. This discourages competitors from acquiring similar domains and taking traffic away from them.
  • Saving an email campaign: Suppose you recently sent out an email blast that contained a broken link… While it’s not possible to alter the link in the email. You can redirect the incorrect URL to a functional version. Crisis averted.

WordPress Redirects Guide & tutorial

There are many redirects, each with another numerical code, so let’s break those down first. The two most common are the 301 and 302, which we will focus on today.

301 – A permanent redirect. You use these when you change URLs or site structures for good. The old link’s SEO power and ranking are transferred to the new one. The old URL turns into the new one.

302 – A temporary redirect. You use these when you need a short-term change—maybe a site redesign or quick fix for a bug or glitch. No link juice or ranking is transferred.

There are also 300, 303, 304, 307, and 308 redirects. But those are reserved for exceptional cases that involve specific uses of POST and GET, which 95% of us don’t need.

If you’re interested in the topic, the Mozilla Developer Network has fantastic documentation on the different kinds of redirects. But regarding your WordPress redirect, you’ll use mostly 301 with the occasional 302. This beginner’s guide and tutorial to WordPress redirects creation, 301, how to set up, and much more.

.htaccess

One of the most critical files to a website is the .htaccess file. Standing for hypertext access, it stands to reason that you can approve, deny, or redirect access to your site through it.

While it may seem intimidating because of how utterly important it is that you don’t do anything wrong, editing the file to redirect is as simple as it can be.

Use your favorite FTP program (likely FileZilla) to get into the root directory of your WordPress installation. Just under the core folders, you should see .htaccess.

All you have to do for a WordPress redirect is add a simple line of code just above the line that reads # BEGIN WordPress redirects guide.

Redirect 301 / http://visualmodo.com/

or

Redirect 302 / http://visualmodo.com/

Note that either of these lines of code will redirect your entire site to the URL specified. If you want to turn a specific page, post, or URL within your site, you must provide it and the destination URL. Both can be the relative path (if you stay in the same domain) and separated by a single space.

Redirect 301 /blog_post https://www.visualmodo.com/category/blog_post

or

Redirect 302 /blog_post2.html /category/blog_post2.html

Additionally, you can use conditional logic with regex, too, if you need something more complex. Here is an excellent list of special redirects you can use that way.

Save your .htaccess file as plaintext before re-uploading it to the server, regardless of which route to enter the redirects. This beginner’s guide and tutorial to WordPress redirects creation, 301, how to set up, and much more.

Plugin Usage: WordPress Redirects Guide

If you’re not comfortable editing the .htaccess file for a WordPress redirect, don’t worry. You don’t have to. Because you’re using WordPress, there’s a plugin for that. Because of WordPress. One of the tops is Quick Page/Post Redirect, which works like a charm out of the box.

Setting up your redirects is as easy as can be. Once activated, Quick Redirects adds a new item to your admin dashboard called Quick Redirects.

The default type of WordPress redirect is 301 (they are the most common, after all), and you set them up simply by typing the origin and destination URLs into a couple of fields. Hit the save button, and you’re golden on the WordPress redirects guide.

Additionally, you will see a list of your existing redirects (note in the image above how the ones I’ve used are all relative paths, not to a new domain, but that’s possible, too).

If you don’t need the redirect anymore, you can trash it with a click, or you can edit the redirect for any number of reasons. For me, it’s when I sausage-finger an indecipherable typo.

And finally, if you look into the Redirect Options, you will see an absurd number of choices that you can make, either creating rules that apply for all of your redirects or enabling settings that work with custom post types and meta boxes and so forth. It’s a lot to fiddle with

I have also used the Redirection plugin before switching over to Quick Redirects because Redirection also allows for 404-page monitoring. You can see which pages are missing and set up a WordPress redirect rule so that anyone who visits there gets sent to a helpful page. this start guide and tutorial on WordPress redirects creation, 301, how to set up, and much more.

Final Words

Whether your site has moved to a new location, you’re changing your permalink structure, or somehow a WP update broke everything about your installation, and you’re starting fresh…having a working knowledge of how to set up a WordPress redirect is pretty handy.

It doesn’t matter if you like digging into Core files or prefer to use plugins. Both are effective and achieve the same results in the end. So don’t be scared. Start playing around and see what works best for you. You might even find a way to improve rankings and SEO with just a few clicks.

Claudio Pires

Claudio Pires is the co-founder of Visualmodo, a renowned company in web development and design. With over 15 years of experience, Claudio has honed his skills in content creation, web development support, and senior web designer. A trilingual expert fluent in English, Portuguese, and Spanish, he brings a global perspective to his work. Beyond his professional endeavors, Claudio is an active YouTuber, sharing his insights and expertise with a broader audience. Based in Brazil, Claudio continues to push the boundaries of web design and digital content, making him a pivotal figure in the industry.