What exactly does the ‘s’ parameter search for in WP queries?

As usual it’s most reliable to dump the resulting SQL query and see:

SELECT wp_posts.ID
FROM wp_posts
WHERE 1=1
  AND (((wp_posts.post_title LIKE '%keyword%')
        OR (wp_posts.post_content LIKE '%keyword%')))
  AND wp_posts.post_type="post"
  AND ((wp_posts.post_status="publish"))
ORDER BY wp_posts.post_date DESC LIMIT 0,5

The only two things native search is considering are title and content.

Leave a Comment