WordPress search not working troubleshooting illustration

How to Fix WordPress Search Not Working

When WordPress search is not working, the problem usually comes from the theme, a plugin conflict, an excluded post type, caching, or a customized search query. Start with the quick checks below before replacing the search system.

Test the Default WordPress Search

Open a private browser window and visit your site using this format:

https://example.com/?s=test

Replace example.com with your domain and use a word that appears in a published post title. If the direct URL returns results but the search box does not, the problem is probably the search form or theme. If both fail, continue through the remaining checks.

Confirm the Content Is Searchable

WordPress only returns content that its search query can access. Confirm that the missing page or post is published, publicly visible, and contains the search phrase. Drafts, private content, password-protected pages, and some custom post types may not appear.

  • Check the post status and visibility.
  • Search for an exact word from the title.
  • Confirm the correct post type is included.
  • Review SEO, membership, and search plugins for exclusion settings.

Check the Theme Search Form

A theme can display a search box that submits the wrong parameter or points to the wrong URL. The form should send the visitor’s query using the s parameter. Temporarily switch to a default WordPress theme on a staging site. If search starts working, inspect the active theme’s searchform.php and search.php templates.

Never test a theme switch on a busy live site without a backup or staging copy.

Rule Out a Plugin Conflict

Search plugins, security plugins, membership tools, multilingual plugins, and page builders can alter WordPress queries. Deactivate recently added or updated plugins on staging, then test after each change. If search works with all plugins disabled, reactivate them one at a time until the problem returns.

If the WordPress dashboard is also unusually slow, use my slow WordPress admin troubleshooting guide before running extensive database tests.

Refresh Permalinks

Go to Settings > Permalinks and click Save Changes without changing the structure. This refreshes rewrite rules and can repair search URLs affected by a recent migration, domain change, or server configuration update.

Clear Every Cache Layer

A cached empty search page can make a repaired search function look broken. Clear the browser cache, WordPress caching plugin, host cache, object cache, and CDN cache. Then test in a private window.

Some caching plugins should exclude search-result URLs from page caching. Look for exclusions involving ?s= or search pages in your caching configuration.

Review Custom Queries and Search Filters

Custom code can modify search results through hooks such as pre_get_posts, posts_search, or posts_where. Search your theme, child theme, and WPCode snippets for those hooks. Disable suspicious snippets on staging and test again.

Pay particular attention to code that changes post_type, limits results to a category, excludes page IDs, or alters the main query without first checking is_search().

Check AJAX and REST API Search

Live search features often use AJAX or the WordPress REST API. Open the browser developer console and look for 403, 404, or 500 errors while typing into the search field. Security rules, expired nonces, blocked REST endpoints, and JavaScript optimization can break live results even when standard WordPress search still works.

Inspect the Database Only When Necessary

If published content cannot be found and the default theme also fails, check database health. Confirm that the posts exist in the correct tables and that the site is using the expected database prefix. Repair damaged tables through your hosting panel or WordPress repair tools only after creating a current backup.

Should You Replace Default WordPress Search?

Default WordPress search is adequate for many small sites, but large content libraries may need better relevance, typo handling, filters, or custom-field indexing. Tools such as Relevanssi, SearchWP, Elasticsearch, or an external search service can help. Replacement should come after fixing the underlying problem, not before.

Fast Troubleshooting Order

  1. Test the direct ?s= URL.
  2. Confirm the content is published and searchable.
  3. Clear all cache layers.
  4. Refresh permalinks.
  5. Test plugin and theme conflicts on staging.
  6. Review custom queries, AJAX errors, and database health.

Need Help Fixing WordPress Search?

If search still fails, document the exact query, expected result, affected post type, and recent site changes. That information makes the cause much faster to isolate. You can also browse my WordPress SEO troubleshooting hub for related fixes.

Published by
JL Faverio

JL Faverio is a Technical SEO Consultant specializing in WordPress, technical SEO, and website maintenance. I help businesses and agencies fix technical SEO issues, maintain WordPress websites, improve site speed, and solve problems that other developers can't. With years of experience managing hundreds of WordPress websites, I focus on practical solutions that improve search visibility and long-term website health.