DEV Community

herryjobn
herryjobn

Posted on

Exclude Pages From WordPress Search Results

Exclude Pages From WordPress Search Results

How to Exclude Pages from WordPress Search Results. By default, the internal search on your WordPress website will cover all posts and pages in the WordPress search results. To address it more relaxed for your site users to find what they’re looking for, you may require to exclude certain Pages or Posts, so it nevermore appears in those results.

In this article, you will learn how to exclude Pages or Posts from the WordPress search results. Let’s div.

Here we will see two different methods to do this.

  1. Using PHP Code in a template.
  2. Using a specific Plugin

Why Need to Exclude Pages from WordPress Search Results?

By default WordPress, site search covers all of your content in the search results. This works well full for various WordPress website owners. However, if you are managing an online store, then you may desire to hide pages like your account page, Welcome Page, checkout page, thank you page, etc. Also you may require to hide subscriber-only content from appearing in search.

Note: This guide meets on-site search results when a user uses your website search box to search through your website content.

Read More: Exclude Pages From WordPress Search Results

Top comments (0)