Skip to content

How to Search Posts by Title Only in WordPress?

Key Takeaways

  • Nexter Blocks Search Bar block narrows WordPress search to post titles only, or to excerpt, content, permalink, category, or tag, from a single filter panel in the WordPress Block editor.
  • Search Bar block uses Source set to Post and Select Post set to Posts to make the WordPress search bar look through standard blog posts only and skip pages, products, or custom post types.
  • Generic Filters keeps Search in Title toggled on and turns off Excerpt, Content, Permalink, Category, and Tags, so the search bar returns only posts whose titles contain the searched words.
Table of Contents

WordPress searches title and content together, which is why a search for a common word can return most of your site. Matching titles only gives a much shorter, more predictable list.

On the Search Bar block this is the default, and the measured difference is large.

For every Search Bar setting in one place, see the Search Bar guide.

Before You Start

  • Edition: Free. Measured with Nexter Blocks Pro deactivated, the Search Bar renders identically — form, input, dropdowns, suggestions and results all work without Pro.
  • Block to enable: Search Bar, switched on under Nexter > Blocks in your WordPress dashboard.
  • Published content to find. The block searches your real posts, so a site with nothing published returns nothing.

Steps

  1. Select your Search Bar block and open the search field settings.
Search field settings
  1. Leave title on and switch every other field off, then publish.
Title matching only

How It Behaves

  • Title matching is already the default. An untouched Search Bar matches titles and nothing else.
  • The difference is measurable. On a 14-post site, a common term matched 4 posts by title. With the field filters switched off entirely, the block falls through to WordPress’s own query and the same term matched 15.
  • Partial matching is the default. A term matches anywhere inside the title.
  • Full match requires the whole title to equal the term. Measured: a partial search returned 4 results, the identical term as a full match returned 0.
  • It degrades to an ordinary search. The block renders a real <form method="get"> pointing at your site root, so with JavaScript disabled the bar still submits and lands on WordPress’s own search results.

Limitations

  • Anything only mentioned in the body becomes unfindable. That is the trade you are making, and it is the right one only if your titles are descriptive.
  • Full match is almost never what you want for a search box. It is useful for reference lists and part numbers, not for prose titles.
  • Matching is literal. A plural, a misspelling or a synonym will not match.
  • Switching every field off does not narrow the search, it widens it, because the block then hands the query to WordPress rather than filtering itself.

Troubleshooting

Results are far broader than I expected

Check that at least one field filter is still enabled. With all of them off the block stops filtering and passes the term to WordPress, which searches content as well.

Nothing matches at all

Full match is probably on. It requires the entire title to equal what was typed.

A post with the word in its title is missing

Confirm the post is published, and that its type is included in the searched types.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!