Have you ever clicked on a link to a page on your WordPress site, only to end up with a frustrating “404 Not Found” error? Maybe you moved a page, changed your site’s structure, or even switched domains. Whatever the reason, URL redirection is the magic tool that helps guide visitors (and search engines) from old URLs to the right new spots on your site. It keeps your visitors happy and protects your SEO rankings.
In this blog, I’ll walk you through everything you need to know about redirecting URLs on WordPress. Whether you’re a beginner, an intermediate user, or a bit of a tech wizard, this guide has you covered. Plus, I’ll share how Cloudways’ hosting for WordPress makes managing your site easier and more secure. Let’s get started!
Why Redirect URLs Matter in WordPress
First things first: what exactly is a URL redirect? Think of it like forwarding your mail when you move house. When a visitor tries to access an old page URL, a redirect sends them automatically to the new page instead of showing an error.
Why is this important?
- SEO protection: Redirects help search engines understand that your content has moved, so you don’t lose your hard-earned rankings.
- Better user experience: Visitors don’t get stuck on dead pages-they get smoothly sent where they want to go.
- Fix broken links: Links from other sites, social media, or your own pages might still point to old URLs. Redirects fix that.
- Site changes: Whether you’re reorganizing your site or moving to a new domain, redirects keep everything connected.
Understanding Different Types of Redirects
Not all redirects are the same. Here are the main types you’ll come across:
- 301 Redirect (Permanent): This tells browsers and search engines that the page has moved permanently. It passes almost all SEO value to the new URL. Use this when you’re sure the old page is gone for good.
- 302 Redirect (Temporary): This means the move is temporary. Search engines don’t pass SEO value to the new page. Use this if you plan to bring the old page back soon.
- 307 Redirect: Similar to 302 but more specific to HTTP/1.1 protocol. Mostly used for temporary redirects as well.

For most WordPress site changes, a 301 redirect is what you want.
When Should You Use URL Redirects on Your WordPress Site?
Here are some common situations where redirects come in handy:
- Deleted or moved pages: You removed or relocated a page but want visitors to find the new location.
- Changing URL structure: Maybe you updated your permalink settings or reorganized categories.
- Site migration or domain change: Moving your entire site to a new domain? Redirects keep your visitors and SEO intact.
- Fixing broken links: Links from other websites or old bookmarks can lead to 404 errors without redirects.
- Merging websites or switching CMS: Redirect old URLs to new ones during big changes.
How to Create URL Redirects in WordPress: 4 Step-by-Step Methods
Now, let’s get practical. Here are four common ways to set up redirects.
Using a Plugin
The Redirection plugin is a lifesaver if you want a simple, no-code solution.
How to use it:
- Go to your WordPress dashboard → Plugins → Add New.
- Search for “Redirection” and install it.
- Activate the plugin.
- Go to Tools → Redirection.
- Enter the old URL (source) and the new URL (target).
- Click Add Redirect.

