Table of contents
Get the industry’s fastest hosting for WordPress◦ 100% network uptime
◦ Comprehensive security
◦ 24/7 support

WordPress GuideManagement → Set Up Redirect

How to set up redirects in WordPress

If you’re running a WordPress site, setting up redirects properly can save you from those dead ends and keep people happily cruising around your content.

Redirects are basically your site’s way of saying, “Hey, this page moved, but no worries – I’ll take you there.” It’s super important for your visitors and search engines, so your site doesn’t lose any of its hard-earned ranking. Whether you’re just fixing broken links, switching URLs, or moving to a new domain, knowing how to set up redirects the right way will save you headaches down the road. 

Here, we’ll show you why redirects matter, share some best practices, and walk you through the easiest ways to set them up in WordPress.

Get fast, reliable WordPress hosting

Power your site with the industry’s most optimized WordPress hosting

Why WordPress redirects are important

Redirecting URLs is crucial whenever you make significant changes to your website. For example, moving your site from HTTP URLs to HTTPS improves security by encrypting data and boosts your SEO rankings because search engines prioritize secure sites. Without proper redirects in place, visitors trying to access the unsecured HTTP versions of your pages will encounter errors or security warnings.

Similarly, major permalink or URL changes – like restructuring your site, renaming pages, or migrating content – require careful redirection to preserve both visitor access and search engine indexing. If these changes aren’t handled correctly, users will end up on broken links, which can harm your site’s reputation and visibility.

That being said, poor WordPress redirects can negatively affect your website in the following two main aspects:

User experience

Most website visitors use a search engine to access your site. But when the search engine has difficulties finding the information that is supposed to be there, visitors will be sent to a broken link, also known as a 404 error.

These kinds of broken links negatively affect the user experience. When visitors find it difficult to access the information that they are looking for, they will move on to a new website.

Moreover, even simple errors like these can make your website seem less professional and damage the user experience. This is why broken links should be avoided as much as possible, even though it is good to design and have a 404 page ready for a worst-case scenario.

The best tactic to avoid broken links or 404 errors is to redirect your users to a new URL after you delete or move a page.

Search engine optimization (SEO)

A broken link can also damage your website by affecting your SEO. SEO is a major marketing technique that is used to draw organic traffic to your website, without the expense of paid marketing. Through SEO, you attract visitors to your website by making it appear higher in search engine results for certain search queries.

A broken link or a 404 error signals to search engines that visitors will not be able to find information on your website and so it will not drive traffic to your page. And considering that search engines drive 93% of all website traffic, that’s a big loss in terms of potential visits.

WordPress redirect best practices

Setting up redirects in WordPress is pretty straightforward, but there are a few things to keep in mind to make sure you’re doing it right and avoiding common pitfalls. Here are some best practices to follow:

  • Use 301 redirects for permanent moves: If a page has permanently moved to a new URL, a 301 redirect is the way to go. It tells browsers and search engines that the change is permanent, so they’ll update their records and pass along any SEO value.
  • Avoid redirect chains and loops: A redirect chain happens when one URL redirects to another URL , which then redirects to a third URL, and so on. This slows down your site and can confuse search engines. Similarly, a redirect loop is when URLs keep redirecting back and forth endlessly, which breaks your site. Always point redirects directly to the final destination.
  • Keep redirects relevant and updated: Don’t set up redirects just for the sake of it. Make sure each redirect serves a clear purpose – whether it’s fixing a broken link, consolidating content, or updating URLs after a site redesign. And regularly check your redirects to keep them current.
  • Test your redirects: Test your redirects in different browsers and devices to make sure everything flows smoothly. Tools like redirect checkers can help spot any issues quickly.
  • Be mindful of redirect types: Besides 301 (permanent), there are 302 (temporary) and other types of redirects. Use temporary redirects only if you plan to bring the original URL back, like during a site maintenance or a short campaign.

How to set up redirects using a plugin

