How to improve search on a WordPress site
WordPress search is fine for a small site if your content is well organised and the form submits a proper search query. For custom fields, faceted filters, live results, or a large content library, you need an indexed search plugin such as WP Search with Algolia.
- 01Audit what search should find
- 02Check the search form
- 03Include the right content types
- 04Improve the content itself
- 05Add code only for targeted changes
- 06Use an index for larger sites
What you need
- Administrator access to WordPress
- A recent backup or staging site
- A list of the post types, taxonomies and custom fields visitors need to search
- An Algolia account if you choose the plugin route
Audit what search should find
Write down the content visitors expect to find: posts, pages, products, documents, custom post types, categories, tags and important custom fields. Search for ten real phrases, including product names, partial phrases, misspellings and terms that should return no results.
WordPress core searches the post title, excerpt and content by default. It does not automatically turn every custom field, taxonomy or attachment into a useful searchable field.
Check the search form
Submit a test search and check the address bar. A standard WordPress search uses a GET form aimed at the site root, with the search input named s. If a page builder button sends the query to a custom URL or uses another field name, WordPress may not recognise it as a normal search.
Check the form in the theme’s search area and on mobile. Keep a visible label, use an input of type search, and make sure the results page shows the phrase that was searched.
Include the right content types
Review every custom post type you want to appear. Its registration must allow front-end search by setting exclude_from_search to false. You can also add selected post types to the main search query with the pre_get_posts action, restricted to the front end and the main search query.
Put that change in a site-specific plugin or child theme, not in search.php. The query is prepared before the search template loads. A common Friday problem is a custom post type being marked as excluded, so the search page looks broken even though the content exists.
Improve the content itself
Use specific titles, useful excerpts and the words visitors actually use. Add synonyms to the copy where they make sense, and keep product names, reference numbers and important terms in searchable title or content fields rather than hiding them only in images.
Remove duplicate or obsolete pages from public search, fix empty excerpts, and give important content clear taxonomies. This manual work is often enough for a small brochure site or blog, and it avoids adding an index that needs maintenance.
Add code only for targeted changes
For a developer-led site, WordPress provides pre_get_posts for changing the main search query, post_search_columns for choosing among title, excerpt and content, and posts_search for filtering the generated search SQL. Use these when you need to include a post type, limit the searched columns or apply a narrowly defined rule.
Core search does not provide a simple setting for weighted fields, typo tolerance, live suggestions, custom-field indexing or faceted filtering. Searching custom fields by adding database conditions can also become slow as the content library grows, so profile the query and test pagination before deploying it.
Use an index for larger sites
Choose WP Search with Algolia when the site has a large or content-heavy library, custom post types, WooCommerce products, or a need for live results and filters. Follow its setup wizard to connect Algolia, select the content types and taxonomies to index, run the initial index, and configure the search interface and ranking controls.
After indexing, test newly published, edited and deleted content. Rebuild or synchronise the index when results are missing, and check that the theme’s search form still submits s. An indexed search service is the fast route, but it adds an external service and another index to monitor.
Let WP Search with Algolia do it
Algolia-powered live, faceted search with ranking controls; choose it for large or content-heavy WordPress sites needing highly relevant results.
Sources
- developer.wordpress.org /reference/hooks/post_search_columns/?utm_source=openai
- developer.wordpress.org /reference/functions/get_search_form/?utm_source=openai
- developer.wordpress.org /reference/functions/register_post_type/?utm_source=openai
- developer.wordpress.org /reference/hooks/posts_search/?utm_source=openai
- developer.wordpress.org /reference/classes/wp_query/?utm_source=openai
Questions
- Is WordPress search good enough without a plugin?
- Yes, WordPress search is often sufficient for a small blog or brochure site with clear titles and well-written content. Core searches post titles, excerpts and content, and you can include suitable custom post types with <code>pre_get_posts</code>. It becomes a poor fit when you need custom-field search, typo handling, live results, faceted filters or consistently weighted relevance.
- Why is my custom post type missing from search results?
- Your custom post type is usually registered with <code>exclude_from_search</code> set to true, or your search query is restricted to posts and pages. Set the post type to be included in front-end search and check any code using <code>pre_get_posts</code>. Also confirm that the content is published and that the search form sends its query in the <code>s</code> field.
- Can WordPress search custom fields by default?
- No, WordPress core’s standard post search covers the post title, excerpt and content, not arbitrary custom fields. You can write custom query logic, but that needs careful escaping, testing and performance checks. If custom fields are central to the search experience, an indexing plugin is usually less maintenance than extending the SQL search yourself.
- Why do search results show old or irrelevant content?
- Search results can be irrelevant because core search has limited ranking controls, the important term is only stored in a non-searchable field, or outdated content remains public. Improve titles and excerpts, remove obsolete pages, and control which content types are searched. For field weighting, typo tolerance and ranking rules, use an indexed search tool rather than relying only on the native query.