Do you want to learn how to exclude pages from the WordPress search results?
By default, the built-in WordPress search will include all posts and pages in its search results. To make it easier for visitors to find what they’re looking for, you may want to exclude certain content, so it never appears in those results.
In this article, we’ll show you how to exclude certain pages from the WordPress search results, step-by-step.
Why Exclude Pages from WordPress Search Results?
The default WordPress search includes all your posts and pages in its search results.
With that said, let’s show you how to exclude pages from the WordPress search results.
Note: In this guide we’re focusing on on-site search, where a visitor uses your website’s search box to look through your content. If you want to exclude pages from Google search results, then you should see our guide on how to hide a WordPress page from Google.
Create a New WordPress Search Algorithm with a WordPress Plugin
With SearchWP, you can search content that WordPress ignores by default, including custom post types, PDF files, WooCommerce products, and categories. You can also exclude content.
First thing you need to do is install and activate the plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, go to SearchWP » Settings and then click on the ‘General’ tab.
Here, you need to enter your license in the ‘License Key’ box. You can find this information under your account on the SearchWP site. Once you are done, make sure to click the ‘Verify Key’ button.
Create a Custom Search Algorithm
After activating the plugin, you can fine-tune how SearchWP indexes, searches, and displays your content. You can think of this as creating a custom Google search algorithm that’s just for your WordPress blog or website.
You’ll need to create a sitewide search engine before you can start excluding pages from the search results, so head over to SearchWP » Algorithm.
Here, you’ll see a section for the different content types that SearchWP searches by default, such as pages, posts, and media files.
Each section has its own Application Attribute Relevance sliders, which allows you to control how SearchWP ranks the content on your online marketplace, blog, or website.
For example, if you move the ‘Title’ slider to the left and the ‘Content’ slider to the right, then the content will carry more weight than the title.
You can either exclude all pages from the search results, or exclude specific pages only.
To stop all pages from appearing in your WordPress website search results, click on the small trash icon next to ‘Pages.’
This opens a popup where you can uncheck the ‘Pages’ box.
After that, simply click on ‘Done’ to exclude all pages from the search bar and results.
When you’ve finished customizing the default search engine settings, it’s time to save your changes. Even if you plan to exclude specific pages, you’ll still need to save your new sitewide search algorithm first.
To do this, scroll to the top of the screen and click the ‘Save’ button.
SearchWP will now rebuild the index automatically. Depending on the speed of your Internet connection and your WordPress hosting provider, this may take a few minutes.
As soon as you see ‘Index Status 100%,’ you’ll know that SearchWP has indexed all your content and settings.
Your site will now start using the improved WordPress search automatically.
Exclude Specific Pages From the WordPress Search Results
Do you want to exclude specific pages from the search results, such as the WooCommerce checkout page?
After creating a sitewide search algorithm following the process described above, you can exclude individual pages from the search results.
To do this, you’ll use the Exclude UI extension, which adds an ‘Exclude from search’ box to the page editor.
In the WordPress dashboard, head over to SearchWP » Extensions. Here, find the Exclude UI extension and click on its ‘Install’ button.
After that, open the page that you want to exclude from the search results. In the right-hand menu, make sure the ‘Page’ tab is selected.
You can now go ahead and check the ‘Exclude from search’ box.
Then simply click the ‘Update’ button, and this page will no longer appear in the search results. If you want to hide more pages from the search results, then simply follow the process described above.
How to Exclude Page Categories from WordPress Search Results
Another option is to exclude specific page categories from the search results. To do this, you’ll need a clear system for categorizing your pages, which may take some planning. However, you won’t need to install any extra extensions.
To show the pages from specific categories only, please see our guide on how to search by category in WordPress.
We hope this article helped you learn how to exclude pages from the WordPress search results. You may also want to see our beginner’s guide on how to get a free SSL certificate for your website and our best business phone services for small businesses.