Troubleshooting · Troubleshooting
How to Fix Site Search Not Working in WordPress
Short answer
Fix WordPress site search by first checking the search form and the ?s= address, then resaving permalinks and clearing cache. Next, use Troubleshooting Mode to find a plugin or theme conflict, and check whether the missing content is published, public, and included in search. Replace the default search only after the built-in search works again.
Key takeaways
- A working search sends the term as ?s=your-term in the address bar.
- Default WordPress search looks in post titles, excerpts, and content only.
- A post type with exclude_from_search set to true never appears in results.
- Troubleshooting Mode tests plugins and theme without changing the live site for visitors.
- Draft, private, trashed, and password-protected content is not in public search results.
- Jetpack Search first indexing can take a few minutes or hours to finish.
What does site search not working mean in WordPress?
Site search is broken when a visitor types a word you know is on the site and gets no results, wrong results, a 404 page, or no search box at all.
WordPress search is a chain with four links: the form, the query, the content list, and the results template. A fault in any link gives a different symptom, so name the symptom before you change settings.
| Symptom | Likely link in the chain | First check |
|---|---|---|
| No search box | Form missing | Search block or theme header |
| Address does not change to ?s=term | Form action or field name | Form markup |
| Results page shows 404 | Rewrite rules | Settings > Permalinks |
| “Nothing found” for a visible post | Query or content status | Plugin conflict, post type, status |
| Only posts appear, no products | Post type excluded | exclude_from_search, product visibility |
| Old or deleted items still appear | Search index out of date | Index rebuild, Sync status |
Why does WordPress search return no results for posts you can see?
It returns no results when the query does not look where your words live, or when a plugin, theme, or setting removes the matching posts before the page loads.
The WP_Query class defines s as the search keyword string. It also lists search_columns as post_title, post_excerpt, and post_content, so a word that lives only in a custom field, a file name, or an image caption is not matched by default search as of November 2026.
A hyphen before a term excludes posts that match that term, a rule in place since WordPress 4.4. Search for one word first, then add a second word, so you can tell a missing match from an exclusion rule.
Check the post itself before you blame search. Open the post in a private window and confirm it loads, its status is Published, and it is not password protected. If you cannot open it as a visitor, search has no public result to show.
How do you check the search form and the ?s= address first?
Type one exact word from a post title into the search box, press Enter, and look at the address bar: a working search ends in ?s= followed by your word.
The get_search_form() function first looks for a searchform.php file in the child or parent theme, then shows the default form if that file does not exist. The default form uses method “get”, an input named “s”, and an action of your home address, so the term travels in the address itself.
If the address does not change, the form is not sending a standard search request. A page builder form, a custom header, or a JavaScript search box can send the term to the wrong place or to no place at all.
To restore the standard box in a block theme, add the Search block with the /search shortcut, as shown in the Search block docs. The block offers four button layouts: Button outside is the default, plus Button inside, No button, and Button only.
How do you resave permalinks and clear cache?
Go to Settings > Permalinks, click Save Changes without changing the structure, then clear cache and test the same search in a private window.
Saving permalinks refreshes the rewrite rules WordPress uses to turn an address into a request. Developer docs note that visiting Settings > Permalinks flushes those rules, and saving applies the selected structure, as described in the rewrite rules note.
Cache is the next suspect when a fix seems to do nothing. A cached results page can show old “nothing found” text after the real cause is fixed, so clear the cache plugin, the host cache, and the browser cache in that order.
If the search page still shows a 404 after resaving permalinks, the fault is often outside WordPress. That pattern is covered in the guide to fix 404 errors on posts, which walks through the same rewrite check in more detail.
How do you find a plugin or theme conflict without breaking the live site?
Install the Health Check & Troubleshooting plugin, open Tools > Site Health > Troubleshooting, and click Enable Troubleshooting Mode, which disables plugins and switches the theme for your session only.
Site Health is built into WordPress core since version 5.2, and it lives at Tools > Site Health with Status and Info tabs, as the Site Health docs explain. Read the Status tab first and fix any critical item that names search, rewrite rules, or a failed loopback request.
Troubleshooting Mode is the safe way to isolate a conflict. Visitors still see the normal site while you test, so do not deactivate every plugin on the live site by hand.
- Enable Troubleshooting Mode and search for the same term again.
- If search works, enable plugins one at a time and search after each one.
- When search breaks again, the plugin you just enabled is involved.
- If search still fails with all plugins off, switch the theme test next.
- Disable Troubleshooting Mode when you finish, so your session returns to normal.
Why are some post types, products, or pages missing from results?
They are missing when their post type is excluded from search, their status is not public, or their catalog visibility hides them from search.
The register_post_type() docs state that exclude_from_search defaults to the opposite of public, and that true means a search at site/?s=search-term will not include posts of that type. A custom post type can be public on its own page yet still be hidden from search.
The WP_Query docs add that post_type “any” retrieves any type except revisions and types with exclude_from_search set to true. That is why a search can find posts and pages but miss events, portfolio items, or products.
For WooCommerce, check the product edit screen first: status must be Published and catalog visibility must include search. The Searchanise docs on WooCommerce.com list the indexed set as products with Status Published, Visibility Public, and catalog visibility of Shop and Search results, Search results only, or Shop only.
That same WooCommerce doc lists the indexed product fields as Name, Description, SKU, Price, Categories, Product type, Tags, and Attributes. If a word lives only in a field outside that list, the product will not match it. For full product settings, see the WooCommerce settings guide.
How do you fix a broken search template in a classic or block theme?
Switch to a default theme for a quick test: if search works there, the fault is in your theme's search template, not in WordPress core.
The Template Hierarchy docs show that search results use search.php first, then fall back to index.php. In a block theme the same step uses search.html instead of search.php.
A search.php file that runs its own custom query can ignore the term the visitor typed. A file that calls the loop with the wrong post type can also return an empty list even when matching posts exist.
Check these three template points in order:
- Does the theme include search.php or search.html at all?
- Does the template print the search term and run the main loop?
- Does a child theme override the parent search template with an older copy?
If the default theme fixes search, keep the default theme active only for the test, then ask the theme author for a fix or restore the search template from a clean copy. Do not edit the parent theme directly if a child theme is in use.
When should you replace default search, and what changes?
Replace default search only when the built-in search works but cannot find the fields you need, such as custom fields, SKUs, or file text.
Relevanssi replaces the standard search with relevance-sorted results and searches comments, tags, categories, and custom fields, according to its WordPress.org plugin page. Its own docs say custom fields offer four choices: no custom fields, all custom fields, visible fields only, or a specific list, as shown in the Relevanssi settings guide.
Relevanssi also warns that its index needs large amounts of database space, and it gives an estimate of three times the size of the wp_posts table. Check database space with your host before you install it on a large site.
Jetpack Search replaces the standard search with an Elasticsearch-backed service, as its Jetpack Search docs explain. It is free for sites up to a limited number of records and search requests per month, and it indexes public posts, public pages, WooCommerce products, and public Media Library metadata such as alt text.
Jetpack Search does not index drafts, trashed posts and pages, private posts and pages, password-protected posts and pages, or PDF content. Its first index may take a few minutes or hours, and after that each new, edited, or deleted post is sent by Sync, usually within seconds.
If you want a broader search upgrade, read the guide to add AI search to a WordPress site before you pick a tool. Keep the built-in search working first, so you can tell whether a new tool helped or hid the fault.
How do you check that the fix worked?
Search for three terms: one exact title word, one word from the body of a new post, and one word from a product or custom post type that was missing.
All three should return the right item near the top. If only the title word works, the query still does not cover body text or custom fields.
Repeat the same three searches while logged out, in a private window, and on a phone if visitors use one. A search that works only while you are logged in points to a cache rule, a role check, or a plugin that treats logged-in users differently.
When should you contact your host?
Contact your host when search times out, returns a 500 error, or fails on every theme and with every plugin off.
Give the host the exact search term, the full ?s= address, the time you tested it, and the result of Troubleshooting Mode. That list lets support check server logs instead of guessing.
Ask the host to check database errors, slow queries, and available database space, plus any server cache that ignores the ?s= address. If the host cache serves the same results page to every visitor, no WordPress setting can fix it from the dashboard.
What mistakes should you avoid?
Do not install a new search plugin before you know which link in the chain is broken.
A new plugin can mask a broken form or a bad template for a week, then break again after the next update. Fix the built-in search first, then decide if you need more fields or better ranking.
- Do not deactivate all plugins on the live site by hand; use Troubleshooting Mode instead.
- Do not change the permalink structure to fix search; resave the current structure.
- Do not edit the parent theme search template; use a child theme or ask the theme author.
- Do not index every custom field at once; pick the fields visitors actually search for.
- Do not test search only while logged in; test logged out in a private window too.
If a change does not help, undo it before you try the next one. Two changes at once make it hard to know which one fixed search, or which one broke it again.
Frequently asked questions
Why does WordPress search say nothing found for a post I can open?
The post may be a draft, private, trashed, or password protected, or its post type may be excluded from search. A plugin or theme can also change the query before results load. Check the post status first, then test in Troubleshooting Mode with plugins off to see if search returns it.
Why does search find posts but not WooCommerce products?
Products need Published status and catalog visibility that includes search. A word in a field that is not indexed will also miss. Check the product edit screen, then check which search system serves the store, because a separate index may need a rebuild after product changes.
Does WordPress search look in custom fields by default?
No. Default search looks in post titles, excerpts, and content. Words that live only in custom fields, SKUs, or file text are not matched unless you use a search plugin that indexes those fields or you add them with code.
Why does search work for me but not for visitors?
Cache is the usual cause. Logged-in users often bypass cache, while visitors see a cached results page. Test in a private window while logged out, clear the cache plugin and host cache, and search again with the same term.
Should I rebuild a search index after I fix search?
Yes, if you use Jetpack Search, Relevanssi, or another indexed search tool. Those tools keep their own index, so a fix to WordPress settings does not update old index entries by itself. Rebuild the index, then search for a changed or deleted item to confirm it updated.
Sources
- get_search_form() WordPress Developer Resources
- WP_Query WordPress Developer Resources
- Template Hierarchy WordPress Developer Resources
- Search block WordPress.org Documentation
- Site Health WordPress.org Documentation
- Jetpack Search Jetpack
- Installing Relevanssi and adjusting the settings Relevanssi
- How Searchanise works WooCommerce
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
