- JetSearch — apply the fastest AJAX search and manage the way the results are displayed, using advanced stylization settings;
- WordPress Gutenberg editor and free JetStyleManager — style any Gutenberg block & adjust its visual rendition;
- Elementor free — add the necessary widget into the editor, style it up, and publish it right away.
- Excluding Certain Terms and Posts in a Search Query in Elementor
- Excluding the Posts from the Search Results in Gutenberg
Excluding Certain Terms and Posts in a Search Query in Elementor
1 Step — Open the page where you added the AJAX search widget with the Elementor editor.
2 Step — Adjust the widget settings
Firstly, proceed to the Content tab and unfold the Search Query section.
Now you need to specify the source (the search areas) over which the search will be done.
To add a source, simply click on the Plus button and select the needed one from the drop-down list. You can select as many source areas as you want.
Below you will see two options: Include and Exclude. Click on the Exclude one and determine the certain terms and whether you need specific posts.
In our example, we have posts with different categories and tags. We want to exclude the posts in the Interview and Awards categories from the search.
Under the Terms, start typing the needed categories or tags.
To exclude a specific post from the search, just start entering its title under the Posts.
3 Step — After that, save the settings and check the search on the front end.
The needed posts were successfully excluded from the search results.
Excluding the Posts from the Search Results in Gutenberg
JetSearch works not only with the Elementor page builder. This plugin allows applying a Search block using Gutenberg as well.
Open the page in the default WordPress editor. Click on the “Add block” button and find the AJAX Search block.
Proceed to the Block tab and firstly unfold the Search Query section. Here you need the set the search area.
Scroll down and unfold the next section called Search Query Includes/Excludes.
The process is similar to the one described in the first part of this tutorial for the Elementor editor.
Simply add the terms under Exclude and select a specific post if needed.
Don’t forget to click the “Update” button and preview the search block on the front end.
Now you know how to exclude some terms and posts in a search query with the AJAX Search widget.