I working with an existing WP site that has a curious thing that is happening that I haven't been able to determine where the issue is?

The large issue is that search always returns no results. I have searched the posts the dashboard and that is able to return results but the non-admin always returns none. When I looked at the SQL query this was the query:

SELECT SQL_CALC_FOUND_ROWS  tvr_posts.ID FROM tvr_posts  WHERE 1=1  AND (0 = 1)   ORDER BY tvr_posts.menu_order ASC LIMIT 0, 3  

It never shows the search string and the 1=1 AND (0 = 1) seems like it would never show anything. Looking for alternate strategies to possible understand what is going on here.

  • What were the query variables passed to the main query though? Are you sure that's the only query around? And this happens with all the plugins disabled and on the default theme? Have you conducted a process of elimination to figure out which plugin/theme is responsible? This is also a standard search query right? And not a custom query that replaces the main query? The question needs much more information to be answerable at the moment, please edit it with more info – Tom J Nowell Jun 6 '18 at 20:21
  • got it, surprise it was a plugin futzing up the search. – pandabrand Jun 7 '18 at 13:32

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.