How to Set Up a 301 Redirect in WordPress
You changed a URL, moved a domain or deleted old posts, and now visitors land on dead pages. Here is how to redirect them without giving away the ranking you already earned.
Redirects are the part of site maintenance nobody plans for. You rename a post, merge two thin articles into one, finally move off the old domain, and a week later the traffic report has a hole in it. The pages did not lose their rankings because the content got worse. They lost them because the old addresses now answer with nothing.
A redirect fixes that in one line. The catch is that the line has to carry the right HTTP status code, and it has to point at the right place. This guide covers both: what each status code actually tells a search engine, how to write a redirect by hand on Apache, how to do the same thing from the WordPress admin, and which four mistakes show up in almost every audit.
What a 301 actually tells Google
A redirect makes a request for URL A come out at URL B. The server explains why through an HTTP status code, and that code is the whole message. The important one is the 301, which stands for "moved permanently". It says the content now lives at the new address for good and that search engines should use the new URL from here on.
The part that matters for SEO: with a permanent redirect, Google passes on effectively all of the link equity, meaning the ranking value a page built up through backlinks and age. Without a 301, that value evaporates every time a URL changes. That is why a redirect is not housekeeping. It is the difference between moving a page and starting it over.
When you actually need one
- Domain move: you switch from
old-domain.comtonew-domain.comand want visitors and rankings to come along. - Changed permalinks: you reworked the URL structure, moved from
/?p=123to readable slugs, or renamed a post. - Deleted or merged content: two similar articles become one, and the old URL points at the new combined post.
- Old campaign or affiliate links: you want a long, ugly target URL to sit behind a short link that people can actually remember.
301, 302, 307, 308 and 410: picking the code
The status code is an instruction, not a detail. Pick the wrong one and months of SEO work can go nowhere.
| Code | Meaning | Link equity | Use it for |
|---|---|---|---|
| 301 | Moved permanently | Passed on | The default for anything that moves for good |
| 302 | Found, temporary | Not passed on, old URL stays indexed | Maintenance pages and genuinely short-lived detours |
| 307 | Temporary, strict | Not passed on | Like 302, but keeps the HTTP method, so forms and APIs |
| 308 | Permanent, strict | Passed on | Like 301 and also method preserving, the modern strict variant |
| 410 | Gone | Nothing to pass on | Content deliberately removed with no successor |
The 410 is the odd one out, because it is not a redirect at all. It tells Google that a page was removed on purpose and will not come back, which gets it out of the index faster than a plain 404 does. For ordinary page moves 301 remains the normal choice, while 308 is the stricter modern equivalent.
Route A: writing the redirect into .htaccess by hand
If your WordPress runs on Apache, you can define redirects directly in the .htaccess file in your web root. A single page looks like this:
Redirect 301 /old-page/ https://your-domain.com/new-page/
A full domain move is a job for RewriteRule:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain\.com [NC]
RewriteRule ^(.*)$ https://new-domain.com/$1 [R=301,L]
This is fast and needs no extra plugin, and for one or two rules it is perfectly reasonable. The drawbacks show up later. A typo in .htaccess can take the entire site offline with a 500 error, and it does so instantly, for everyone. You get no statistics, no overview of which rules already exist, and once you are past a couple of dozen entries the file turns into a wall of text nobody wants to touch. Other useful directives for the same file are collected in our piece on the most useful .htaccess snippets.
One more limitation is worth knowing before you start: on Nginx this route does not work at all. There you need changes to the server configuration, and a lot of managed hosting plans never give you access to it.
Route B: doing it from the WordPress admin
For most site owners a plugin is the safer path. You work inside WordPress, you see every rule in one list, and no edit of yours can corrupt a server file. Linkjet is a lean redirect and affiliate link plugin built for exactly this. The free version stays free under GPLv2 and makes no external calls, so nothing about your links leaves your server.
Setting one up takes four steps:
- 1. Install the plugin: upload Linkjet and activate it. It creates its own database tables, so your WordPress stays tidy.
- 2. Create the redirect: enter the source URL, for example
/go/my-offer, and the destination. - 3. Choose the status code: Linkjet supports 301, 302, 307, 308 and 410, so you can say precisely whether this is permanent, temporary or gone.
- 4. Save and test: open the link yourself and check that you land where you meant to.
What makes the daily work easier: Linkjet builds tidy short links in the /go/… format on your own domain, records click statistics with anonymised IPs, and generates QR codes locally. A built in 404 monitor shows you which dead URLs people are actually requesting, which is where your next batch of redirects comes from. If you are arriving from Pretty Links or Redirection, the import assistant brings your existing rules and their statistics with you, and there is a full REST API with an OpenAPI description for anything you want to automate.
This guide deliberately stays on the how rather than the which. If you would rather weigh several tools against each other before you commit, we put seven of them side by side in the free redirect plugin comparison, including the ones we do not make. Linkjet Free covers everything described here at no cost, and what the rest of our plugins cost is listed on the pricing page.
The mistakes that quietly cost rankings
- Redirect chains: A points to B, B to C, C to D. Every hop costs load time and dilutes link equity. Point the old URL at the final destination instead.
- Loops: A points to B and B points back to A, and the browser gives up with an error. Check source and destination against each other before saving.
- The wrong status code: filing a permanent move as a 302 is the classic. Google then keeps the old URL indexed and passes nothing on.
- Losing query parameters: make sure values such as
?utm_source=…survive the hop, otherwise your campaign tracking goes dark without any obvious symptom. - A 404 where a redirect belonged: deleted pages left to rot are wasted potential. How to catch those cases is covered in finding and redirecting 404 errors.
Conclusion
Setting up a 301 redirect in WordPress is not hard. Getting it right comes down to two things: choosing the status code that matches what really happened to the page, and avoiding chains and loops. The .htaccess route works well for isolated cases and gets fragile fast beyond that. If you redirect regularly, want to see what is being clicked, and would rather not put a server file at risk, a plugin is the calmer option.
Redirects without the headache
Linkjet sets up 301s and the rest in seconds, with short links, privacy friendly statistics, a 404 monitor and an importer for Pretty Links and Redirection. Free version, no external calls.
Frequently asked questions
What is the difference between a 301 and a 302 redirect?
A 301 redirect means moved permanently and passes the link equity a page has built up on to the new address, so the search engine indexes the new URL from then on. A 302 signals a temporary detour instead, which means Google keeps the old URL in its index and transfers no ranking value at all. If a move that was meant to be permanent ends up in the system as a 302, the new URL stays weak in the rankings until someone notices. When in doubt 301 is almost always the right choice, and 302 belongs to genuine stopgaps such as maintenance pages or short campaigns.
How do I set up a redirect in WordPress without a plugin?
On an Apache server you add a single redirect directly to the .htaccess file, for example with the line Redirect 301 /old-page/ https://your-domain.com/new-page/. For a full domain move you use a RewriteRule with a RewriteCond on the old host instead. The route is quick but it has teeth: one typo in .htaccess can take the entire site down with a 500 error, and you get no statistics and no overview of the rules already in place. On Nginx servers the approach does not work at all, because you would need access to the server configuration that many hosting plans never hand out.
Which WordPress plugin should I use for redirects?
Linkjet is a lean, free redirect and affiliate link plugin that lets you create redirects from the WordPress admin without touching the server configuration. It supports the status codes 301, 302, 307, 308 and 410, and adds tidy short links in the /go/ format, click statistics with anonymised IPs and a built in 404 monitor. On top of that come locally generated QR codes, an import assistant for existing rules from Pretty Links or Redirection, and a full REST API for automation. Linkjet Free is licensed under GPLv2, stays free and makes no external calls.
When should I use status code 410 instead of a 301?
A 410 Gone makes sense when content has been removed for good and there is no reasonable successor, such as a finished giveaway or a discontinued offer. The code actively tells search engines that the page disappeared on purpose, and it gets the URL out of the index faster than a plain 404 does. If a matching replacement does exist, for example a renamed post or a merged page, a 301 is the better answer because it also carries the link equity across. Linkjet supports both codes when you create a rule, so you can choose precisely between moved for good and deliberately gone.
What are the most common mistakes with WordPress redirects?
The most common ones are redirect chains, where a URL travels through several stops before it reaches the destination and loses load time on every hop, and loops, where two URLs point at each other until the browser gives up. A wrongly chosen status code such as a 302 for a permanent move, or the loss of tracking parameters like ?utm_source= in the target URL, belong on the same list. The case that gets underestimated most often is the deleted page that never gets a redirect at all and simply stays a 404. Point every rule at the final destination and check source and target against each other before you save.