WordPress 301 redirect: four methods and which one to choose
You set a WordPress 301 redirect in one of four ways: a rule in the server's .htaccess file, the free Redirection plugin, the Rank Math redirections module, or asking the chat through the TellMyShop plugin. For a few addresses any method will do. They differ in who can handle them safely, how easy breaking something is and whether the target gets checked before saving.
Author: The TellMyShop team. A guide for WordPress site and WooCommerce store owners: the cause, the manual fix and the same work in a chat conversation.
Last updated: · 7 min read
When do you need a 301 redirect at all?
A 301 redirect tells the browser and Google that the content has moved permanently to a new address. The visitor lands straight on the right page, and over time Google shows the new address in its results. The rules are described in Google's guide to redirects and Google Search.
Typical situations are a changed address for the About or Services page, two posts merged into one, a discontinued product with a successor, and a move from another platform. WordPress handles some of these by itself. When you change the slug of a published post, it usually redirects automatically, but not for pages. You will find the details and a “when WordPress does it by itself” table in the guide on the 404 error in WordPress. Here we deal with how to set up a redirect when WordPress doesn't.
The four methods side by side
| .htaccess file | Redirection plugin | Rank Math | Chat with TellMyShop | |
|---|---|---|---|---|
| Where you set it | a file on the server, through the hosting file manager or FTP | Tools → Redirection | the Redirections module in Rank Math (advanced mode) | a conversation with the chat |
| Who it suits | the site's caretaker | the owner | an owner who already uses Rank Math | the owner |
| Risk of a mistake | an error in the file can take down the whole site | a typo in the target address | a typo in the target address | the chat checks the target before saving |
| Works without a plugin | yes | no | no | no |
| Nginx server | no, server configuration is needed | yes | yes | yes |
| List of 404 errors | none | yes, with a log | yes | yes, the plugin collects 404s itself |
| Undo | by hand, from a copy of the file | delete the rule | delete the rule | from the change history, with one instruction |
Each method makes sense in a different situation. Below is a short look at each one.
Method 1: the .htaccess file, a redirect without a plugin
The .htaccess file sits in the site's main folder on Apache and LiteSpeed servers. One line is enough for one address:
Redirect 301 /old-offer/ https://yoursite.com/offer/
Where you put it matters. WordPress manages the part of the file between the # BEGIN WordPress and # END WordPress markers and can overwrite it when permalink settings are saved. Your own rules go above that block. The syntax of the rule is described in the Apache documentation for the Redirect directive.
This method is the fastest for the server and works even with every plugin deactivated. It has two drawbacks for an owner, though. A typo in the file can show an error on the whole site, and Nginx servers have no .htaccess file at all. So leave this job to the person who looks after the site.
Method 2: the Redirection plugin
Redirection is one of the most popular free redirect plugins. After installing it you will find it in the Tools menu. You enter the old address and the new one, choose the 301 code and save. The plugin also keeps a log of 404 errors, so you can see which addresses are worth redirecting.
It is a good choice when you don't have another SEO plugin with redirects. The plugin won't check for you whether the target works or whether you are creating a redirect chain, so after saving, open the old address in a private window.
Method 3: the redirections module in Rank Math
If you use Rank Math, you don't need a separate plugin. You turn the redirections module on in the Rank Math module list, and it shows up once the plugin is switched to advanced mode. Step-by-step instructions are in the Rank Math knowledge base.
Rank Math lets you set a redirect for an exact address or for all addresses containing a given fragment. The second option is handy for big changes, but it is easy to redirect too much with it. Start with exact addresses.
Before you set up a redirect: five steps
Whatever the method, these steps protect you from the most common mistakes.
- Write down the address pairs. The old address and the new one, one under the other. Without this list it is easy to redirect something to a page that will also change its address next month.
- Check that the target works. Open the new address in a private window. A redirect to a page with a 404 error fixes nothing.
- Check that there is no content at the old address today. A redirect will hide a working page and nobody will notice.
- Avoid chains. If A already leads to B and you are moving B to C, change A so that it leads straight to C.
- Keep rules in one place. When you have Redirection and Rank Math at the same time, choose one tool and move the rules into it.
Method 4: a redirect with the chat and the TellMyShop plugin
The TellMyShop plugin for WordPress and WooCommerce has its own redirects. You ask for them in the conversation, your chat (Claude or ChatGPT) prepares a preview, and you approve it. Before saving, the chat checks whether the target works, whether a loop or chain would be created and whether there is working content at the old address today. It also shows whether another redirect mechanism is active on the site, for example Redirection or Rank Math, so that rules are not duplicated.
You: I changed the address of the Services page to Garden design. Set up a redirect from the old address.
Your chat: Redirect preview:
The target works, there is no content at the old address today, no chain is created. The Rank Math redirections module is also active on the site, but it has no rule for /services/. Save?
You: Yes.
Your chat: Saved. The old address now responds with a 301 code and leads to the new page. You can undo the redirect from the change history.
old version: /services/ → 404 error
new version: /services/ → 301 to /garden-design/
In the free TellMyShop Free the chat shows the list of addresses with a 404 error, the existing redirects and an “old address → new address” plan. Saving needs TellMyShop Pro. Then the chat sets up to 50 redirects in one batch, with a 301, 302 or 307 code, or 410 for content removed for good. When in TellMyShop Pro you change the address of a published post, page or product in the conversation, the plugin adds a 301 redirect from the old address by default. This also covers pages, where WordPress does not do it.
One honest caveat, shared by all plugins: TellMyShop redirects work as long as the plugin is active. When you are planning a big site move, talk to the site's caretaker about server rules.
You will find the details on the TellMyShop for WordPress and WooCommerce page, and prices on the pricing page.
Which method to choose
If you have one or two redirects and use Rank Math, set them in Rank Math. If you don't have an SEO plugin with redirects, Redirection is enough. Leave the .htaccess file to the site's caretaker, especially when moving a whole domain. The chat helps when there are more addresses, you don't know where each one should lead, or you want the targets checked before saving.
When the site has disappeared from Google after the changes, see the guide WordPress site not showing in Google. You will find more posts on the blog.
Questions and answers
How do I set up a 301 redirect in WordPress without a plugin?
In the .htaccess file on the server, with one Redirect 301 line containing the old path and the new address. The rule goes above the block marked # BEGIN WordPress, because WordPress can overwrite the contents of that block. This method only works on Apache and LiteSpeed servers, and a mistake in the file can take down the whole site.
Will a 301 redirect keep my ranking in Google?
Usually yes, if the new page is the equivalent of the old one. Google treats a 301 as a signal that the new address should replace the old one in results, but the transfer takes time and the same position is not guaranteed. A redirect to a page on a different topic, for example the home page, may be treated by Google like a 404 error.
What is the difference between a 301 and a 302 redirect?
A 301 means a permanent move and tells Google to show the new address. A 302 and a 307 mean a temporary move, for example while a page is being rebuilt, and Google may keep the old address in its results. For a permanent address change, choose 301.
Can I have the Redirection plugin and Rank Math redirects at the same time?
You can, but it is better to keep redirects in one place. Two tools with rules for the same address can create a chain or a loop, and when you look for the error you don't know which one fired. Rank Math lets you import rules from Redirection.
What happens to redirects when I deactivate the plugin?
They stop working. Redirects from Redirection, Rank Math and TellMyShop only work while the plugin is active. Rules in .htaccess work independently of plugins, which is why for a big site move the site's caretaker sometimes moves them into the server file.
WordPress is a trademark of the WordPress Foundation. WooCommerce is a trademark of Automattic Inc. Claude is a trademark of Anthropic PBC. ChatGPT and OpenAI are trademarks of OpenAI. TellMyShop is not affiliated with these companies.