How to Redirect Old URLs in WordPress?

Table of Contents

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):

  1. Install and activate Redirection

  2. Go to Tools → Redirection

  3. Add:

    • Source URL (old URL)

    • Target URL (new URL)

  4. Select 301 – Permanent

  5. Save

Best for: Non-technical users

2. Using Rank Math Redirect Manager

Best if you already use Rank Math.

Steps:

  1. Go to Rank Math → Redirects

  2. Click Add New

  3. Enter old and new URLs

  4. Choose 301 Redirect

  5. Save

3. Using Yoast SEO Premium Redirects

Automatically handles redirects when URLs change.

Steps:

  1. Edit or delete a page

  2. Yoast prompts for redirect

  3. Select new URL

  4. 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

  • .htaccess rules

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]