Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Search box submits to 404: how to find and fix it

CNV-324Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

A visitor types a word into your search box and presses Enter. Instead of a results page, they land on a "Page not found" screen. The search form itself works, but the address it submits to is wrong or no longer exists.

This is different from search that loads but returns nothing for obvious terms. Here the results page never loads at all.

Common causes: a theme update that changed the search route, a hard-coded old domain or path in the form action, a redirect rule or migration that removed the search URL, a missing results template, or a language or subfolder prefix that the form leaves out.

Why it costs you leads or sales

People who use search usually know what they want. A 404 at that moment is a dead end, and many will leave rather than browse. You lose the visitors who were closest to buying or enquiring.

Where the search journey breaks
  1. Visitor types a querySearch box works
  2. Form submitsGoes to a wrong action URL
  3. Results pageShows 404
  4. Product or formNever reached

The form submits, but the results URL returns a 404, so every later step is lost.

Visitors who use search and what happensExample numbers
Visitors who use search and what happens (example)Reach a product (working search): 90 visitors; Reach a product (404 search): 0 visitors; Leave after the 404: 140 visitors054107900140Reach a product (work…Reach a product (404 …Leave after the 404visitors

Example: 200 visitors use search in a week. With a working results page, more reach a product page than when search ends in a 404.

How to check if your site has it

Test your search by hand
  1. Search a real term

    Type a product name or topic you know exists, then press Enter. Note whether a results page loads.

  2. Try the button and the Enter key

    Some themes break only one of them.

  3. Check it on desktop and mobile

    Headers often have separate search forms for each, and one may be outdated.

  4. Read the URL you land on

    Compare it with your real search page, for example /search?q=term or /?s=term.

  5. Inspect the form

    Right-click the box, choose Inspect, and look at the form's action and method attributes and the input's name.

  6. Test other languages and subfolders

    Try the search on every language version of the site.

Search leads to a 404

The visitor submits a query and lands on an error page.

How to fix it

First find the real URL of your results page by running a search from a page where it works, such as another template. Then make every search form point to that URL.

Fix by platform
  1. Use the standard search form

    In your theme, use get_search_form() or the Search block, which submit to /?s=term. Avoid hard-coded actions.

  2. Check the template

    Make sure the theme has search.php or a Search Results template (Appearance > Editor > Templates in block themes). Without a fallback, index.php or the 404 template is used.

  3. Refresh permalinks

    Go to Settings > Permalinks and click Save Changes. Then disable redirect or security plugins one at a time to see if one blocks ?s= requests.

A search form with a correct actionhtml
<form action="/search" method="get" role="search">
  <label for="site-search">Search</label>
  <input id="site-search" type="search" name="q" required>
  <button type="submit">Search</button>
</form>
Search form before and after

Broken

  • Form action points to an old path
  • Submitting shows a 404 page
  • Visitors leave

Fixed

  • Form action matches the live results route
  • Results load for real queries
  • Visitors reach products

How to confirm it's fixed

Confirmation checks
  • Search a real term and get a results page with a 200 status
  • Both the Enter key and the button work
  • Desktop, mobile and any sticky header search all work
  • Every language version works
  • A term with spaces or special characters does not 404
  • Results links lead to live pages

How to prevent it happening again

Search breaks most often after theme updates, migrations, redirect changes and new plugins. Add a quick search test to your release checklist and run it after each of those changes.

Prevention habits
  • Test search on staging before every theme or plugin update
  • Keep the search route out of bulk redirect rules
  • Avoid hard-coded domains in form actions
  • Re-test search after a migration or a URL structure change
  • Monitor the search journey on a schedule

How FunnelGuard handles this

FunnelGuard detects this only partly. It checks journey steps: if you set up a journey that types a query into your search box and submits it, FunnelGuard runs that step on a schedule from the EU or the US and flags the journey if a step fails. A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause.

What it does not do: it does not check every search form on your site, every language version, or the quality of the results. It does not judge whether results are relevant, and it only covers searches you include in a journey.

To cover the rest by hand, use the checks above after each theme change, test every header and mobile search form, and try each language. The Free plan includes 1 site and 2 journeys with daily checks and no card, and a free read-only website audit is available too.

Questions people ask

Why does my search box go to a 404 page?

The form is sending the query to a URL that does not exist. Common causes are an outdated form action, a theme update that changed the search route, a redirect that removed the search path, or a missing results template.

Why is my WordPress search showing page not found?

Usually the theme lacks a search results template, a plugin or redirect blocks the ?s= request, or the form action is hard-coded wrongly. Use the standard search form, save Settings > Permalinks, and disable plugins one at a time to find the cause.

How do I fix search on Shopify going to 404?

Make sure the search form action is {{ routes.search_url }} and the input is named q. Then check Content > Menus > View URL Redirects for any redirect from /search and delete it.

How do I check what URL my search form submits to?

Right-click the search box, choose Inspect, and find the surrounding form tag. Its action attribute is the destination, and the input's name is the parameter. Compare it with the URL of a working results page.

Can a search 404 hurt SEO?

Internal search pages are usually not meant to rank, so the main harm is lost visitors rather than rankings. Still, a broken search route can be a sign of wider redirect or URL problems worth checking.

Can FunnelGuard detect a search box that goes to a 404?

Partly. If you add a search journey, FunnelGuard runs it on a schedule and flags a failing step with a screenshot. It does not cover every search form, language version or the relevance of results.

Why does search work on desktop but 404 on mobile?

Many themes use a separate search form for mobile menus or sticky headers. That second form may have an old action. Inspect each form and update its action to the live results route.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: journey steps.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.