Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I just realized in testing, it appears worpress search is not matching my search term "php" with any post's tagged with "php" or in a category of "php" unless php is in the title or body, is that all the search searches for?

share|improve this question
add comment

1 Answer

yes, WordPress search only searches title or post content. There are a few plugins that extend search to taxonomies, Relevanssi is one.

EDIT - The query WordPress produces for default search:

SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID
FROM wp_posts  WHERE 1=1
AND (((wp_posts.post_title LIKE '%test%')
OR (wp_posts.post_content LIKE '%test%')))
AND wp_posts.post_type IN ('post', 'page', 'attachment')
AND (wp_posts.post_status = 'publish'
OR wp_posts.post_author = 1
AND wp_posts.post_status = 'private')
ORDER BY wp_posts.post_date DESC
LIMIT 0, 10
share|improve this answer
    
thanks, ill just have to remember to include the tags/category term somewhere in the content –  jasondavis Oct 10 '11 at 17:18
    
I think what @Milo says is not correct. Default search can search taxonomies and custom fields. Check this analysis here: gist.github.com/2023628 –  p.a. Sep 21 '12 at 7:36
    
@p.a. - you can obviously query taxonomies and custom fields but the actual query WordPress performs when you do a search does not include those things. see edit above for SQL WordPress produces when you perform a search. –  Milo Sep 21 '12 at 14:18
    
@Milo I lost you; can Wordpress search for custom taxonomies and custom fields via Wp-Query or not? This is important for my dev plans. Thanks –  p.a. Sep 21 '12 at 19:09
    
@p.a. - you can't do a full pattern match search of everything simultaneously without directly modifying the query via filters like posts_join and posts_where –  Milo Sep 21 '12 at 19:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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