The search box is an essential area for websites that have plenty of web contents. With it, your readers can move to what they want easily. Without going through all of your pages, they just need to search for the keywords and the related contents can be listed on the result page. Previously, we have shared some tips about search function optimization. And now, we’d like to continue this guide by telling you how to enable autocomplete search in WordPress. This is another effective method to make your search function run better and more efficient.
Actually, the inspiration of the autocomplete search comes from the Google Autocomplete feature. In this case, we’ll also tell you how to benefit from the autocomplete function from both your website and Google.
Enable Autocomplete Search in WordPress
To achieve this feature, the easiest way is to make use of the WordPress plugins. In the following, we have listed the widely-used one. Note that it is the lightweight option so will not force much burden to your website and slow down your page loading speed.
Ajax Search Lite is a live plugin for WordPress search function. With its live search engine, you can improve the user experience with the Ajax based search form. In addition to the autocomplete feature, the post type filter, category filter and keyword suggestions are also available.
This plugin is pretty easy to use, along with the full customization and flexibility that allows you to design and display it the way you like. You just need to install it properly. After clicking the Ajax Search Lite > Ajax Search Lite button, you can find the exact shortcode and HTML code for your search box. Now, you can use either of them and place the code at any location of your site you want.
Now, the search box can look like the below example with the autocomplete function.
If you are not satisfied with the display, you can go back to the plugin settings page to decide the appearance and features as you like.
This part contains 4 main sections – Source & Basics, Behavior, Ordering and Autocomplete & Suggestions.
- Source & Basics – choose the template for the search box, choose to replace the theme search with Ajax Search one, allow to search in posts, pages and your wanted custom post types, allow to search in title, content, post excerpts, permalinks and all the custom fields, show exact matches only and search in terms.
- Behavior – show the results matching either of the entered words or all the words totally, trigger the search when hitting the search icon, on facet change or when typing, enter the minimum character number to trigger search and the maximum result number, showcase the description context, override the default WordPress search results and enable redirection when clicking the search icon and the return key.
- Ordering – decide the primary result ordering and the secondary result ordering. The ordering options include relevance, title descending, title ascending, date descending and date ascending.
- Autocomplete & Suggestions – enable the autocomplete and keyword suggestion features, decide the range of the keyword length and choose the suggestion language.
This section mainly requires you to decide some image options showed on the search results. Here, you can decide to show images in results, along with the proper width and height. As for the image source, the primary option must be the featured image. However, if there is no featured image, you can enable some other image sources, such as post content, post excerpt, custom field, page screenshot or even the default image you have uploaded.
Here, you can decide how your search box and search results to showcase.
- Search Box Layout – enter the placeholder text, decide the search box width and choose the search box margin.
- Results Layout – show “more results” text, show author, date, description and description context in the search results.
- Keyword Highlighting – Highlight the keywords in the result list with the proper color schemes.
- Results Behavior – open the result in a new window, scroll the window to the resulting list, make the result area totally clickable, show the close button and decide the text of the No Results and Did You Mean fields.
What You Can Benefit from the Autocomplete Search
From the autocomplete search of your website, you can
- Give the better searching experience to your website visitors.
- Show the professionalism of your website.
- Get the accurate and granular insights about what your readers are looking for.
From Google Autocomplete feature, you can
- Know the general interests, concerns, hot news of your niche.
- Set up your brand awareness if your business is not brand new.
- Find out the competition in your industry.
- Identity people’s potential pain and confusion.
- Get more great keywords and new ideas.
- Scope out the complaints and conflicts of something or some topics.