How to Redirect Old URLs in WordPress (All Methods)
Redirecting old URLs is essential to prevent 404 errors, protect SEO, and maintain a good user experience.
1. Using a Redirection Plugin (Most Popular & Beginner-Friendly)
Recommended plugins:
-
Redirection
-
Rank Math (Redirects module)
-
Yoast SEO Premium
Steps (Redirection plugin):
-
Install and activate Redirection
-
Go to Tools → Redirection
-
Add:
-
Source URL (old URL)
-
Target URL (new URL)
-
-
Select 301 – Permanent
-
Save
Best for: Non-technical users
2. Using Rank Math Redirect Manager
Best if you already use Rank Math.
Steps:
-
Go to Rank Math → Redirects
-
Click Add New
-
Enter old and new URLs
-
Choose 301 Redirect
-
Save
3. Using Yoast SEO Premium Redirects
Automatically handles redirects when URLs change.
Steps:
-
Edit or delete a page
-
Yoast prompts for redirect
-
Select new URL
-
Save
4. Redirect via .htaccess File (Advanced & Fast)
Recommended for performance-focused sites.
Example (single URL redirect):
Redirect 301 /old-page/ https://yourwebsite.com/new-page/
Multiple redirects:
RewriteEngine On
RewriteRule ^old-page/?$ https://yourwebsite.com/new-page/ [R=301,L]
Best for: Large sites, developers
5. Redirect Using functions.php (Not Recommended)
Possible but risky.
add_action('template_redirect', function() {
if (is_page('old-page')) {
wp_redirect(home_url('/new-page/'), 301);
exit;
}
});
Use only if plugins and .htaccess aren’t options.
6. Bulk Redirects (For Site Migrations)
For domain or URL structure changes.
Methods:
-
Regex redirects (Redirection / Rank Math)
-
Wildcard redirects in
.htaccess
Example:
RedirectMatch 301 ^/blog/(.*)$ https://yourwebsite.com/$1
7. Redirect Media URLs (Images, PDFs)
Often forgotten but important.
Use:
-
Redirection plugin
-
.htaccessrules
8. Redirect HTTP to HTTPS
If SSL is installed.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
9. Redirect Old Domain to New Domain
Used during rebranding or domain change.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]