
Learning how to fix 404 errors and set up 301 redirects properly comes down to two decisions: which broken URLs actually deserve a redirect, and where each one should point. A 404 status code tells browsers and crawlers that a page does not exist, while a 301 tells them the page moved permanently to a new address. Get the mapping right and you keep rankings, links and traffic; get it wrong and you create redirect chains, soft 404s and frustrated visitors.
Most guides tell you to redirect everything. That is the fastest way to build a tangled mess of hops that slows crawling and dilutes signals. Below is the triage system we use on client audits, plus the exact setup steps for WordPress, Apache, Nginx and hosted platforms.
What a 404 Error Actually Means
A 404 is a client-side HTTP status code meaning the server was reached but could not find anything at the requested URL. It is normal, expected, and part of how the web works. According to MDN’s HTTP status documentation, a 404 does not indicate whether the absence is temporary or permanent, which is why Google treats these URLs as candidates for removal from the index.
Compare that to the codes you will see in the same report:
- 404 Not Found: the URL is gone and the server offers no replacement.
- 410 Gone: the URL is deliberately and permanently removed, a slightly stronger signal that speeds deindexing.
- 301 Moved Permanently: the resource now lives at a different URL, and ranking signals should follow it.
- 302 Found: a temporary move, so the original URL stays indexed.
- Soft 404: the page returns a 200 OK but the content is empty, thin or says “not found,” which confuses crawlers more than a real 404 does.
Soft 404s are the sneaky ones. An empty category archive, a sold-out product page with no body copy, or a JavaScript route that renders a blank shell will all get flagged, and Google may drop legitimate pages nearby as a result.
Are 404 Errors Bad for SEO?
Not inherently. Google has said repeatedly that 404s do not cause a site-wide ranking penalty, and a site with a few hundred dead URLs from deleted spam comments is fine. The damage happens in three specific situations, and those are the ones worth your afternoon.
- The dead URL has backlinks. Every external link pointing at a 404 wastes equity that could flow to a live page.
- The dead URL still gets traffic or clicks. If Search Console shows impressions in the last 90 days, real people are landing on nothing.
- Internal links point to it. Broken internal links waste crawl budget and send visitors into dead ends, which is a fixable self-inflicted wound.
Everything else, expired job listings, old event pages, test URLs, parameter junk, can simply stay a 404 or become a 410. Redirecting them all to your homepage is worse than doing nothing, because Google usually treats an irrelevant homepage redirect as a soft 404 anyway.
Step 1: Find Every 404 on Your Site
Pull data from at least three sources, because no single tool sees everything. Crawlers find internal broken links, Search Console finds what Google tried to fetch, and server logs find what real users and bots request.
- Google Search Console: open Pages under Indexing and filter for “Not found (404)” and “Soft 404.” Export the full list, not just the sample.
- A site crawler: Screaming Frog (free up to 500 URLs), Sitebulb or Ahrefs Site Audit will surface internal 404s and tell you which pages link to them.
- Backlink tools: Ahrefs’ Best by Links report filtered to 404, or Semrush’s equivalent, shows dead pages that still hold referring domains. This is the highest-value list you will export all week.
- Analytics: filter GA4 page views by your 404 template’s page title to catch URLs users reach from old emails, PDFs and social posts.
- Server logs: your host’s raw access logs reveal repeated 404 requests that crawlers never discover, often from mistyped legacy links.
Dedupe the exports into one spreadsheet with columns for URL, referring domains, last 90 days of clicks, internal links in, and your proposed action. That sheet is the whole project.
Step 2: Triage Before You Redirect
Here is the rule we apply to every row. Ask whether an equivalent page exists that would satisfy the person who clicked the original link, and answer honestly.
- Close equivalent exists: 301 to that specific page, not a category, not the homepage.
- No equivalent, but the URL has links or traffic: 301 to the closest relevant parent (a category or hub page), or rebuild a short replacement page if the topic still matters.
- No equivalent, no links, no traffic: leave it as a 404, or return 410 if you deleted it on purpose.
- Content was merged: 301 the weaker URL into the surviving one, then confirm the survivor’s canonical tag points at itself.
- Typo or case variant: 301 to the correct URL and fix the source link so the redirect is a safety net, not a permanent crutch.
One caveat on relevance: Google’s guidance on redirects and site moves makes clear that signals consolidate best when the destination genuinely replaces the original. A blog post about pergola permits redirected to a plumbing service page will not pass much of anything.
Step 3: Fix Broken Links at the Source
A 301 is a patch. If the link causing the 404 lives inside your own content, edit the link. This is the step most teams skip, and it is why some sites carry thousands of redirects that could have been ten.
Work through your crawler’s “inlinks” column and update every internal reference to the new destination, including navigation, footers, sidebars and old post bodies. While you are in there, tighten your internal linking structure so orphaned replacements actually get crawled. For external links pointing at your dead pages, a short email to the webmaster often works, and the same outreach muscle powers broken link building in reverse.
Step 4: Set Up 301 Redirects Properly
The right method depends on your stack. In all cases, implement server-level redirects when you can, because they are faster than plugin or meta refresh alternatives.
WordPress
Use Redirection (free), Rank Math, or Yoast Premium’s redirect manager. Add the source path (/old-page/), the full destination URL, and set the type to 301. WordPress also auto-redirects when you change a slug on newer versions, but do not rely on it for bulk migrations.
Apache (.htaccess)
Add a line such as Redirect 301 /old-page/ https://example.com/new-page/ near the top of the file, above any rewrite rules. Back up .htaccess first, since a syntax error takes the whole site down.
Nginx
Inside the server block, use return 301 https://example.com/new-page/; within a location match, then reload the config. Test with a staging environment when you have one.
Shopify, Wix, Squarespace and Webflow
Each has a built-in URL redirect table in settings, and all default to 301 behavior. Shopify’s is under Navigation, Webflow’s is under Publishing, and bulk CSV upload is available on most plans.
Step 5: Audit for Chains, Loops and Leaks
This is the gap most articles leave open. Redirects accumulate over years of redesigns, and each extra hop adds latency and a small amount of signal loss. Google follows up to about 10 hops, but browsers and users give up much sooner.
- Flatten chains: if A points to B and B points to C, rewrite A to point straight at C.
- Kill loops: A to B to A produces an ERR_TOO_MANY_REDIRECTS error and a page nobody can load.
- Check protocol and www consistency: an http to https hop plus a non-www to www hop is two avoidable steps in one request.
- Verify status codes with a header checker: a plugin set to 302 by default will quietly hold your rankings on the old URL.
- Remove redirected URLs from your sitemap: your XML sitemap should list only 200-status canonical URLs.
Keep 301s in place for at least a year. Google generally consolidates signals within a few weeks to a few months, but old backlinks keep sending people for years, so permanent redirects are worth the storage.
Monitoring Cadence That Prevents Repeat Damage
Broken URLs are a maintenance problem, not a one-time project. We recommend a monthly crawl for sites under 5,000 URLs and a weekly crawl for ecommerce catalogs where products go in and out of stock.
Set a Search Console email alert, review the Not found report on the first of every month, and audit your redirect table twice a year to flatten chains that crept back in. If you want the full sequence of checks that surrounds this work, our beginner’s guide to technical SEO lays out the order of operations. Also worth reading: robots.txt best practices, because blocking a redirected path stops Google from ever seeing the new destination.
Design a 404 Page That Recovers the Visit
Some 404s are unavoidable, so make yours useful. A good one returns a true 404 status, matches your site design, and offers a search box plus links to your three or four most popular pages.
Add a short human line explaining what happened, avoid dead-end humor with no next step, and track 404 views as an event in GA4 so the page becomes a data source. Small detail, real payoff: sites that add a search field and category links to their error template usually cut bounce on those sessions noticeably.
Frequently Asked Questions
How do I fix a 404 error?
Fix a 404 in one of three ways: restore the missing page, 301 redirect the URL to the closest relevant live page, or correct the broken link pointing at it. Choose based on data, redirect URLs that have backlinks or recent clicks, and leave low-value dead URLs as 404 or 410 so Google can drop them cleanly.
How to fix 301 redirects?
Most broken 301s are chains, loops or wrong destinations, and all three are fixed by editing the redirect rule to point directly at the final 200-status URL. Crawl your site with Screaming Frog, sort by “Redirect chains,” then rewrite each first hop so it lands in one step, and confirm the header returns 301 rather than 302 or 307.
What is the difference between 404 and 301 redirection?
A 404 says the requested page does not exist and offers no alternative, while a 301 says the page permanently moved and sends the visitor plus most ranking signals to a new URL. Use a 301 when a genuine replacement exists; use a 404 or 410 when the content is simply gone and nothing equivalent would satisfy the visitor.
How to configure a 301 redirect?
In WordPress, install a plugin like Redirection, enter the old path and the full new URL, and set the type to 301, which takes under a minute per rule. On Apache add Redirect 301 /old/ https://example.com/new/ to .htaccess, on Nginx use return 301 inside the server block, and on Shopify or Squarespace use the built-in redirect table in settings.
How long should I keep a 301 redirect in place?
Keep it for a minimum of 12 months, and permanently if the old URL earned backlinks. Google typically transfers signals within weeks, but referral traffic from old links, emails and PDFs can continue for years, so there is rarely a good reason to remove a working redirect.
Do 404 errors hurt my Google rankings?
404 errors alone do not trigger a penalty, and Google has confirmed that dead URLs are a normal part of any site. They cost you indirectly when the missing pages hold backlinks, receive traffic, or are linked internally, which wastes equity and crawl budget.
Want Someone to Handle the Redirect Map for You?
Migrations, replatforms and content pruning are where redirect mistakes get expensive, and a clean mapping done once beats months of ranking recovery. Talk to SEO Quirk about a technical audit, or read why working with a local agency tends to get these projects finished faster.