Here is the exact query (copy and pasted) SELECT * FROM wp_posts WHERE post_content LIKE '%Jon 1%' OR post_content LIKE '%Jonah 1%' OR post_content LIKE '%Jon. 1%' OR post_content LIKE '%Jona 1%' OR post_content LIKE '%Jo 1%' AND post_status = 'publish' AND post_type = 'post' Code (markup): The problem is that it is still pulling results with a post_status of "inherit" and post_type with 'page'. I want only results with publish as the post_status and "post" as the post_type. Any idea why it would be doing this? Is it the "OR's"?
replaceing AND for the ORs wont work ether SELECT * FROM wp_posts WHERE (post_content LIKE '%Jon 1%' OR post_content LIKE '%Jonah 1%' OR post_content LIKE '%Jon. 1%' OR post_content LIKE '%Jona 1%' OR post_content LIKE '%Jo 1%') AND post_status = 'publish' AND post_type = 'post' Code (markup): add brackets to make the like statement one statment - if you replace with ANDs then the postcomment will have to be like all the terms at once