WordPress handles redirects differently depending on how you configure them: through plugins, the .htaccess file, the CMS's own options, or via code in functions.php. Each method has its advantages, limitations, and SEO risks. This guide covers all methods, when to use each, and how to audit your WordPress redirects to ensure they are clean.
The 4 methods for creating redirects in WordPress
Method 1: Redirection plugin (recommended for most sites)
The Redirection plugin (by John Godley) is the de facto standard for managing redirects in WordPress. It manages redirects from the database, offers an access history, automatically detects 404 errors, and allows configuring redirects with regex.
- 1.Install and activate the Redirection plugin from Plugins → Add New.
- 2.Go to Tools → Redirection and complete the initial wizard (it will ask if you want to monitor 404s).
- 3.In the "Redirects" tab, click "Add New".
- 4.Enter the source URL (relative path, e.g. /old-article) and the destination URL (can be relative or absolute).
- 5.Select the type: 301 (permanent) for the vast majority of cases, 302 only if the redirect is temporary.
- 6.Save and verify with iRankly's analyzer that the redirect works correctly.
Redirection keeps a log of all accesses to each rule. If you see that a redirect has not received any accesses in months and has no external backlinks, it is a candidate for removal in the next cleanup.
Method 2: .htaccess (for Apache, maximum performance)
Redirects in .htaccess are processed directly by the web server, before WordPress loads. They are faster than plugin-managed redirects and do not depend on PHP or the database. They are the best option for bulk redirects (complete URL structure migrations) or when performance is critical.
# Simple 301 redirect
Redirect 301 /old-article https://yourdomain.com/new-article
# Redirect entire section with regex
RewriteRule ^blog/(.*)$ /resources/$1 [R=301,L]
# Full domain redirect (domain change)
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]The WordPress .htaccess file has a section auto-generated by WordPress (between the # BEGIN WordPress and # END WordPress comments). Add your redirects BEFORE that section, not inside it. If WordPress regenerates the block, it will not delete your rules.
Method 3: wp_redirect() in functions.php (for developers)
WordPress's wp_redirect() function allows creating conditional redirects based on PHP logic: redirecting by user role, by URL parameters, or in response to specific CMS events.
// Redirect a specific URL to another
add_action('template_redirect', function() {
if (is_page('old-page')) {
wp_redirect(home_url('/new-page'), 301);
exit;
}
});This method is flexible but has a cost: WordPress loads completely before executing the redirect. For simple redirects, the plugin or .htaccess are more efficient.
Method 4: Redirects integrated in Yoast SEO / Rank Math
All-in-one SEO plugins like Yoast SEO Premium and Rank Math include an integrated redirect manager. They are convenient if you already have the plugin installed, but have fewer features than Redirection (no detailed log in Yoast, no automatic 404 management in the free version).
When to use each method
| Situation | Recommended method | Why |
|---|---|---|
| Changing the URL of a single post/page | Redirection plugin | Easy, with log and without touching code |
| Complete URL structure migration | .htaccess or nginx.conf | Faster, does not depend on PHP |
| Conditional redirect (by role, by date) | wp_redirect() in functions.php | Requires logic that plugins do not offer |
| You already have Yoast/Rank Math installed | Integrated SEO plugin manager | Avoids installing another plugin for few redirects |
| Complete domain change | .htaccess + WordPress settings | More robust, works before WP loads |
Most common redirect errors in WordPress
Error 1: Redirect chains from slugs changed multiple times
WordPress does not automatically update existing redirects when you change a post slug. If you change the slug from /post-v1 to /post-v2 and then to /post-v3, you end up with a chain: /post-v1 → /post-v2 → /post-v3. Each slug change adds a hop.
- •Solution: every time you change a slug, update the destination of previous redirects to point directly to the final slug.
- •In Redirection: find all rules whose destination is the old slug and update the destination to the new slug.
- •Verify with the analyzer that the old URLs reach the final destination in a single hop.
Error 2: Homepage redirect creating a loop
If you configure a static page as the front page in WordPress (Settings → Reading → Your homepage displays: A static page) and also have a redirect pointing from / to that page, you can create a loop. WordPress already knows that is the front page — you do not also need a redirect.
Error 3: 302 redirects where 301 should be used
The Redirection plugin uses 301 by default, but if you configure redirects manually in .htaccess with the Redirect directive without specifying the code, Apache uses 302 by default. Always specify the code explicitly:
# Incorrect (Apache uses 302 by default): Redirect /old-page /new-page # Correct (explicit 301 permanent): Redirect 301 /old-page /new-page
Error 4: Domain redirect without updating the URL in WordPress
If you do a domain change by only adding a redirect in .htaccess, but do not update the site URL in WordPress (Settings → General), the CMS's internal links will continue pointing to the old domain. The result is a chain on every internal link: old-domain.com/page → new-domain.com/page.
- 1.Update "WordPress Address" and "Site Address" in Settings → General to the new domain.
- 2.Use the Better Search Replace plugin to update all URLs in the database content.
- 3.Update the XML sitemap to contain only the new domain's URLs.
- 4.Update Google Search Console: add the new domain as a property and use the address change tool.
How to audit your WordPress redirects
Once a quarter, spend 20 minutes reviewing the state of your WordPress redirects following this process:
- 1.Export all active redirects from the Redirection plugin (Tools → Redirection → "Import/Export" tab).
- 2.Identify redirects with destinations that are themselves URLs that redirect (chains).
- 3.Check in the Redirection log which ones have not received any accesses in more than 6 months — they are candidates for removal.
- 4.Verify the 20–30 most important URLs with iRankly's analyzer to confirm they resolve in a single hop.
- 5.Review the "404s" tab in Redirection to identify broken URLs that need a redirect.
Prueba la herramienta gratis
Redirect Chain AnalyzerAnaliza tus URLs con {tool} de iRankly. Sin registro, sin tarjeta.
WordPress redirects: frequently asked questions
Do WordPress redirects affect site speed?
Plugin-managed redirects add a small amount of latency because WordPress must load before processing the redirect (typically 50–200 ms extra). .htaccess redirects are faster because the server processes them before invoking PHP. For sites with many high-frequency redirects, .htaccess is preferable.
How many redirects can WordPress handle without performance issues?
The Redirection plugin can handle thousands of redirects without significant issues, as database queries are optimized. However, above 500 redirects, .htaccess redirects start to be noticeably more efficient. For large migrations with thousands of URLs, consider moving all redirects to the server.
Does WordPress automatically create redirects when changing a slug?
Yes, if you have the Redirection plugin installed and the "Monitor permalink changes" option enabled, it automatically creates a 301 redirect from the old slug to the new one. Without the plugin, WordPress does not create any automatic redirect when changing slugs — the old slug simply returns a 404.