SearchWP

News

how to limit search to only posts in WordPress

Do you want to know how to limit search to only posts in WordPress?

That can be very handy if you have a lot of pages on your website and want to reduce the amount of clutter in search results.

In this article, we’ll show you how to limit search to only posts in WordPress.

Let’s begin.

Why Limit Search to Only Posts on Your Site?

By default, WordPress displays all published pages, posts, and custom post types in search results.

That’s why sometimes it might be challenging to find the right piece of content, especially on sites with a bunch of pages.

Have you ever used a search form on a site and come across pages like “Sitemap”, “About”, “Checkout”, and so on among the regular results? Then you know this feeling.

If you’re a blogger, limiting search results to posts only will make it easier for your visitors to find the content they’re looking for.

It ensures a better user experience and reduces the bounce rate, one of the crucial ranking factors in Google.

Besides, satisfied users who found the right content on your site are more likely to return again and become the loyal audience.

Are you an online store owner? Technical pages in search results distract your customers from searching for products.

Removing these pages can improve conversion and make your store look more professional.

Now, let’s talk about how you can limit the search on your WordPress site to only posts.

How to Limit Search to Only Posts in WordPress

The fastest and easiest way to limit search to only posts in WordPress is to use a plugin like SearchWP.

SearchWP logo

Used by over 30,000 sites, SearchWP is the best WordPress search plugin. Using it, you can limit search on your site to only posts, pages, or custom posts types in a few clicks, without writing any code.

Some of its other features also include:

  • Keyword stemming. Do you want to make your WordPress site recognize that search terms like “search” and “searching” are relevant to the same content? SearchWP allows you to enable search for matches related to the keywords you enter, just like in Google.
  • Custom fields indexing. The native WordPress search engine doesn’t consider any data stored within the custom fields. It makes it impossible to search on sites that actively use custom post types properly. SearchWP allows you to tackle this issue and make custom fields searchable in a few clicks.
  • Search activity tracking. Wonder what your visitors are searching for on your site? SearchWP gives you a full report on your visitors’ search behavior so you can better know your audience and meet their content needs.

Now, let’s proceed to the step-by-step tutorial on limiting search to only posts using the SearchWP plugin.

Step 1: Install and Activate SearchWP

The first step is to grab your copy of SearchWP here.

After that, navigate to the Downloads tab in your SearchWP account.

go to the downloads tab

Once there, press the Download SearchWP button and save the plugin to your computer.

download the searchwp plugin

After you download the plugin, copy your license key as you’ll need it soon to activate your license.

copy your license key

Then, go to your WordPress site dashboard and upload the SearchWP plugin ZIP file.

Need help with that? Please check out the how to install a WordPress plugin step-by-step tutorial.

After installing and activating the plugin, click the SearchWP button at the top panel of the WordPress dashboard.

go over to the searchwp settings

In the SearchWP settings, click the License tab.

go over to the license tab

Paste your license key into the appropriate field and press Activate.

activate your license

That’s it. You’ve successfully activated your SearchWP license. Now, you can fully use SearchWP to improve search on your site.

Step 2: Customize the WordPress Search Engine

Now you’re ready to move to the next step and start customizing your WordPress search engine.

Think of a search engine as a set of rules that you can edit to control how search works on your site.

To get started, go over to the Engines tab in the SearchWP settings.

go to the engines settings

Here, you can customize your default search engine and add new ones.

the list of search engines

For example, you can change the list of sources where WordPress searches. You can also adjust the weight of attributes that WordPress considers when performing a search.

It’s like you’re customizing the Google search algorithm but only for your site.

Now, to limit search to only posts, let’s just remove any other sources from the default search engine source list. This way, your search engine will consider only posts when performing a search.

To do so, press the Sources & Settings button at the top right.

press sources and settings

Then uncheck the sources you’d like to remove. In our case, let’s uncheck Pages and Media, to leave Posts as the only active source.

uncheck pages and media sources

After you’ve finished, click Done.

press done

Then, press Save Engines to save the changes we’ve done.

click save engines

That’s it. You’ve now successfully limited search on your site to posts only.

Step 3: Test Your New Search

Now, let’s test our customized search engine. For the purposes of this tutorial, we’ve created a post and page, both entitled “WordPress”.

In the parentheses next to their titles, we indicated what type of content they belong to. It will allow us to find out whether the search restriction works or not.

the wordpress post

Now, let’s go over to the website and check what search results we’ll get after searching for “WordPress”.

First, click the Visit Site button under your site’s name.

click the visit site button

Then, enter the search term you’d like to test into the search box on your website and press Search. In this example, we’ll search for “WordPress”.

press search

As you can see, there is no “WordPress (Page)” among the search results.

the search results

It means that we’ve successfully excluded all types of content from search results, except for posts.

So, in this article, you learned how to easily limit search to only posts in WordPress.

Ready to limit search to only posts on your WordPress website – no coding needed? You can grab your copy of SearchWP here to get started.

Have any problems with search on your site? Check out this step-by-step tutorial on how to fix WordPress search not working.

Wondering how to add a search bar? Check out how to add a search bar in WordPress in 4 different ways.

Want to make your search awesome right now?

More than 30,000 sites have chosen SearchWP!

You can utilize all of the content that’s gone unrecognized by native WordPress keyword search instantly with SearchWP.

Get SearchWP for just $99

  • Committed Support
    If you need help, support is fast, friendly, and here for you
  • Streamlined Setup
    Installation and setup that’s optimized for speed
  • Great Documentation
    Helpful, clear, and usable documentation is a priority

See what SearchWP customers have to say

  • “With SearchWP you can tweak your search results so you can better target the needs of your site visitors. You have the power to expand your search into custom fields, target specific areas of your site such as taxonomies, post types, and on and on.”

  • “Easy to setup and tweak to your needs. Hooks and filters make it easily extendable.”

  • “My company is using Wordpress internally as Knowledge base system. We choose to not use menu and base everything on the search engine like Google does. SearchWP is an extremely efficient tool to find what we need quickly. I would recommend it.”