If you’re not a fan of digging into code or server settings, using a plugin like Redirection is by far the easiest way to manage redirects in WordPress.

Related reading: The Essential Guide to WordPress Plugins →

Redirection is a free, powerful, and easy-to-use plugin that helps you manage 301 redirects and keep track of 404 errors without touching a single line of code. Here’s how to get started:

  1. After activation, you’ll find Redirection under Tools > Redirection. The setup wizard will guide you through the basics, like monitoring permalink changes and logging redirects.

A screenshot showing how to add a new redirection using the Redirection plugin. Redirection also tracks 404 errors, so you can quickly spot broken links and set up redirects to fix them. This keeps your site clean and your visitors happy.

As you can see, the Redirection plugin is great for beginners and advanced users alike because it’s reliable, lightweight, and packed with useful features to keep your redirects organized.

Other WordPress redirect plugins

If you’re curious about other redirection options, here are some excellent plugins to consider:

  • Safe Redirect Manager: A lightweight and straightforward plugin developed by 10up, Safe Redirect Manager is perfect if you want a no-frills way to manage simple 301 redirects. It’s easy to use, doesn’t add bloat, and is a solid choice for developers who prefer minimal overhead
  • Yoast SEO Premium: Many WordPress users already know Yoast for its SEO tools, but the Premium version also includes a built-in redirect manager. It lets you set up and manage redirects right from the SEO dashboard, which is super convenient if you’re already using Yoast for your site’s SEO.
  • All in One SEO (AIOSEO): Similar to Yoast, AIOSEO offers a powerful redirect manager as part of its Pro features. It supports various redirect types and has tools for bulk managing redirects, making it a solid option if you want an all-in-one SEO and redirect solution.
  • Rank Math: Rank Math is another popular SEO plugin that includes a redirect module. It supports 301, 302, 307, and other redirect types, plus it has a simple interface to create and manage redirects without needing extra plugins.
  • Simple 301 Redirects: As the name suggests, this plugin focuses on making 301 redirects easy. It’s perfect if you want something lightweight that does one thing well – redirect old URLs to new ones quickly and without fuss.

Other methods of redirecting

While plugins are the easiest way to handle redirects in WordPress, sometimes you might want – or need – to use other methods. Whether you prefer working with code, want more control, or need to handle redirects on the server level, here are some alternative approaches.

.htaccess file modifications

If your WordPress site is hosted on an Apache server, the .htaccess file is a powerful place to set up redirects. This file controls how your server handles requests, and you can add redirect rules directly here for fast, efficient URL forwarding.

For example, a simple 301 redirect looks like this:

Redirect 301 /old-page/ https://yourdomain.com/new-page/

Be careful when editing .htaccess, though – mistakes can break your site. Always back up your file before making changes and test thoroughly.

wp_redirect() function

For developers comfortable with PHP, WordPress offers the wp_redirect() function to set up redirects within your theme or custom plugins. This method gives you granular control and lets you trigger redirects based on specific conditions, like user roles or query parameters.

A basic example:

if (is_page('old-page')) {
    wp_redirect(home_url('/new-page/'), 301);
    exit;
}

Remember to call exit; after wp_redirect() to stop further processing.

Server-side redirects

Beyond WordPress and .htaccess, you can set up redirects directly on your web server. If you’re using Nginx, for instance, redirects are handled via the server’s configuration files.

Example Nginx redirect:

rewrite ^/old-page/?$ https://yourdomain.com/new-page/ permanent;

Server-level redirects are very fast since they happen before WordPress even loads, but they require access to your server’s config and are best handled by someone familiar with server management.

Additional resources

WordPress management tips and trends →

A crash course on hosting, plugins and themes, running multiple sites, and more

Easy SEO for WordPress →

7 simple steps to optimize your WordPress site for SEO

Simple WordPress website maintenance →

A quick and easy guide to help you maintain your WordPress site