Im looking for a way to make tags a searchable object. To clarify, Im NOT trying to make the search engine search posts by looking at its tags, but I want tags to show up in the results just like a post. any help would be much apreciated


You'd have to do some modification to the generated SQL query via filters: posts_search, posts_join, posts_where.

Or you can just use the plugin Search Everything.


There isn't a way to do this "out of the box". However, what you could do is setup your search page to search for tags, categories, and other taxonomies before (or after) searching for posts. With a little effort you could intersperse them as well, but pagination would be tough -- your best bet is to have multiple search results areas, "Matching Tags", "Matching Categories", "Matching Posts", etc. See get_terms for everything you need to know to search taxonomies!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.