SearchWP Blog

WordPress Tutorials, Tips, and Resources to Help Grow Your Business

How To Exclude Pages or Posts From Site Search Results In WordPress - thumbnail

Are you wondering how to exclude pages or posts from site search results in WordPress?

By default, WordPress includes all published content in search results, which might not always be ideal. You may have technical pages like login, checkout, or even documentation posts that you don’t want to see in the search results.

Therefore, in this guide, we’ll show you how to exclude pages or posts from site search results in WordPress in just a few clicks. So, let’s get started!

Quick Access:

Why Exclude Pages Or Posts from WordPress Search Results?

Excluding certain pages or posts from WordPress search results can be beneficial for various reasons.

For example, technical pages like sitemap, category, or login pages might not serve your visitors when they are included in search results.

The same goes for online stores. WordPress doesn’t see any difference between regular and technical pages such as checkout and the thank you page.

Another good example is membership websites. If you’re selling online courses or other digital products, you don’t want paid content to appear in the search results.

Even for a regular website, you may want to hide certain pages or posts from search results to provide a more relevant search experience for your users.

How To Exclude Pages or Posts from WordPress Website Search Results

The fastest and easiest way to exclude pages or posts from site search results in WordPress is by using the SearchWP plugin. It’s the best WordPress search plugin that is currently trusted by more than 60,000 website owners.

With SearchWP, you can hide any posts, pages, or media files from the search results in a few clicks – no coding knowledge is needed. It also comes with tons of features that widely expand the WordPress search capabilities.

Here are a few noteworthy features of SearchWP:

  • Live Search Results: Instantly display relevant search results as users type, enhancing user experience by providing immediate feedback and making navigation smoother.
  • Search Insights & Analytics: Track and analyze search patterns on your site to gain a deep understanding of what your visitors are searching for. This data helps you tailor your content strategy and boost user engagement by aligning with their preferences.
  • Customizable Search Rankings: Easily modify the ranking of search results to highlight specific posts or products, ensuring key items receive the attention they deserve.
  • Seamless WooCommerce Integration: SearchWP integrates effortlessly with WooCommerce, enhancing the search functionality for product images, descriptions, and more.
  • Searchable PDFs and Documents: If your site hosts PDFs or other office documents, SearchWP can make them searchable, ensuring users get more accurate and comprehensive search results.

Now, to exclude posts or pages from WordPress search results, we first need to set up SearchWP.

How To Setup The SearchWP Plugin

You can start by selecting the SearchWP package that best suits your needs, as different packages come with different features.

Once you’ve made the purchase, navigate to the Downloads tab on your Accounts page and download the plugin file.

How to Exclude Pages from Site Search Results in WordPress: Installing SearchWP Step 1

While you’re there, be sure to copy your license key from the same location. This key will be essential for activating the plugin later.

How to Exclude Pages from Site Search Results in WordPress: Installing SearchWP Step 2

After the download is complete, you can install and activate SearchWP in the same way as any other WordPress plugin.

Once activated, you’ll be greeted by a welcome screen. Here, you’ll have the option to start the onboarding process by clicking “Start Onboarding Wizard,” this will guide you through the initial setup.

How to Exclude Pages from Site Search Results in WordPress: Installing SearchWP Step 3

Alternatively, you can directly activate your copy of SearchWP. To do so, visit SearchWP > Add License Key.

How to Exclude Pages from Site Search Results in WordPress: Installing SearchWP Step 4

On this page, paste the license key you copied earlier (from your accounts page) into the appropriate field, and then press “Verify Key” to complete the activation process.

How to Exclude Pages from Site Search Results in WordPress: Installing SearchWP Step 5

Once the key is verified, your licensing information will be displayed below, confirming that the activation was successful.

How to Exclude Pages from Site Search Results in WordPress: Installing SearchWP Step 6

That’s it. SearchWP has been configured successfully. Now, we can proceed to the next step!

How To Exclude All Pages Or Posts From Site Search Results In WordPress

SearchWP replaces the default WordPress search the moment it’s activated. Now, you can exclude a particular type of content by removing its source from the SearchWP Search Engine. To do so, visit SearchWP > Algorithm.

How to Exclude Pages from Site Search Results in WordPress: Exclude All Pages/Posts Step 1

The Default Engine has three pre-selected search sources: posts, pages, and media files. To completely exclude either posts or pages from appearing in search results, remove the corresponding source from the Engine. To do that, press the “Sources & Settings” button.

How to Exclude Pages from Site Search Results in WordPress: Exclude All Pages/Posts Step 2

If you want to hide all pages from search results, then uncheck the “Pages” checkbox and click Done.

How to Exclude Pages from Site Search Results in WordPress: Exclude All Pages/Posts Step 3

On the other hand, if you want to hide all posts from search results, then uncheck the “Posts” checkbox and click “Done”.

