Continue reading Blocking pre and code tags

Blocking pre and code tags

If your posts have lots of programming code examples in <pre> and <code> tags, those might look pretty bad in the search results. A snippet of programming code isn’t usually a good excerpt, and if you use those tags purely for code snippets, they won’t likely contain significant search content, either. Fortunately it’s easy to…

Read more Blocking pre and code tags 0 Comment on Blocking pre and code tags
Continue reading bbPress: Indexing topics and replies

bbPress: Indexing topics and replies

Relevanssi does work with BBPress. BBPress forums, topics and replies are regular WordPress posts. In order to get Relevanssi working with BBPress, you need to make Relevanssi index post type “topic” (forget “forum”, and I think it’s better if you skip “reply” as well). Since “topic” is non-public post type, you also need to uncheck…

Read more bbPress: Indexing topics and replies 4 Comments on bbPress: Indexing topics and replies
Continue reading Indexing additional content

Indexing additional content

Sometimes you may want to index additional content to your posts. Perhaps dynamic content generated by some PHP script, perhaps data from another, external database. It is quite easy, as there’s a simple filter you can use. When Relevanssi indexes a post, it calls relevanssi_content_to_index to see if there’s additional content to index. This filter…

Read more Indexing additional content 8 Comments on Indexing additional content
Continue reading Which custom fields had the hit?

Which custom fields had the hit?

While the free version of Relevanssi will match search terms in custom field content, it doesn’t know which custom field had the matching content. Premium has that information and it can be made available. First, you need this in your functions.php: add_filter(’relevanssi_match’, ‘cfdetail’); function cfdetail($match) { global $customfield_data; $customfield_data[$match->doc] = $match->customfield_detail; return $match; }add_filter(‘relevanssi_match’, ‘cfdetail’);…

Read more Which custom fields had the hit? 10 Comments on Which custom fields had the hit?
Continue reading Modify excerpts with relevanssi_excerpt_content

Modify excerpts with relevanssi_excerpt_content

From free 2.9.1 and Premium 1.5.8, there’s a new filter that makes modifying the excerpts easier. The relevanssi_excerpt_content filter is run after the post content is run through the the_content filter and before any other cleanup is done. This is a good point to insert for example custom field content. The filter hook passes three…

Read more Modify excerpts with relevanssi_excerpt_content 35 Comments on Modify excerpts with relevanssi_excerpt_content