You delete a product, change a category name or rebuild the store structure. The old address stops working, the customer lands on a "Page not found" message, and Google keeps trying to visit the outdated URL.
In such a situation an idea often comes up: "Let's redirect everything to the home page." It is simple, but usually the wrong solution. A 301 redirect should lead to a page that genuinely replaces the deleted product, category or article.
In this guide we explain when to set up a 301 redirect, when to leave a 404 error, what to do with a discontinued product, and how to find incorrect addresses in a WooCommerce store.
In short
Set up a 301 redirect when the old address has a new, thematically matching equivalent. That can be the new address of the same product, the successor of a discontinued model, or a category that replaced an earlier category.
Leave the 404 code when a page has been permanently removed and there is no sensible replacement. A 404 error itself is not an SEO problem if it is intentional and applies to an unneeded address.
The problem starts when an important product returns a 404 by mistake, a deleted category is still in the menu, an old address has external links but was not redirected, all errors are automatically directed to the home page, redirects create chains or loops, or a page looks like a 404 error but technically returns a 200 code.
The short version (TL;DR)
- A 301 redirect means a page has been permanently moved to a new address.
- A 404 error is correct if the subpage really does not exist and there is no suitable replacement.
- A discontinued product does not always have to be deleted — sometimes it is worth keeping its page and showing alternatives.
- Do not redirect all deleted products to the home page or to one broad category.
- After changing addresses, also fix the menu, internal links, sitemap and product data.
- It is worth monitoring errors in Google Search Console and with a technical scan of the store.
What is a 301 redirect?
A 301 redirect tells the browser and search engine robots that a given address has been permanently moved somewhere else.
Old address:
store.com/category/face-creams/
New address:
store.com/face-care/creams/
After setting up a 301 redirect, a person visiting the old URL is automatically taken to the new address. The redirect is also a signal to Google: the previous page should no longer function as a separate result, because it has been replaced by the new one.
When should you use a 301 redirect? The most common situations in a WooCommerce store are a product address change, a category address change, merging two categories into one, a change to the permalink structure, moving the store to a new domain, a migration from PrestaShop/Shopify/Shoper or another platform, replacing an old product with a newer model, and correcting a faulty address that links point to. The redirect should lead to a page that matches the user's intent. If someone opens the address of a cream for dry skin, a redirect to the general "Cosmetics" category will be too broad — a better target will be the new version of the product or the dry-skin cream category.
What is a 404 error?
The 404 code means that the server is working, but there is no page at the indicated address.
It can appear when a product has been deleted, its address has changed, the customer typed a URL with a mistake, an old link is still in an article or menu, a product import created incorrect addresses, a plugin changed the permalink rules, the WordPress rules were not refreshed after an update, or a category or product attribute was removed.
Not every 404 error needs fixing. If someone types a random address such as store.com/product-does-not-exist-123/, a 404 response will be correct. The situation is different when the error appears at the address of a product that is still in the menu, a Google Ads ad or the search results — then the customer hits a dead end, and the problem can directly hurt sales.
Do 404 errors harm a store's SEO?
Individual, justified 404 errors do not automatically mean a positioning problem.
In an online store products appear and disappear. Some collections are seasonal, some models are discontinued, and old variants stop being available. It is therefore natural that not all addresses stay active for many years. The problem is above all the chaos around 404 errors, for example: hundreds of internal links lead to non-existent products, the XML sitemap still contains deleted addresses, valuable pages with external links return 404, product ads lead to inactive pages, no redirect map was made after a migration, Google regularly hits thousands of broken URLs, or the customer has no way to move on to a similar product. So you have to distinguish a correct 404 error from one that was caused by a failed technical change.
301 redirect, 404 code or keeping the product?
The decision depends on what happened to a given page.
| Situation | Recommended action |
|---|---|
| Only the address of the same product changed | 301 redirect to the new address |
| The product has a direct successor | 301 redirect to the successor |
| Two similar categories have been merged | 301 redirect to the new category |
| The product is temporarily unavailable | Keep the product page active |
| The product was discontinued, but the page has traffic or useful content | Keep the page with alternatives |
| The product was deleted and there is no equivalent | 404 or 410 code |
| The address was created by a typo and links point to it | 301 redirect to the correct address |
| Unknown, random URL | 404 code |
| The store domain or platform was changed | Old URL → new URL redirect map |
The worst solution is applying a single rule to all cases.
What to do with a temporarily unavailable product?
A temporary lack of a product is not a reason to delete its page or set up a redirect.
If the goods return to sale, keep the address active with a 200 code and show the customer information about the lack of availability, the option to sign up for a notification, the expected delivery date (if known), similar products, other colour or size variants, and a link to the parent category. Example: the product store.com/aloe-moisturising-cream-50-ml/ is due to return in two weeks. Deleting the product and setting up a 404 would mean a needless loss of a working page — it is better to keep the URL and display a message:
The product is temporarily unavailable. Leave your email address and we will notify you when it is back in stock.
A redirect will only be needed once the product is permanently discontinued and gets a direct successor.
What to do with a permanently discontinued product?
In the case of a product that will not return to sale, you have three main options.
The product has a direct successor. If the manufacturer replaced the model with a new version, you can set up a 301 redirect:
Old product:
store.com/aloe-cream-50-ml/
New product:
store.com/aloe-cream-plus-50-ml/
Condition: the new product really should replace the old one. It is not enough that both are in the same broad category.
The product has no successor, but its page is still useful. Some discontinued products are still being searched for — customers may look for instructions, ingredients, dimensions, compatible accessories or information about replacements. In such a situation you can keep the page active and clearly mark it "The product has been discontinued", and below the message show the closest replacements, products from the same series, the current category, answers to the most common questions and the option to contact support. This solution makes particular sense when the page has traffic, external links or helps customers after a purchase.
The product has no successor and no valuable content. If the page has no traffic, no links and no sensible equivalent, a correct 404 or 410 code will be better than a random redirect. At the same time you have to remove the product from the menu and categories, remove its address from the sitemap, fix internal links, exclude it from advertising campaigns, remove or update the address in the product feed, and check that no banners or automated messages link to it.
This article focuses on the mechanics of the 301, 404 and 410 codes and on preparing a redirect map. The broader decision about which product, filter and category pages should stay in Google's results is described in our guide on the indexing of a WooCommerce store.
404 vs 410 — what is the difference?
The 404 code means "page not found at this address", while the 410 code means "the page was intentionally and permanently removed".
The 410 code can be used for addresses that are known to have been definitively removed and will not return. You do not, however, have to change every correct 404 error into a 410 — it is much more important that the server really returns the right code, and that the deleted address does not remain in the sitemap and internal linking.
What is a soft 404?
A soft 404 appears when a page looks like an error, but the server returns a 200 code, that is information that everything is working correctly.
Example: the customer opens a non-existent product, sees the message "Product not found" on the screen, and the server returns a 200 code instead of a 404. For a search engine the situation is unclear — on the one hand it gets a correct server response, and on the other it sees an empty or broken page. A soft 404 can also arise when all non-existent products are automatically redirected to the home page; the home page does not match what the user was looking for, so such a redirect may be considered unhelpful.
How to check the response code? You can use the URL inspection tool in Google Search Console, the "Network" tab in the browser's developer tools, a site-scanning program, an online HTTP code tester or the curl command:
curl -I https://store.com/non-existent-product/
A correct response for a non-existent page can look like this:
HTTP/2 404
And for a permanent redirect:
HTTP/2 301
location: https://store.com/new-product/
The most common redirect cases in WooCommerce
Changing a product name or address. Let's assume the product address looked like this: store.com/product/aloe-face-cream/, and after a name change it was shortened to store.com/product/aloe-cream/. The old URL should be redirected with a 301 code to the new one. Simply saving the new slug in WordPress is not always enough — WordPress can handle some changes to old addresses, but you should not base your entire store strategy on that, especially with products, categories, imports and migrations.
Deleting a product category. The store had a category store.com/product-category/winter-creams/, which was merged with store.com/product-category/moisturising-creams/. If the new category covers the products and intent of the old one, set up a 301 redirect. If the category was deleted without a replacement, do not direct it automatically to the home page — consider a 404 code or a redirect to a genuinely similar parent category. For a larger category rebuild, the guide on the architecture of WooCommerce categories for SEO will be helpful.
Changing the permalink structure. In WooCommerce you can change the base of product and category addresses, e.g. store.com/product/product-name/ to store.com/shop/product-name/. Such a seemingly small change can affect all products — with 5,000 products that means potentially 5,000 old addresses requiring handling. That is why the address structure should not be changed without:
- exporting the current URLs,
- preparing the new URLs,
- creating an old → new map,
- setting up the redirects,
- fixing the internal links,
- generating a new XML sitemap,
- checking the store after deployment.
If you are planning a larger rebuild, also use the checklist on migrating a store without losing rankings.
Migrating a store to WooCommerce. During a migration the old product address might look like this: oldstore.com/en/p/Aloe-Cream-50-ml/123, and in WooCommerce: newstore.com/product/aloe-cream-50-ml/. The redirects have to be prepared on the basis of the real map of products, categories and content — it is not enough to redirect the whole old domain to the home page of the new store. For larger projects, migration to WordPress and WooCommerce should also include tests of redirects, the sitemap, SEO data and indexing.
Incorrect addresses in internal linking. Sometimes the product page works, but a link in an article leads to the old URL (article → old URL → 301 redirect → current product). The user ultimately reaches the right place, but the store performs an unnecessary redirect. It is better to fix the link directly (article → current product). It is worth keeping the redirect for old external links and saved addresses, but your own menu, banners, breadcrumbs and articles should lead straight to the final URL.
How to prepare a redirect map?
A redirect map is a table showing where each old address should lead.
| Old address | New address | Code | Reason |
|---|---|---|---|
/product/aloe-cream/ | /product/aloe-cream-plus/ | 301 | New model |
/category/winter-creams/ | /category/moisturising-creams/ | 301 | Category merge |
/product/old-set/ | None | 404 | No replacement |
/promo-spring-2024/ | /promotions/ | 301 | Permanent promotions section |
Step 1. Collect the old addresses. The sources can be an export from the old store, the previous XML sitemap, Google Search Console, analytics data, the final addresses of advertising campaigns, SEO tools, server logs, copies of an earlier version of the site and the WooCommerce database. Do not base the map solely on the current menu — Google may know pages that have long since stopped being visible in the navigation.
Step 2. Determine the new equivalent. For each important address, answer the question: which current page best fulfils what the person visiting the old URL was looking for? Priority: (1) the same product at a new address, (2) the product's direct successor, (3) a very similar product, (4) the matching category, (5) a 404 or 410 code if there is no sensible destination.
Step 3. Set priorities. First deal with addresses that generated traffic, have external links, led to important products or categories, still appear in Google results, are used in ads or are found in emails and promotional materials. Only afterwards analyse random URLs with no traffic and no links.
Step 4. Implement the redirects. They can be set up with a WordPress plugin, in the server settings, in the .htaccess file on an Apache server, in the Nginx or OpenLiteSpeed configuration, with custom code or in the CDN/proxy layer. For a small store and individual changes a proven plugin is usually enough; with several or several tens of thousands of rules a server-side solution or a prepared import mechanism may be better.
Step 5. Test each group of addresses. Check whether the old address returns a 301, whether it leads to the right place, whether the target page returns a 200, whether there is no further redirect, whether no loop was created, whether the HTTPS version works, whether parameters do not create unforeseen redirects, and whether the cart and order checkout still work correctly.
How to set up a 301 redirect in WooCommerce?
WooCommerce does not have a separate, advanced panel for managing all redirects. Most often you use solutions available for WordPress or the server configuration.
Method 1. A redirect plugin. This is the simplest option for individual and regularly added rules. Typically you provide:
Source address:
/product/old-cream/
Target address:
/product/new-cream/
Type:
301 – permanent redirect
After saving, open the old address in incognito mode and check where it leads. Before installing another plugin, check whether the SEO tool or redirect management system you use does not already have such a function — two plugins setting rules for the same addresses can cause conflicts.
Method 2. A rule in the .htaccess file. On an Apache server an example rule might look like this:
Redirect 301 /product/old-cream/ https://store.com/product/new-cream/
The .htaccess file contains some of the server settings — editing it incorrectly can cause an error on the whole site or a redirect loop. Before making a change, back up the file, check which server runs the store, make sure you have access to the hosting and test larger rules in a staging environment.
Method 3. Server or CDN configuration. With a large number of rules, redirects can be handled at the level of Nginx, OpenLiteSpeed, the hosting panel, Cloudflare, a reverse proxy or a dedicated mechanism implemented by a developer. Such a solution can be more efficient, but it requires technical control and documentation. The rules should not be scattered across several plugins, the hosting panel and the CDN configuration, because it later becomes hard to determine why a given address behaves in a particular way.
The most common mistakes with redirects
Redirecting everything to the home page. The address of an old cream, lamp or wardrobe should not automatically lead to the home page. The customer expects a specific product, and instead sees the general store page and has to start the search again. If there is no suitable replacement, an honest 404 message with a suggestion for further navigation may be better.
Redirecting to an unrelated product. An old moisturising cream should not lead to a scrub just because both products belong to cosmetics. The redirect target should be thematically consistent, useful for the user and as close as possible to the old page.
A redirect chain arises when one address redirects to another, and that one to the next:
A → B → C → D
It is better to set up:
A → D
B → D
C → D
Thanks to this the user and the search engine robot reach the final page straight away.
A redirect loop looks like this:
A → B → A
The browser cannot open the page and shows a message about too many redirects. Loops often arise after switching HTTP to HTTPS, changing the domain from www to the version without www, a conflict between a plugin and the server rules, changing product addresses or an incorrect CDN configuration.
Using a temporary redirect instead of a permanent one. The 302 code means a temporary change, while a 301 is used when the old address has been permanently replaced. This does not mean that every 302 code is a mistake — it can be appropriate for a temporary promotion page, tests or a short-term change. For a permanent change to a product or category address, however, the right choice is usually a 301.
Leaving redirected URLs in the sitemap. The XML sitemap should contain current, canonical addresses that are meant to appear in Google. It should not include addresses returning 404, redirecting addresses, old versions of products, random parameters or pages excluded from indexing. If the sitemap still contains the old URL, you are sending conflicting signals: on the one hand you indicate that the address is important, and on the other you redirect it somewhere else.
Automatically redirecting similar addresses. Some mechanisms try to guess the target page based on part of the name — e.g. /aloe-cream-50-ml/ is automatically redirected to /aloe-gel-500-ml/. The names are similar, but the products have different uses. Automatic matches have to be controlled, not treated as a substitute for a correct redirect map.
What should a good 404 page in a store look like?
A 404 page does not have to be a dead end. It should clearly say: "We did not find a page at this address. The product may have been discontinued or the address may have been changed".
Then it is worth showing a product search, a link to the most important categories, popular products, recently viewed products, contact details, the option to return to the cart and a simple button to go back to the store. Do not hide the error behind a generic message — the customer should know that the opened address does not exist. At the same time the page must technically return a 404 code, not a 200.
How to find 404 errors in a WooCommerce store?
Addresses with errors are best analysed on the basis of the sources gathered earlier while creating the redirect map.
Google Search Console. In the page indexing report you can find, among other things, "Not found (404)", "Soft 404", pages with a redirect and addresses that were crawled but not indexed. Do not automatically fix every address from the report — for each example check: where Google knows this URL from, whether the page should still exist, whether it has an equivalent, whether internal links point to it, whether it is in the sitemap and whether it has traffic or external links. If an address should return a 404, you do not have to redirect it just to make it disappear from the report.
Technical scanning of the store. A site-scanning program can crawl the links similarly to a search engine robot and point out links leading to 404, 301 and 302 redirects, redirect chains, loops, incorrect canonicals and redirected addresses found in the XML sitemap. The most important report is usually the list:
Source page → broken link → response code
Thanks to this you know not only which URL does not work, but also where the link that needs fixing is located.
Campaigns, integrations and server logs. Also check the final addresses of Google Ads, products rejected in Google Merchant Center, links in email campaigns, abandoned-cart messages, links in QR codes, addresses passed to marketplaces and the server logs. A 404 error on a random page with no traffic is usually less urgent than a broken address used in a paid campaign.
The order of fixing errors in a store
Not all errors have the same priority.
Priority 1 — problems affecting sales. First fix broken products from ads, errors in the cart and order checkout, inactive category pages with a lot of traffic, faulty links in the menu, campaign landing pages and addresses with valuable external links.
Priority 2 — errors in the store structure. Then fix links from articles, breadcrumbs, redirected URLs in the sitemap, redirect chains, outdated links in category descriptions and faulty addresses of variants and attributes.
Priority 3 — random addresses. Finally analyse URLs created by bots, containing random character strings, with non-existent parameters, arising from users' manual typos and with no traffic, no links and no presence in the store structure. Such addresses most often do not need to be redirected.
What can you check yourself?
1. Test the most important store addresses — your best-selling products, the main categories from the menu, pages used in ads, links from banners and products whose addresses were recently changed. Each of these pages should return a 200 code or lead with a single redirect to the right place.
2. Open a sample non-existent address, e.g. store.com/test-of-a-non-existent-page-12345/. Check whether you see a clear message, whether you can move on to a category, whether the search works, whether the page returns a 404 code and whether there is no redirect to the home page.
3. Check old addresses after recent changes. If you changed product names, slugs or categories, open the earlier URLs. The old address should redirect directly to the right page, return a 404 or 410 if there is no replacement, and not lead through several successive redirects.
4. Make a backup before deploying changes. Before installing a plugin, changing permalinks or editing .htaccess, back up the files and the database. With a live store, test larger changes in a staging environment, not directly on the production site.
When is it worth hiring a specialist?
Technical help is advisable when traffic dropped after a migration, the store has thousands of products or redirects create loops.
Consider support when traffic from Google dropped after a migration, the store has thousands of products and categories, the structure of all addresses was changed, Search Console shows a large number of unknown errors, redirects create loops, products sometimes work correctly and other times return a 404, the problem appeared after a WooCommerce update, the sitemap contains outdated addresses, several plugins handle redirects at the same time, the server logs need to be analysed, the errors affect the cart/payments/customer account, or it is unclear which products should be redirected and which deleted.
With a larger store, simply exporting the errors from Search Console is not enough — you have to combine data about traffic, links, sales, category structure and the current range. As part of a technical SEO of the store you can check not only 404 errors, but also redirects, the XML sitemap, canonicals, internal linking and indexing problems. If the errors regularly return after updates or product changes, the solution may also be ongoing technical maintenance of WordPress and WooCommerce.
Frequently asked questions
Does every 404 error have to be redirected?
No. If a page has been permanently removed and there is no suitable replacement, the 404 code is correct. Redirects are needed above all for important addresses that have been moved or replaced.
Can a deleted product be redirected to a category?
Yes, but only when the category is closely enough related to the product and will be useful to the customer. A product's direct successor is usually a better target.
Is redirecting to the home page good for SEO?
Most often no. The home page usually does not match what the person visiting a specific product was looking for. Mass redirects to the home page can be unhelpful for customers and the search engine.
What to do with a product that will return to sale?
Keep the product page active. It is worth showing information about the lack of availability, a notification option and similar products.
How long should 301 redirects be kept?
For permanent address changes it is best to keep them long term. Old links may still be in articles, messages, customers' bookmarks and external services.
Does changing a product name always change its URL?
No. A product's name and slug can be edited separately. Before saving changes, check whether WooCommerce also changes the address and whether the old URL still works.
Where can you find 404 errors in WooCommerce?
It is best to combine data from Google Search Console, a technical scan of the store, advertising campaigns and server logs. The Search Console report alone does not show all the sources of broken links.
What is the difference between a 404 error and a soft 404?
With a correct 404 error the server returns a 404 code. A soft 404 looks like a missing page, but technically returns a 200 code or leads to an unrelated page.
Order matters more than the number of rules
Use a 301 redirect when the old address has a real and thematically matching equivalent. If a page has been removed without a successor, a correct 404 or 410 code is better than redirecting the user to a random place. The most important thing is to keep order: one current version of the address, direct redirects, fixed internal links and a sitemap without deleted URLs.
If 404 errors appeared in your WooCommerce after a migration, a category change or a bulk product edit, we can check which addresses need a redirect, which should stay deleted and where the store still links to outdated pages. Instead of redirecting everything to the home page, as part of a technical SEO of the store we will prepare a specific map of changes and show what affects sales, indexing and customer convenience.