SearchWP Blog

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

How to limit WordPress search to post titles only

Are you wondering how to limit WordPress search to post titles only?

By default, WordPress doesn’t allow you to choose which parts of posts or pages it should consider when performing a search.

So, usually, you need to have extensive coding experience to apply any type of search limitations on your site.

In this article, we’ll show you how to limit WordPress search to post titles only without writing a single line of code.

Why Limit WordPress Search to Post Titles Only

There are a bunch of benefits in limiting search on your site to post titles only.

limit search to titles only

Here are the ones that stand out the most:

  • More relevant search results. Typically, there is a lot of unnecessary information in post descriptions, which makes it harder to find the right content.
  • Lower bounce rate. The easier it is for visitors to find what they’re looking for on your site, the lower your bounce rate will be.
  • Better ranking in search engines. Since bounce rate is one of the main ranking factors in Google, keeping it low allows your site to rank higher in search results.
  • Build a loyal audience. Satisfied visitors who could easily find the desired content on your site are more likely to return again.
  • Content discoverability boost. When visitors see that search on your site is convenient, it encourages them to explore your site.

Now that we know why it’s useful to limit search to post titles only, let’s see how you can do that on your site.

How to Make WordPress Search by Post Titles Only

The easiest and fastest way to make WordPress search by post titles only is to use a plugin like SearchWP.

SearchWP

SearchWP is the best search plugin for WordPress, with over 50,000 active installations. It comes with a lot of useful features that allow you to fully customize the way search works on your site.

In addition to limiting search only to posts, pages, or their specific parts, with this plugin, you can do a lot of useful things.

For example, you can exclude specific search results, make custom post types searchable, add a search bar to any place on your site, and more.

Along with this, SearchWP comes with powerful features like:

  • Search activity tracking: Want to know what visitors were searching for on your site? SearchWP gathers detailed data on your audience’s search behavior so that you can better understand their needs.
  • Seamless WooCommerce integration: Are you a WooCommerce store owner? Due to the integration with SearchWP, you can start customizing search on your store right after the plugin installation.
  • Live search results: Want to display search results on your site in live mode? Using SearchWP, you can add live search with autocomplete feature to your site with a few clicks.
  • Support of multiple search engines: Want to create custom search fields with unique settings? SearchWP allows you to add an unlimited number of fully customized search engines and link them to separate search forms.

Now that you know why using SearchWP is the best option for limiting search on your site to post titles, let’s see how you can do it.

Step 1: Install and Activate the SearchWP Plugin

The first step is to grab your copy of SearchWP by visiting the website and signing up for a new account.

Once done, you can sign in to your SearchWP account and go over to the Downloads tab.

Download SearchWP plugin from account area

Then, click on the Download SearchWP button and save the plugin’s ZIP file to your computer.

After you’re finished downloading, also copy your license key on the same tab. You’ll need it at one of the next steps to activate your copy of SearchWP.

The next step is to upload the downloaded ZIP file to your site and install the plugin.

If you haven’t installed a plugin before, then check out this guide on how to install a WordPress plugin for step-by-step instructions.

Upon activation, you can go through the setup wizard by clicking the ‘Start Onboarding Wizard’ button.

Onboarding wizard SearchWP

Next, you’re ready to start customizing your search engine.

Step 2: Customize Your Search Engine

To get started, you’ll need to navigate to SearchWP » Algorithm from your WordPress dashboard

Here you’ll find your search engines created with SearchWP. Right now, there is only one search engine called Default. This search engine is connected to every single search form that exists on your site.

It means that by editing its settings, you can customize how search works across your entire site.

For example, you can add or remove search sources, exclude specific pages or categories from search, and much more.

SearchWP allows you to add multiple search engines and link them to separate search forms. Due to this feature, you can place fully customized search forms with a unique set of settings.

But since we want to limit search to post titles on the whole site, we will customize the Default search engine.

First, you will need to press the Sources & Settings button.

Edit or add new search engines in WordPress

Next, a popup window will open with different sources used by the default engine. These include posts, pages, and media.

Go ahead and uncheck the Pages and Media sources so that only the Posts search source remains active.

Select posts as only source

When you’re finished, simply click Done.

The next step is to customize the list of post attributes that WordPress takes into account when performing a search.

You’ll notice that it considers 5 post attributes: title, content, slug, excerpt, and author.

Add attribute for post

To make WordPress only consider post titles, you need to remove all attributes except title. Simply click the Add/Remove Attributes button to get started.

Then, go ahead and uncheck all other attributes, other than ‘Title.’

Manage post attributes

When you’re finished, press Done.

The final step is to press the Save button at the top right to apply the changes you’ve made.

Save engine settings

After you’ve limited search on your site to post titles only, let’s check out how it works.

Step 3: Test Your New Search

To do that, simply visit your website and head to the search bar or search form.

For the purposes of this tutorial, we added a post with the Greek salad title and Onion soup description to our test site.

If we can find this post by title but can’t find it by description, it means that search on our site is now limited to post titles only. First, let’s search for “onion soup”.

search for description

As you can see, we didn’t find any matches for the “onion soup” search term.

It means that our WordPress site no longer considers a post description when performing a search.

we haven't found a product by description

Now, let’s search for “greek salad” to make sure that post exists.

This will ensure that the search is able to find the content by the title.

click Find Results

As you can see, we found the post.

It means that our WordPress site now only considers post titles when performing searches.

we found a product by title

FAQs About Limiting WordPress Search to Post Titles

Here are some common questions that users have about restricting search on their site to post titles.

1. Why would I want to limit WordPress search to post titles only?

Limiting WordPress search to post titles can enhance search relevance, especially if you have a large amount of content. This ensures that search results are more focused and directly relevant to the search query, as they match the titles specifically.

2. Is there a plugin that can help me limit searches to post titles in WordPress?

Yes, you can use plugins like SearchWP to customize and limit searches to specific areas, such as post titles.

3. Can I implement this search limitation without a plugin?

Yes, it’s possible to achieve this by modifying your theme’s functions.php file or creating a custom search query. However, using a plugin can be more user-friendly and easier to maintain.

4. How does limiting search to titles impact SEO?

This change only affects how searches function internally on your site and does not directly impact your site’s SEO. However, it may improve user experience by providing more relevant search results, potentially leading to better user engagement.

What’s Next…

Limiting WordPress search to only titles helps you to give your visitors more relevant search results and reduce your site’s bounce rate. It also boosts engagement and makes the search experience better. 

We hope this article helped you learn how to limit WordPress search to post titles only. You may also want to see our guide on how to make WordPress search in post content and how to customize your WordPress search results page.

If you’re ready to limit search on your WordPress site to post titles only, you can grab your copy of SearchWP here.

author avatar
Aazim Akhtar

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