I want to know which filter hook I should use that performs faster.
I did try both several times and I noticed that
posts_search is a bit faster than using the combination of
What is your take on this?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
All of these hooks are called in a similar fashion and get passes similar data. Under normal circumstances there should be no meaningful performance difference between them.
One scenario I can think of is that if you aren't properly targeting your code to specific queries and it runs in every query then
posts_search might fire less time, because other two are conditional on
suppress_filters in query being disabled.