How to set up 301 redirects in WordPress
Moved, renamed or deleted a page? A redirect sends visitors and Google from the old address to the new one. Here’s when you need one, four ways to add it, and how to avoid loops and chains.
What a redirect does
A redirect is an instruction on the server: “this address has moved, go here instead”. The browser follows it in a fraction of a second, and search engines use it to move the old page’s place in their results to the new address. The number in front tells them whether the move is permanent:
| Type | Meaning | Use it for |
|---|---|---|
| 301, 308 | Moved permanently | Renamed, merged or moved pages. This is the one you want almost every time. |
| 302, 307 | Moved temporarily | A page that is coming back, such as a sale page or maintenance. |
| Meta refresh | A tag inside the page itself | Only when you can't set a server redirect. |
| JavaScript | A script that changes the address | A last resort, because search engines may never run it. |
Google’s own advice is to use a permanent server-side redirect whenever possible, and a permanent one only when you're sure you won't undo it (Google Search Central: redirects).
When you need one, and when you don't
Add a 301 redirect when:
- you change a page’s address (its “slug”), for example
/services-2/to/services/; - you merge two similar posts into one;
- you delete a page that has a clear replacement, such as an old product that has a newer model;
- you change the permalink structure, move the site to https, or move to a new domain.
You don't need one when a page is gone and nothing replaces it. Then a plain “not found” (404) or “gone” (410) is honest and normal. Don't send all old pages to the homepage: Google can treat a redirect to an unrelated page as a “soft 404”, and visitors who land on the homepage instead of what they clicked usually leave.
What WordPress already does for you
When you change the slug of a published post, WordPress remembers the old slug and sends visitors to the new address by itself. It does not do this for pages, and it doesn't help when you delete something, move a post into a page, or move the whole site. For those you add the redirect yourself, using one of the four ways below.
Way 1: a redirect plugin
The easiest way for most sites. The best-known free one on WordPress.org is Redirection by John Godley: 2+ million active installs, rated 4.4 out of 5 as listed on 17 November 2026. It also logs the 404 errors visitors hit, so you can see which old addresses still get traffic.
- Install and activate Redirection (Plugins → Add New), then open Tools → Redirection and finish the short setup.
- Under Add new redirection, put the old path in Source URL (for example
/old-page/) and the new address in Target URL. - Open the options and make sure the code is 301 – Moved Permanently, then save.
- Open the old address in a private window and check you land on the new page.
Already use an SEO plugin? Rank Math has a redirect manager in its free version. In Yoast, the redirect manager is part of Yoast SEO Premium. One redirect tool is enough, so don't run two.
Way 2: the .htaccess file
Most shared hosts in India run Apache or LiteSpeed, which read a file called .htaccess in the site’s main folder. A redirect there runs before WordPress even loads. Open the file with your host’s File Manager, download a copy first, and add lines like these above the line # BEGIN WordPress:
# Single page
Redirect 301 /old-page/ https://www.example.com/new-page/
# A whole folder, keeping the rest of the address
RedirectMatch 301 ^/blog/(.*)$ https://www.example.com/articles/$1
Replace example.com with your domain. One wrong character here can take the whole site down with a “500 Internal Server Error”. If that happens, upload the copy you saved and the site comes straight back.
On an Nginx server there is no .htaccess file. The rule goes in the server configuration instead, for example location = /old-page/ { return 301 /new-page/; }. On most hosts only the host's support team can change that file, so ask them.
Way 3: Cloudflare redirect rules
If your domain runs through Cloudflare, you can redirect before the visitor even reaches your host. In the Cloudflare dashboard open your domain, then Rules → Redirect Rules, and create a rule: when the URL path equals /old-page/, redirect to the new address with status code 301. This is useful when the old site is already gone, for example after moving from another platform to WordPress. The free plan includes a limited number of rules.
Way 4: your hosting control panel
Hosts that use cPanel have a Redirects page (under Domains). Choose Permanent (301), choose the domain, type the old path and the new address. cPanel writes the rule into .htaccess for you. It's handy for one or two redirects, but harder to keep track of than a plugin once you have many.
Check that it works
- Open the old address in a private window, so your browser’s cache can't fool you.
- Check the type and the number of hops. On a Mac or Linux terminal run
curl -I https://www.example.com/old-page/. You should see301and alocation:line pointing straight at the final address, with no second redirect after it. - Update your own menus and links to the new address, so your visitors don't go through the redirect at all.
- In Google Search Console, inspect the new address and request indexing if it's an important page.
Mistakes to avoid
- Chains. A → B → C. Point A straight at C. Every extra hop slows the visitor down.
- Loops. A → B and B → A. The browser shows “too many redirects” and gives up. This usually happens when the same redirect is set in two places, such as a plugin and Cloudflare.
- 302 for a permanent move. Search engines then keep showing the old address.
- Everything to the homepage. Send each old page to its closest new page, or let it 404.
- Removing redirects too soon. For a site move, Google says to keep redirects for generally at least a year (Google: site moves). Links on other sites keep sending visitors for much longer, so on a small site there's no harm in keeping them for good.
Redirects and broken links go together: a redirect fixes the old address, and a link check finds the addresses that still need one. See how to find and fix broken links in WordPress.
Common questions.
Something else? Message us on WhatsApp and talk to the developer directly.
Do redirects slow down my site?
Only a little, and only for the visitor who follows the old address: one extra round trip to the server. That is why chains of several redirects are worth fixing, and why you should update your own links to the new address.
Does a 301 keep my Google ranking?
Google treats a permanent redirect as a strong sign that the new address should replace the old one in its results. Expect some movement for a few weeks while Google catches up, especially on a whole-site move.
How many redirects is too many?
A plugin copes well with hundreds. If you have thousands, for example after moving a big shop, put pattern rules in .htaccess or at Cloudflare instead of one line per page.
Should I redirect a deleted product to the category?
If the category is where a shopper would sensibly go next, yes. If nothing similar exists, let it return 404 or 410.
Can you set up redirects for my site move?
Yes. We map every old address to its new one, set the redirects, check them in bulk and fix the links on your site. Message us on WhatsApp for a free quote.
Moving or rebuilding your site?
We map every old address to its new one, set the redirects and check them all, so you keep your visitors and your Google listing. Free review and a clear quote. Open every day, 9am–5pm.
More guides
How to find and fix broken links in WordPress
Four ways to find dead links, what each error code means, and how to fix every kind.
Shopify or WooCommerce for an Indian business
Real monthly costs in rupees, payment fees, GST and who looks after what.
Services