Continue reading Searching Bible verses

Searching Bible verses

A common problem with Relevanssi is Bible verses. All that meaningful punctuation and single digits make exact matching of Bible verses really difficult for Relevanssi, and when searching for Bible verses, exact results are what matters – hitting something similar is generally not very helpful. There’s an easy solution, though: use phrases. Wrapping the verse in…

Read more Searching Bible verses 1 Comment on Searching Bible verses
Continue reading Searching between dates

Searching between dates

If you want to have a search with a date range, that’s possible with Relevanssi. It takes a bit of handling, though, as Relevanssi expects date ranges in the date query format, and getting to that from search form can be tricky. Here’s the code you need for date range searches: add_filter( ‘relevanssi_modify_wp_query’, ‘rlv_date_between’ );…

Read more Searching between dates 2 Comments on Searching between dates
Continue reading Debugging Relevanssi searching issues

Debugging Relevanssi searching issues

Relevanssi has plenty of useful filter hooks you can use to debug problems. Here are some examples of how you can use the Relevanssi filter hooks to debug issues. Place the functions one at the time in the theme functions.php file and run a search to see results. Look at the parameters Relevanssi is getting…

Read more Debugging Relevanssi searching issues 0 Comment on Debugging Relevanssi searching issues
Continue reading Relevanssi and Polylang

Relevanssi and Polylang

DEPRECATED: Starting from Relevanssi Premium 2.0 and the free version 4.0, this is no longer necessary. There’s a setting for this in Relevanssi settings panel, under Searching. Relevanssi has an option that restricts the multilanguage searches to just current language. With Polylang, that setting doesn’t actually do anything. Polylang always restricts the searches to the…

Read more Relevanssi and Polylang 2 Comments on Relevanssi and Polylang
Continue reading Yoast Local SEO compatibility issues

Yoast Local SEO compatibility issues

Yoast Local SEO plugin breaks Relevanssi search. It enhances the search by adding meta queries. Unfortunately they don’t work with Relevanssi. The fix is simple, though. Add this to the theme functions.php: add_filter( ‘relevanssi_modify_wp_query’, ‘rlv_meta_fix’, 99 ); function rlv_meta_fix( $q ) { $q->set( ‘meta_query’, array() ); return $q; }add_filter( ‘relevanssi_modify_wp_query’, ‘rlv_meta_fix’, 99 ); function rlv_meta_fix(…

Read more Yoast Local SEO compatibility issues 14 Comments on Yoast Local SEO compatibility issues
Continue reading Adding a custom field filter in the search

Adding a custom field filter in the search

Adding a custom field filter in a Relevanssi search takes a little bit of programming, because the filter needs to create a meta_query that Relevanssi understands. Let’s assume we have some colour information in a custom field that’s called colour_field, and we want to use that to filter the search results. First, let’s add a…

Read more Adding a custom field filter in the search 29 Comments on Adding a custom field filter in the search