404 Handling

15-30 minBeginner

A custom 404 page retains users who hit a dead end. Monitoring 404s reveals broken backlinks you can reclaim with redirects.

Prerequisites

  • WordPress admin access
  • Redirection plugin (for monitoring)
Medium Recommended

Theme 404 Template (Standard)

Most themes have a 404.php file you can customize.

1

Customize via Theme

1

Go to Appearance > Customize

2

Look for a "404 Page" section (common in Astra/GeneratePress)

3

Add a search bar and links to popular posts

2

Edit 404.php (Advanced)

1

In Appearance > Theme File Editor > 404.php

2

Add <?php get_search_form(); ?> to include a search box

3

Add a list of recent posts

Use a Child Theme so your changes persist after updates

Best Practices

Do

  • Be apologetic but helpful ("Oops, page not found. Try searching:")
  • Redirect 404s that have backlinks
  • Keep the design consistent with your site
  • Use a 410 Gone status for content you permanently deleted

Don't

  • Redirect all 404s to the home page (Soft 404 error in Google)
  • Show a generic server error page (ugly/scary)
  • Blame the user

Verification Checklist

  • Visit a random URL (e.g. /aksjdhf) to see the 404 page
  • Search bar is present and functional
  • Helpful links are visible
  • The 404 error is logged in Redirection plugin
  • Server returns HTTP 404 status (check with inspector)

Pro Tips

  • Dynamic 404s: Some plugins suggest similar pages based on the URL keywords (e.g. /red-shoes -> "Did you mean Red Shoes product?")
  • Check "Excluded" in Google Search Console Coverage report to find 404s Google found

Common Issues & Fixes

Problem: 404 Page returns 200 OK status
Solution: This is a "Soft 404". Ensure your plugin or theme is sending the correct HTTP header "Status: 404 Not Found".