How to Set Suggestions for Posts Search
Discover how to set search suggestions for the custom posts on the WordPress website via the Search Suggestions widget or manually.
Using the Search Suggestions functionality, you can place the Search Suggestion widget that outputs a standard search form. When you start entering text in the search field, the widget will look for matching search queries in the database on this website and display a list of queries containing the entered text, i.e., suggestions. To manage the suggestions, you can edit or add them manually on the Search Suggestions dashboard.
Add the Search Suggestions Widget or Block
The Search Suggestions widget or block can be added to a page (e.g., “Home” page), Header, etc. You can create a Header with the JetThemeCore WordPress plugin. To learn more, proceed to the How to Create a Custom WordPress Header tutorial.
Open the page or Header in the Elementor or Gutenberg (Block) editor.
Drag-n-drop the Search Suggestions widget to the Elementor editing page.
Customize the widget settings according to your needs. Learn more from the Search Suggestions Widget Overview.
Click the “Update” button and proceed to the front end.
Place the Search Suggestions block on the Gutenberg (Block) editing page.
The settings are similar to the Search Suggestions widget. Customize the block and click the “Update” button.
Proceed to the Front End
Open the page with the Search Suggestions on the front end.
When you enter a suggestion or click on a selected suggestion from the drop-down list, you will be redirected to the corresponding search results page.
To learn how to create the search results page with the JetThemeCore plugin, proceed to the How to Create an Archive Template to Display the Search Results tutorial.
I returned to the “Home” page and clicked on the search bar. Now it shows the new suggestion since I enabled the Show Suggestions on Input Focus option for the Search Suggestion widget.
If I enter a misspelled search key (e.g., “frence” instead of “france”), it will show the “Nothing Found” message.
On the Search Suggestions dashboard, you can set the parent “france” suggestion to the “frence” so that when users will enter misspelled keys, the search bar will show the correct “france” suggestion.
Enter as many search keys as you want. Now, let’s manage the saved suggestions.
Follow the WordPress Dashboard > JetPluginsSettings > JetSearch > Suggestions path.
The Suggestions dashboard displays the search queries (suggestions) list formed from previously entered real search queries or those manually entered by the site administrator.
All suggestions have the “Unassigned” Type for now.
To add suggestions manually, hit the “Add New” button at the top of the page.
Since all my posts contain the “Italy” name, I added the “Italia” suggestion and attached the “Italy” Parent to it.
I pushed the “Add New” button. The “Italia” suggestion obtains the “Parent” Type.
And the “Italia” becomes “Child.”
To edit suggestions, you can press the pencil-shaped icon in the Actions column.
In the Edit Suggestion pop-up, you can rename a suggestion, change its weight (the bigger the weight, the higher the suggestion in the list), and assign or unassign a parent.
Manage the suggestions according to your needs.
Check the Final Result
Return to the front end. When you enter the misspelled suggestion, the search bar shows the parent suggestions.
When users click on the parent suggestion, they are redirected to the corresponding search results page.
That’s all. Now you know how to set search suggestions for the custom posts on the WordPress website via the Search Suggestions widget or manually.