Skip to content

How to Search by Post Tag in WordPress?

Key Takeaways

  • Nexter Blocks Search Bar block lets site owners search posts by tags in WordPress by setting Source to Taxonomy and Select Taxonomy to Tags.
  • Search Bar block adds a dropdown beside the search bar, with Label and Placeholder fields for the select dropdown.
  • AJAX Search toggle in the Extra Option tab enables tag-based searches so users can select a tag or directly search for blog posts with a specific tag.
Table of Contents

Tags describe a post more precisely than a category does. If your readers think in tags, give them a tag filter rather than a category one.

The setup is identical to the category version — only the taxonomy changes.

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.
  • Posts with tags applied. The dropdown is built from your tag terms.

Steps

  1. Select your Search Bar block and add a filter field with taxonomy as its source.
Adding a taxonomy filter field
  1. Choose Tag as the taxonomy, then publish and try it.
Choosing the tag taxonomy

How It Behaves

  • The dropdown lists your live tags. Measured on a site with eight tags, the dropdown rendered 9 options including the All entry.
  • Choosing a tag adds a taxonomy condition to the query, exactly as the category filter does.
  • Tags render flat. Unlike categories they have no hierarchy, so there is nothing to indent.
  • Each option can show its post count.
  • Only the title is searched by default. Measured: with the default settings a term matched 4 posts by title; switching the search fields off entirely fell through to WordPress’s own query and matched 15.
  • 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

  • Tags with no posts still appear in the dropdown and return nothing when chosen.
  • A long tag list makes a long dropdown. Sites that tag heavily end up with a dropdown that is hard to scan, which is an argument for filtering by category instead.
  • One tag at a time. There is no multi-select.
  • The tag narrows, it does not search. The typed term still has to match a field.

Troubleshooting

The tag dropdown is empty

No tags exist yet, or the taxonomy was not selected on the filter field.

Choosing a tag returns nothing

Either no post carries that tag, or the typed term does not match any searched field on the posts that do.

I want both a category and a tag filter

Add two filter fields, one per taxonomy. Each renders its own dropdown.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!