For your WordPress site, use a 301 redirect for permanently moved pages and a 302 redirect for temporary moves. The choice matters because it tells search engines whether to transfer ranking signals (301) or keep the old URL indexed (302). Below, we break down exactly how each works, when to use them, and how to implement them safely.
What Redirects Do and Why They Matter
Redirects forward one URL to another. When a visitor or crawler requests a URL that has been redirected, the server responds with a status code (like 301 or 302) and the new location. Without redirects, old links break, causing a poor user experience and lost search rankings.
In WordPress, redirects are commonly used when you:
- Change a page’s slug or permalink structure
- Move a site to a new domain
- Switch from HTTP to HTTPS
- Merge two pages or posts
- Run a temporary promotion or maintenance page
Choosing the wrong type can lead to lost traffic or confusing search engines. Let’s look at the technical difference.
301 Redirect: Permanent Move
A 301 status code tells browsers and search engines that the page has permanently moved to a new URL. Search engines will:
- Transfer most ranking signals (link equity, page rank) to the new URL
- Update their index to replace the old URL with the new one
- Stop crawling the old URL after a few visits
This is the standard for any permanent change. For example, if you change a post slug from /old-post/ to /new-post/, a 301 ensures visitors and Google end up at the new page while preserving the page’s search visibility.
302 Redirect: Temporary Move
A 302 status code signals a temporary move. Search engines will:
- Keep the old URL in their index
- Not transfer ranking signals to the new URL
- Continue to crawl the old URL to see if the redirect is removed
Use a 302 when you expect the original URL to return soon. Common scenarios:
- A/B testing a landing page
- Running a seasonal promotion on a temporary URL
- Redirecting users to a maintenance page for a few hours
- Redirecting to a mobile version temporarily
Important: Google treats 302s as temporary and will not transfer link equity. If you use a 302 for a permanent move, you risk losing rankings.
How to Choose: 301 vs 302 in WordPress
Ask yourself: Will the old URL come back? If the answer is no, use 301. If yes, use 302.
Here are concrete examples:
- Permanent: You change your site from
example.comtonewexample.com. Use 301. - Temporary: You redirect users to a “Black Friday Sale” page for one week. Use 302.
- Permanent: You merge two blog posts into one. Use 301.
- Temporary: You’re testing two versions of a checkout page. Use 302.
If you’re unsure, err on the side of 301 only if you’re confident the old URL won’t be used again. Using a 302 for a permanent change is a common mistake that can hurt SEO.
How to Implement Redirects in WordPress
There are several methods, depending on your comfort level.
Using a Plugin
- Install a redirect plugin like Redirection or Yoast SEO Premium.
- Go to the plugin’s redirect settings.
- Enter the old URL (source) and the new URL (target).
- Select the redirect type (301 or 302).
- Save. The plugin will handle the rest.
Editing .htaccess (Apache servers)
If you’re comfortable with code, add a rule to your .htaccess file:
Redirect 301 /old-page/ https://www.example.com/new-page/
Redirect 302 /temp-page/ https://www.example.com/sale/
Place these lines before the # BEGIN WordPress section. Always back up your .htaccess first.
Using PHP in functions.php
For developers, add a template redirect hook:
add_action( 'template_redirect', function() {
if ( is_page('old-slug') ) {
wp_redirect( home_url('/new-slug/'), 301 );
exit;
}
} );
This method is precise but requires coding knowledge.
Common Mistakes and How to Avoid Them
- Using 302 for permanent changes: This delays ranking transfer and can cause duplicate content issues. Always double-check your intent.
- Redirect chains: If A redirects to B, and B redirects to C, search engines may not follow all hops. Keep redirects direct.
- Redirect loops: A redirects to B, B redirects back to A. This breaks the page. Test your redirects after setting them up.
- Forgetting to update internal links: Redirects are a safety net, but you should still update internal links to point directly to the final URL.
- Using a plugin unnecessarily: For one or two redirects, a plugin is fine, but too many plugins can slow your site. Consider .htaccess if you’re comfortable.
Impact on SEO and User Experience
301s consolidate link equity, which is crucial for maintaining rankings after a URL change. 302s preserve the original URL’s indexation, which is useful for temporary campaigns but can confuse if used permanently.
From a user perspective, both types work the same—visitors are forwarded instantly. However, if you use a 302 for a permanent move, users who bookmarked the old URL will always be redirected, but search engines may keep showing the old URL in results, leading to a poor experience.
Also, always use absolute URLs (including https://) in redirects to avoid issues with mixed content and to ensure the redirect works across protocols.
Frequently Asked Questions
Does a 302 redirect pass link juice?
No. A 302 is temporary, so search engines do not transfer ranking signals. Only 301s pass link equity. If you need to preserve SEO, use 301 for permanent moves.
Can I change a 302 to a 301 later?
Yes, you can update the redirect type in your plugin or .htaccess. However, search engines may have already crawled the 302 and kept the old URL indexed. It’s better to choose correctly from the start.
What happens if I use a 302 for a permanent redirect?
Search engines will continue to treat the old URL as active, so they won’t transfer rankings. Over time, you may lose rankings because the old URL is not being updated with new content.
Are 301 redirects bad for page speed?
No. Redirects add a small amount of server response time, but a single 301 is negligible. Redirect chains can slow things down, so keep them short.
How do I test if my redirect is working?
Use an online redirect checker or your browser’s developer tools (Network tab). Look for the status code (301 or 302) and the final URL. You can also use a command-line tool like curl -I to see headers.
Should I use a 301 for HTTP to HTTPS?
Yes. Moving to HTTPS is permanent. Use a 301 redirect from every HTTP URL to its HTTPS equivalent. This is often handled by your hosting provider or a plugin like Really Simple SSL.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Business partnership due diligence checklist what to verify before you sign?
- Does the FCC Protect Internet Privacy?
- Disaster Robbers Codes? Meaning & Origin
- Repair a Disk with Mac Disk Utility
- Avoid Vendor Lock-In: Cloud Provider Strategy
- Secure GitHub Accounts & Repos Against Malicious Code