stand for ukrainian independence image
Stand for Ukrainian Independence. Contribute.
stand for ukrainian independence image
Help Center
Search Suggestions in WordPress
ivanova
Helena Ivanova
Technical content writer
Show all articles
Updated on
Useful Resources

Search Suggestions in WordPress

WordPress search is a default functionality of this CMS. Still, it’s quite basic and requires some extra tools to deliver results that would help users engage and ensure a good customer experience.

There are two things that every developer should probably add to their website: AJAX search and search suggestions. In this article, let’s discuss the latter. 

Table of Contents

How Does WordPress Perform Search?

First and foremost, let’s figure out how the default WordPress search works under the hood so it will help understand how it may be improved.  

Assume you type in the search field the word “pen.” 

This is what will happen next:

  1. WordPress processes the search request and uses the WP_Query class to construct a query to the database.
  2. The query looks for posts where the search term “pen” matches the post title, content, or excerpt, so WordPress generates and executes the following SQL query:
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID

FROM wp_posts

WHERE 1=1

AND (

  (wp_posts.post_title LIKE '%pen%')

  OR (wp_posts.post_content LIKE '%pen%')

)

AND wp_posts.post_type IN ('post', 'page')

AND (wp_posts.post_status = 'publish')

ORDER BY wp_posts.post_date DESC

LIMIT 0, 10;

It’s a simple example, and there can be more options. Here, the search is performed within the wp_posts table, but only “post” and “page” post types are included; the search is in titles and content, the post status is “published”, the order is DESC, and the results are limited to 10 matching posts. 

But what if there’s a typo in the word you search? There will be zero results. This might be really frustrating for users, as these days, we are all used to quick results, AI tools, and just the fact that typos or even the page being in another language are not a problem anymore. 

That’s why this situation with the default WordPress search must definitely be improved. To do so, there are dedicated plugins and SaaS solutions. 

How to Add Custom Search Suggestions with JetSearch

There are two major types of tools that improve search quality and performance in terms of search suggestions, which are sometimes generally called fuzzy, even though fuzzy means using quite specific algorithms. 

In simple terms, fuzzy search is a way to find results in a database or search engine that are close to your search terms, even if there are minor errors or differences. Imagine you’re searching for “pen,” but you accidentally type “pdn.” With a normal search, you might not get any results because “pdn” isn’t exactly “pen.” However, a fuzzy search will recognize these two and show you relevant results. This method is especially helpful when dealing with typos, misspellings, or variations in data. 

Another technique is phonetic matching, where words are broken down into sounds. This helps when words are spelled differently but sound alike, like “color” and “colour.” This type of fuzzy search relies on certain libraries and mathematical methods to function effectively. 

Another technique is the use of N-grams. This method breaks down a string into smaller parts called n-grams. For example, the word “pen” can be broken into “pe” and “en” as 2-grams. By comparing these smaller parts, the search can find matches even if there are small differences. These libraries and methods work together to make fuzzy search powerful and flexible, allowing it to handle a wide range of variations and errors in the data. This makes searching more intuitive and efficient, even when users make typos or use different spellings.

Additional reading
Discover AI-powered experimental feature for JetSearch
Read more

With the JetSearch plugin manual suggestions feature, you can add tailored suggestions for your customers based either on manual inputs you’ve entered or on the previous search queries of other users.

It narrows down the options and makes the suggestions really custom-made because it offers something very specific to your website. Another advantage of this approach is that you can guide your customers to pages and influence the choices they make. 

How to set up JetSearch manual suggestions

To manually set up search suggestions with the JetSearch plugin, go to Crocoblock > JetPlugins Settings > JetSearch and add the suggestions you want to appear in users’ searches.

But let’s start from the basics first. With JetSearch, you can include particular terms, post types, custom fields, the number of posts per page, etc. And, of course, it’s an AJAX-powered search. Simply add the phrases you want your customers to find quicker and set their relevance and hierarchy. 

Have a quick look at the settings:

Other than that, this plugin can include the suggestions you’ve created manually and the ones generated by the previous search queries. 

JetSearch is the plugin that makes this for you, and it’s time to discover the logic behind it. 

If you go to Crocoblock > JetPlugins Settings > JetSearch, you will find the Settings tab to adjust search suggestions. There, you will find a pretty simple yet powerful menu to set up suggestions and their values.

Search suggestions

E-commerce websites definitely require efficient search features, and this is a guide on how to set up the JetSearch plugin on your website. 

Manual suggestions really matter as you can curate your customers and influence their decisions by setting the values of the manual suggestions higher than other options. 

If you combine it with the ability to store previous user search queries and then adjust results based on that, you will get the functionality JetSearch offers you. 

FAQ

What are search suggestions in WordPress? 

Search suggestions help users find the search results faster and even offer the best manually curated results they expect. 

How to optimize the WordPress website search to make it more efficient?

Add dedicated search plugins like JetSearch to your stack to have efficient search results. 

How to suggest results to users on the search result page?

Use manually curated search results, which you can add using the JetSearch plugin. 

Takeaway

Customers don’t have time to go through all the pages of your website, even if it sells the most unique pieces. So, how do you make them stay and be not only engaged but also get curated search results that lead them to better sales? 

Use dedicated plugins, such as JetSearch, which offer manually curated search suggestions that are also empowered by the search queries performed by other users.