How to Exclude Pages from Site Search Results in WordPress: Exclude All Pages/Posts Step 4

Finally, press the “Save” button to apply changes.

How to Exclude Pages from Site Search Results in WordPress: Exclude All Pages/Posts Step 5

Now, when you perform a search, only results from the selected sources will appear, and all other content will be hidden from the search results page.

How To Exclude Specific Pages, Posts, Or Products from Site Search Results

We can exclude a particular post, page, or product type from your WordPress site’s search results. To achieve this, we need to utilize the Exclude UI extension of SearchWP.

Once the Exclude UI is activated, we can proceed to hide a specific page, post, or product from site search results in WordPress. Therefore, to install this extension, visit SearchWP > Extensions. Then, find the “Exclude UI” extension from the list and click the “Install” button.

How to Exclude Pages from Site Search Results in WordPress: Exclude Specific Content Step 0

The extension will activate successfully in a few seconds. Now that the foundation is complete let’s see how to exclude specific posts, pages, or products from WordPress sites.

How To Exclude A Specific Page From WordPress Search Results

To exclude a specific page from the search results, you need to open it in Edit mode. To do that, click “Pages” from the left sidebar.

How to Exclude Pages from Site Search Results in WordPress: Exclude Specific Page Step 1

Create a new page or find the page you’d like to hide from search results and click on it.

How to Exclude Pages from Site Search Results in WordPress: Exclude Specific Page Step 2

Once you open the page, click on the “Page” tab on the right sidebar and check the “Exclude from SearchWP” checkbox. Finally, click the Publish/Update/Save button at the top right, depending on your scenario.

How to Exclude Pages from Site Search Results in WordPress: Exclude Specific Page Step 3

That’s it. From now on, this page won’t be displayed among your website’s search results!

How To Exclude A Specific Post From WordPress Search Results

To exclude a specific post from the search results, you need to open it in Edit mode. To do that, click Posts from the left sidebar.

How to Exclude Pages from Site Search Results in WordPress: Exclude Specific Post Step 1

Then, create a post or find the post you’d like to hide from search results and click on it.

How to Exclude Pages from Site Search Results in WordPress: Exclude Specific Post Step 2

Once you open the post in Edit mode, click on the Post tab on the right sidebar. Now, check the “Exclude from SearchWP” checkbox and click the Publish/Update/Save button at the top right, depending on your scenario.

How to Exclude Pages from Site Search Results in WordPress: Exclude Specific Post Step 3

That’s it. From now on, this post won’t show up in the search results of your WordPress website.

How To Exclude Specific Products from WordPress Search Results

If your eCommerce website has been created using WooCommerce or Easy Digital Download, you can exclude specific products from the WordPress search results page. Let’s use WooCommerce for the purpose of this tutorial.

First, you need to activate the WooCommerce Integration extension. Visit SearchWP > Extensions and find WooCommerce Integration from the list. Then, click the “Install” button. Please wait a few moments for the extension to be activated.

How to Exclude Pages from Site Search Results in WordPress: Install WooCommerce Integration

Now, to exclude specific products from WordPress search results, click the menu item “Products” from the left sidebar in your WordPress dashboard.

How to Exclude Pages from Site Search Results in WordPress: Exclude Specific Product Step 1

Then, create or find the product you want to hide from search results and click on it.

How to Exclude Pages from Site Search Results in WordPress: Exclude Specific Product Step 2

Once you open the post, check the “Exclude from SearchWP” box at the right. Finally, click the Update/Publish/Save button, depending on your case.

How to Exclude Pages from Site Search Results in WordPress: Exclude Specific Product Step 3

That’s it. From now on, this product won’t show up in the search results of your WordPress website.

Verify If The Excluded Content Is Showing Up

It’s time to test your new WordPress search to see if it’s excluding what you want it to exclude. Press the “Visit Site” button under your site’s name.

How to Exclude Pages from Site Search Results in WordPress: Verify Excluded Search Results: Step 1

For the purposes of this tutorial, we created a post titled ” How to add live search to a WordPress website.” Let’s see if the new search finds it.

How to Exclude Pages from Site Search Results in WordPress: Verify Excluded Search Results: Step 2

As you can see, no matches were found. This means that our changes have taken effect, and WordPress no longer includes pages or posts that match the search term in the search results.

The search form shown above has also been created using SearchWP; here’s how to create a custom search form with just a few clicks.

Conclusion

In this article, you learned how to exclude pages, posts, and products from site search results in WordPress. Additionally, we believe you’ll also benefit from learning how to redirect search results to specific posts or pages.

Get SearchWP now to give your visitors a modern search experience!

author avatar
Saif Khan

Create a Better WordPress Search Experience Today

Never lose visitors to unhelpful search results again. SearchWP makes creating your own smart WordPress search fast and easy.

Get SearchWP Now
Multiple Search Engines Icon