Home / Fix guides / Broken links, errors and uptime

How to fix a 404 page not found error on your website

A 404 error means the address a visitor asked for has no page behind it. Fix it by restoring the page, redirecting the old address to the right new one, or correcting the link that points to it.

A 404 error means a visitor asked your server for a page and the server could not find it. The server itself is working, but that specific address has nothing behind it. Most 404s come from a deleted or renamed page, a mistyped link, or a changed web address. You fix them by bringing the page back or sending the old address to the right new page.

What people see

Visitors see a message such as '404 Not Found', 'Page not found' or 'This page can't be found'. It may be a plain browser page or a branded page with your menu and logo. The wording changes from site to site, but behind the scenes the server sends the status code 404.

Some sites show a friendly 'not found' message but send the code 200 (OK) instead. Search engines call this a soft 404, and it is worth fixing too, because it confuses them about which pages really exist.

Why it matters

  • Lost visitors and sales: someone clicking an ad, an email link or a search result lands on a dead end, and most will leave rather than hunt for the page.
  • Search: Google eventually drops pages that stay 404 from its results. A few 404s are normal and do not harm the rest of your site, but a page that used to bring in traffic and now shows an error loses that traffic, along with the value of any links other sites pointed at it.
  • Trust: broken pages make a business look neglected, especially in the middle of a purchase or enquiry.
  • Security noise: automated bots constantly request random addresses, so some 404s in your logs are harmless. A sudden large spike is worth a look.

Common causes

  • A page or product was deleted or unpublished.
  • A page address (URL) was changed without a redirect, for example after editing a page title or slug.
  • A link was typed wrong in a menu, email or social post.
  • The site was redesigned, moved to a new platform or a new domain, and the old addresses were not carried over.
  • On WordPress, the permalink rules got out of sync, so many pages 404 at once while the content still exists.
  • A file or image was removed from the server but is still used on a page.

How to check your site for free

  1. Click through it yourself. Try the main menu, footer, buttons and your most important landing pages.
  2. Google Search Console. If your site is verified, open the Pages report and look for the reason 'Not found (404)'. It lists addresses Google tried and failed to load.
  3. Your analytics. Look at your pages report for page titles like 'Page not found' and see which addresses were requested and where visitors came from.
  4. A crawler. The free version of Screaming Frog SEO Spider crawls up to 500 addresses and lists every one that returns 404. Many free online link checkers do the same for small sites.
  5. A quick status check. In a terminal, run curl -I https://example.com/some-page and look at the first line. 404 means not found, 200 means found. Your browser's developer tools (Network tab) show the same code.
  6. Server logs. Your hosting panel may offer access logs or an error log. Filter for 404 responses and sort by how often each address is requested.

Also check that your site has a helpful error page. See no custom 404 page.

How to fix it

Go through each broken address and pick the right action:

  1. The page should exist: restore or republish it, or fix the setting that hid it (draft, private, out of stock).
  2. The page moved or was replaced: add a 301 (permanent) redirect from the old address to the closest matching page.
  3. The page is gone for good with no replacement: let it return 404 (or 410 Gone), and make sure your 404 page offers a search box, your main links and a contact option.
  4. A link is wrong: correct it where it appears. If it is on someone else's site, you can ask them to update it, or just redirect the address it points to.

Avoid redirecting everything to your home page. Visitors are confused when they land somewhere unrelated, and Google may treat it as a soft 404.

On an Apache server, a redirect can be added to the .htaccess file in your site's main folder:

Redirect 301 /old-page https://www.example.com/new-page

Back up the file before editing it, because a typo can take the whole site down. If you are not comfortable editing server files, use the redirect tool your platform provides.

Where to fix it on common platforms

Menu names change between versions and themes, so treat these as starting points.

PlatformWhere to look
WordPressSettings, Permalinks, then click Save Changes to refresh the rules. Redirects usually need a redirect plugin or your SEO plugin.
ShopifyOnline Store, Navigation, then URL Redirects.
WixSEO tools, then URL Redirect Manager.
SquarespaceSettings, then Developer Tools, URL Mappings (location varies by version).
WebflowSite settings, Publishing, 301 redirects.
Next.jsThe redirects setting in next.config.js, plus a not-found page.
Apache or NginxRedirect rules in .htaccess or the server configuration.

For step by step help on WordPress, see the WordPress 404 guide. Guides for the other platforms are in the same section of this site.

How to confirm the fix worked

  • Visit each repaired address in a private browser window and check that it loads the right page.
  • Run curl -I on redirected addresses. You should see 301 and the new location, then 200 at the destination.
  • Re-run your crawler and check that the list of 404s has shrunk to the ones you chose to leave.
  • In Search Console, open the 404 entry and use Validate Fix. Google rechecks over days or weeks, so do not expect an instant change.

How to stop it coming back

  • Before changing or deleting a page address, add a redirect. Make this a habit for anyone who edits your site.
  • Keep a list of old addresses during a redesign or migration and redirect each one before launch.
  • Check links after big edits, such as new menus, new products or a new theme.
  • Watch for links to other websites that die over time. See broken external links.
  • Run a regular sweep. SiteMonday does this in week 6, the broken links and 404 sweep. The written report and ranked fix list show which addresses are broken, so you or your developer know what to fix first.

Some 404s will always appear, because people mistype addresses. The goal is that none of your real links, ads or search results lead to one.

Step by step for your platform

Questions

Do 404 errors hurt my Google ranking?

A few 404s on a site are normal and do not lower the ranking of your other pages. The harm comes when pages that earned traffic or links start returning 404, because that value is lost until you redirect them.

Should I redirect every 404 to my home page?

No. Redirect each old address to the most relevant new page, and let truly removed pages show a helpful 404 page. Mass redirects to the home page confuse visitors and can be treated as soft 404s.

Why does my page show 404 when it exists in my dashboard?

It may be set to draft or private, its address may have changed, or on WordPress the permalink rules may need refreshing. Saving the permalink settings without changing anything often fixes this.

What is the difference between 404 and 410?

A 404 says the page was not found, while a 410 says it was removed on purpose and will not return. For most small sites, 404 is fine for deleted pages.

How long until Google stops reporting a fixed 404?

It depends on how often Google revisits the address, and can take days to a few weeks. Using Validate Fix in Search Console can prompt a recheck.

Is a 404 error a sign my site was hacked?

Usually not. It is most often a deleted page or broken link. If many pages vanish suddenly, or you see unfamiliar pages or redirects, check with your host or developer and restore from a backup.

Related problems