Skip to content
WordPress Support

WordPress Search Not Working? Run the URL Test

Search on a WordPress site is either broken or working exactly as designed. A two-minute test tells you which, and what to do about each.

A laptop with code on screen next to a small plant
8 sections · 7 min read
In this article · 8 sections

A visitor types the name of a product you definitely sell, or the title of a blog post you wrote last month, into the search box on your site. The result: “Nothing found”. Or the search sends them back to the home page. Or a 404 page. Then they leave, and the only reason you find out is that someone mentions it in passing.

WordPress search not working tends to fall into one of two camps. Either search is broken, so the request never reaches WordPress or the results page fails, or search is working exactly as designed and simply does not look where you expect. Telling those apart is the first job, and it takes about two minutes.

The two-minute URL test

Skip the search box. Type this directly into your browser’s address bar, using a word you know appears in the title of a published post:

yoursite.com/?s=yourword

WordPress handles any address with ?s= on the end as a search. What happens next tells you which camp you are in:

Result of the URL test What it means
Results appear, but the search box on your site still fails The search form is the problem, not search itself
A proper results page, but no results for words that are definitely in titles Something is filtering or replacing the search query
Results for title words, nothing for other words Search is working; it just does not look where those words are
A 404, a blank page or an error The theme’s search template, a plugin or the server is failing
Redirected to the home page or blocked A redirect rule, security plugin or firewall is interfering

Try it in a private window too, so your logged-in session does not change the answer. Drafts and private posts appear for some logged-in users and never for visitors.

What WordPress search actually looks at

Out of the box, WordPress search compares the words typed against three things on published posts and pages: the title, the main content and the excerpt. It does not, by default, look at:

  • Custom fields, including fields added by ACF or similar plugins
  • Category and tag names
  • Comments
  • The contents of PDF or Word files in the media library
  • Text that lives in widgets, menus or theme options
  • Text inside a synced pattern (formerly called a reusable block), which is stored separately from the page that shows it
  • Content types that their plugin has marked as excluded from search

This is a frequent reason a site search returns no results for something that is plainly on the site. A product’s material, a team member’s job title or a property’s location often sits in a custom field. The page shows it, but search never sees it.

If that is your situation, the fix is not repair; it is a search plugin that indexes more. Relevanssi and SearchWP are two well-known options that can include custom fields, taxonomies and sometimes documents. Set one up on a copy of the site first, because changing how search works changes every results page.

How results are ordered

WordPress puts posts whose titles match the search terms ahead of those where the words only appear in the content, and then sorts by date. It does not weigh how often a word appears or how important the page is. If a visitor says search “finds the wrong thing first”, that is usually the cause, and again a search plugin is the realistic answer.

Searches that will never match

Default search is literal. A few habits of real visitors trip it up even when everything is set up correctly:

  • Every word has to be found. When someone types several words, WordPress looks for posts that contain all of them, not any of them. A long, chatty search can match nothing.
  • No spelling tolerance. “Recipie” will not find “recipe”. There is no fuzzy matching built in.
  • Partial words work one way only. Search matches the typed text anywhere inside a word, so “shoe” finds “shoes”. “Shoes” will not find a post that only says “shoe”.
  • Common small words are dropped from multi-word searches, so they neither help nor hurt.

If your own test searches use the exact wording from your titles, you may never notice these limits. Ask someone else to search for a few things the way a customer would, and compare.

When the search box is the problem

If the URL test works but the box on the site does not, you do not really have WordPress search not working. You have a search form that is sending the request to the wrong place. Look at the form.

  1. Right-click the search box and choose Inspect. A WordPress search form sends the typed text as a field named “s” to your site’s home address. If the field has a different name, or the form sends to a different address, the search runs somewhere else or not at all.
  2. Check where the box came from. Is it the theme’s built-in header search, a Search block, a page builder widget or a plugin’s own box? Builder widgets and plugin boxes sometimes point at a specific results page or content type. A shop search widget may only search products, for example.
  3. Check for script errors. “Live search” boxes that show results as you type rely on JavaScript and often on the REST API or admin-ajax. Open the browser console (F12) and type in the box. Red errors, or failed requests in the Network tab, point at the cause.

When the results page fails

A 404 or blank page

Themes use a template file, usually search.php, to display results. If a theme update broke that file, or a child theme has an old copy of it, the results page can fail while the rest of the site works. Switch to a default WordPress theme on a staging copy and run the URL test again. If search works with the default theme, the problem is in your theme’s search template.

A blank page or “critical error” on search results only is often a PHP fatal error in that template or in a plugin that hooks into search. The site’s error log will name the file. Our map of common WordPress errors and what they mean covers the critical error and white screen in more detail.

Results page works, but shows nothing or the wrong things

Plugins and themes can change the search query before it runs. Common examples:

  • A setting that limits search to products only, or excludes pages
  • A membership plugin that hides restricted content from visitors who are not logged in
  • A multilingual plugin that only searches content in the current language
  • Custom code in the theme’s functions.php that a developer added years ago and nobody remembers

Deactivating plugins one by one on a staging copy, and running the URL test after each, finds the culprit. Look first at anything that mentions search, filtering, membership or languages.

Redirected or blocked

Some security plugins and server firewalls treat search requests with suspicious characters as attacks and block them. That is useful against spam bots, but a heavy-handed rule can catch real visitors too, particularly searches with quotes, ampersands or non-English characters. A 403 response on certain searches but not others is the giveaway. Our explainer on how website firewalls decide what to block covers how these rules work and how to ask for an exception.

Redirect plugins that send every 404 to the home page can also hide a broken results page. The search seems to “go home” when it is really failing. Turn that rule off temporarily to see the real error.

Search results pages should not be served from a long-lived page cache, because every search is different. Many caching plugins skip addresses with ?s= by default, but a CDN or server cache may not. If two different searches show the same results, or new posts never appear in results, check whether your cache layers are storing search pages and exclude them.

On a store, product search has the same basic limits: it looks at product titles, descriptions and short descriptions. Attributes, SKUs and custom fields may not be found, depending on your theme and the search box in use. Some themes and blocks search products only; others search everything. If shoppers cannot find products by the details they care about, that is usually a sign the store needs a product search plugin rather than a fix. Our WooCommerce support page covers that kind of store work.

Search works, but results run across several pages

If the first page of results is fine but “next page” shows a 404 or the same results again, the fault is in pagination, not search. The causes overlap with blog archives, and the guide on page 2 returning a 404 covers them.

WordPress search not working? Write this down first

  • Three example searches, what you expected and what appeared
  • The result of the ?s= URL test, logged in and in a private window
  • Where the search box comes from: theme, block, builder or plugin
  • Whether the missing content lives in titles and body text or in custom fields

That list tells a developer within a few minutes whether they are looking at a bug or a limitation. If the trail leads into a theme template or plugin conflict you would rather not unpick, our wordpress bug fixing help covers single issues like this one.

Search is one of the few parts of a site that visitors use precisely when they are ready to act. A results page that says “nothing found” for something you sell is worth an afternoon of checking.

Next in this series: WordPress Pagination Not Working? Page 2 Fixes

Is Your Website Working Properly?

Get a free website health check from WebMaintor. We'll review your website's speed, security, forms, and technical health — and tell you exactly what needs attention.

No obligation. No automated reports. A real review by our team.