That’s it! The plugin also tracks 404 errors, so you can fix broken links easily.
Editing the .htaccess File
Your .htaccess file controls how your server handles requests. Editing it lets you create fast, server-level redirects.
How to do it:
- Backup your website and .htaccess file.
- Access .htaccess via your hosting file manager or FTP.
- Add this line to redirect a single page:
Redirect 301 /old-page/ http://www.yoursite.com/new-page/
- Save the file.
This method is fast and doesn’t rely on WordPress plugins, but be careful-mistakes in .htaccess can break your site.
Using the functions.php File (For Developers)
If you’re comfortable with PHP, you can add redirects in your theme’s functions.php file.
Example code:
function redirect_old_page() {
if (is_page('old-page-slug')) {
wp_redirect(home_url('new-page-slug'), 301);
exit();
}
}
add_action('template_redirect', 'redirect_old_page');
Replace ‘old-page-slug’ and ‘new-page-slug’ with your actual page slugs.
Redirects via Hosting Control Panel
If your hosting provider uses cPanel, you can set redirects there without touching WordPress.
Steps:
- Log into cPanel.
- Find the Redirects section.
- Choose Permanent (301) or Temporary (302) redirect.
- Select your domain.
- Enter the old and new URL paths.
- Click Add.
Practical Examples and Code
Here are some handy examples used for redirects.
Redirect a single page (using .htaccess)
Redirect 301 /old-blog-post/ https://www.yoursite.com/new-blog-post/
Redirect entire site (using .htaccess)
Redirect 301 / https://www.newdomain.com/
Conditional redirect (in functions.php)
Redirect logged-out users from a page:
function redirect_logged_out_users() {
if (is_page('members-only') && !is_user_logged_in()) {
wp_redirect(home_url('login'));
exit();
}
}
add_action('template_redirect', 'redirect_logged_out_users');
Using regular expressions in .htaccess
RewriteEngine On RewriteRule ^old-folder/(.*)$ /new-folder/$1 [R=301,L]
This redirects all pages under /old-folder/ to /new-folder/ preserving the rest of the URL.
Testing and Troubleshooting Redirects
Once you set up redirects, it’s important to test them too, you can follow the steps to test your redirects along with troubleshooting:
- Open your browser and enter the old URL. You should be sent to the new page.
- Use online tools like Redirect Checker to verify the redirect type and status.
- Watch out for redirect loops (where URLs keep bouncing back and forth) or redirect chains (multiple redirects in a row) – both can slow down your site.
- If something breaks, check your .htaccess or plugin settings carefully.
Best Practices for Managing Redirects
Following are some best practices to keep your redirects healthy:
- Always use 301 redirects for permanent moves.
- Avoid long redirect chains-redirect directly from the old URL to the new URL destination.
- Update your internal links to point directly to new URLs.
- Document all redirects so you can manage them easily.
- Regularly monitor 404 errors with Google Search Console and fix them promptly.
How Cloudways Hosting Supports Your Redirects?
Cloudways is a managed hosting platform designed to make your life easier. Here’s how it helps with redirects:
- Easy access to .htaccess: You can quickly edit .htaccess files via the Cloudways platform SSH Terminal.
- Security: Cloudways protects your site from threats like DDoS attacks, so editing files is safe.
- Performance: Server-level redirects run smoothly on Cloudways, keeping your site fast.
- Support: If you get stuck, Cloudways offers expert support to help with complex redirect setups.
Maintaining Your WordPress Site
Redirects aren’t a one-and-done deal. Keep your site healthy by:
- Regularly checking for broken links and 404 errors.
- Using tools like Google Search Console to monitor site health.
- Keeping your site fast and secure with Cloudways optimized hosting.
- Updating redirects as your site evolves.
Maintaining Your WordPress Site is Easy With Cloudways
Get 3 months free trial with:
✓ Auto-scaling for media-heavy sites
✓ Free SSL for secure uploads
✓ 24/7 expert support
Conclusion
Redirects are a simple yet effective approach to keep your WordPress website performing effectively. They maintain your SEO, improve the user experience, and allow you to handle site modifications without hassle. Whether you use a simple plugin or go into .htaccess and PHP, understanding how to redirect URLs is a valuable skill.
With Cloudways hosting, maintaining these redirects is easier and more secure, allowing you to focus on building your site without worrying about technical issues. Start implementing redirects today and keep your visitors-and Google-happy!
What is a 301 redirect?A permanent redirect that tells search engines the page has moved forever, passing SEO value.
How long should redirects stay in place?
At least a year to let search engines update their indexes.
Can redirects affect site speed?
Too many redirects or chains can slow your site, so keep them simple.
What if I’m not comfortable editing code?
Use plugins like Redirection for an easy, no-code solution.
How do I find broken links on my site?
Google Search Console and plugins like Redirection help you spot 404 errors.
Salwa Mujtaba
Salwa Mujtaba is a Technical Content Writer at Cloudways. With a strong background in Computer Science and prior experience as a team lead in Cloudways Operations, she brings a deep understanding of the Cloudways Platform to her writing. Salwa creates content that simplifies complex concepts, making them accessible and engaging for readers. When she's not writing, you can find her enjoying good music, reading a book, or spending quality time with her family.