How to Fix 404 Errors on Your Website
Find broken links in Search Console, choose between a redirect and a plain 404, repair WordPress permalinks and copy text for your 404 page.
Published 1 December 2026
A 404 means the server replied but found no page at that address. First correct any broken link on your own site. If the page moved, use a 301 redirect to its new address. If it is gone and nothing similar replaces it, leave the 404. If many WordPress pages suddenly show 404, check the permalinks.
Five addresses, five different answers
Example with made-up addresses for a clothes shop at example.com:
/lawn-3pc/was renamed/lawn-3-piece/. It is the same product, so use a 301 redirect./eid-sale-old/has ended and nothing replaces it. Keep the 404, and remove it from your menus and sitemap./contcat/is a spelling mistake in your own menu. Correct the link to/contact/. If many people type the wrong address, you can add a redirect as well./red-khussa/is out of stock but will return. Keep the page live and say it is out of stock./random-123/never existed, and nothing important links to it. Ignore it.
Do not send every missing address to your home page. Google says a redirect to an unrelated page, such as the home page, is treated as a soft 404.
Make a list of broken links
- Open Search Console's Page indexing report and choose Not found (404). New to the tool? Use the Roman Urdu Search Console steps.
- Copy one address into the URL Inspection bar at the top. Look for Referring page. Google may have found the address there, but it may not be a direct link. It can also be empty.
- If you removed a page, make sure its address is not in your sitemap. You can check the submitted sitemap.
- On your phone, open every menu and footer link, plus your best-selling products.
- Check links outside your website: your WhatsApp catalogue, social media bios, ads, invoices and printed QR codes.
Copy this form for each address:
Broken address:
Where the link appears:
Same page has a new address (yes or no):
Choice (correct, redirect, keep 404 or ignore):
Date tested:
For the Search Console list, Google advises fixing 404s that you link to yourself or include in a sitemap. Also fix any broken link a customer can tap, even if Google has not reported it.
Redirect one moved page
Correct the link first. Then add the redirect for old messages, bookmarks and links on other sites. Use your website platform's redirect tool if it has one. In cPanel, it is Redirects under Domains.
If your site uses Apache and you must edit .htaccess, take and download a full backup first. Keep a separate copy of .htaccess too. One wrong character can stop the whole website. On a WordPress site, put this line above # BEGIN WordPress, because WordPress can overwrite anything between its own markers:
RedirectMatch 301 "^/old-page/?$" "https://example.com/new-page/"
Change three values:
old-page: everything after your domain, without the first or last/. For a product, this could beproduct/lawn-3pc. Use only letters, numbers, hyphens and the/between parts. Characters such as dots have a special meaning in this rule.example.com: your domain, withwwwif your site uses it.new-page: the working page that replaces the old one.
The rule works when the old address ends with or without /. It does not redirect other pages that start with the same words.
Open the old address in a private window. It should go straight to the new page. If you see a 500 error, put back your saved .htaccess. Hosting that uses only Nginx does not read this file, so ask your host to add the redirect.
WordPress: one new address or the whole site?
You changed one address. When you change the last part of a published post's address, called the slug, WordPress saves the old one so it can redirect visitors. This slug history does not cover normal pages, which can sit under other pages. Test the old address, and add your own 301 if it does not open the right page.
The home page works, but all posts and pages show 404. Do this in order:
- Take a full backup. Write down your current permalink setting.
- Open Settings, then Permalinks. According to WordPress, opening this screen refreshes its link rules. Test a broken page now.
- If it still fails, click Save Changes without choosing a different setting. Read the message at the top.
- If it says you should update your
.htaccess, WordPress could not edit the file. Send the message to your host. You can also give them the rules shown at the bottom of the screen. - If pages still fail after that, ask your host to check the server's rewrite rules.
Do not choose a different permalink style as a test. It can change your public addresses and create more broken links. For connection errors, use the website not opening checks.
A 404 page that helps a customer
Keep your normal logo and menu. Add a search box, popular products and a home link. You can copy this text:
Sorry, we could not find that page. The link may be old or have a spelling mistake. Search for the product below, go to our home page, or send us this link on WhatsApp at 92 3XX XXXXXXX.
Replace the number with yours and add the real links. Use your theme's 404 template. Do not send missing addresses to a normal page called "404".
After you publish it, enter a made-up address on your site. Use the live test in URL Inspection to confirm that it returns a real 404 status.
Common questions
What is a soft 404?
It is a page that looks missing or empty but sends a success code instead of a 404. Google may also treat a redirect to an unrelated page as a soft 404. Return a real 404, or repair the page if it should exist.
Will a few 404 errors hurt my whole website on Google?
Google says normal 404s for removed or unknown pages do not harm a site's overall indexing or ranking. The missing page can drop out of search. If an important page shows 404 by mistake, restore it.
Should I use 410 instead of 404 for a deleted product?
For indexing, Google treats both the same. A 410 generally leads to less frequent crawling. A normal 404 is fine for most small sites. If the product may return, keep the page and mark it out of stock.
Sources
- Google Search Central: troubleshoot crawling errors
- Search Console Help: Page indexing report
- Search Console Help: URL Inspection tool
- WordPress: Settings Permalinks screen
- WordPress: how old slugs are saved
- Apache: RedirectMatch