Skip to main contentSkip to footer

The Premium version of YITH Badge Management has a search feature for badges. Using Relevanssi breaks that badge search. Fortunately, it’s easy to fix. Add this to your site:

add_filter( 'relevanssi_prevent_default_request', 'rlv_yith_badge_management', 10, 2 );
add_filter( 'relevanssi_search_ok', 'rlv_yith_badge_management', 10, 2 );
function rlv_yith_badge_management( $do_stuff, $query ) {
	if ( 'yith-wcbm-badge' === $query->query_vars['post_type'] ) {
		$do_stuff = false;
	}
	return $do_stuff;
}

Now Relevanssi won’t interfere with the YITH Badge Management search.

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

Effect of Relevanssi on page speed

…So, if having a big Relevanssi table slows down the site, the effect should definitely be visible on this site. I ran three tests using a speed test tool provided by my hosting provider Seravo (one of the best WP hosting companies in the world, by the way). It’s basically……accessed at all except during searching, so it shouldn’t matter how big the table is. Fortunately site speed is something that can be measured, so we can make some actual experiments here. The experiment I used Kirjavinkit as the testing ground, because it’s one of the biggest sites I run….

Search is ignoring accents
In general, searches ignore accents, which is generally a good idea: for example in French, the difference between e and…
Auto-redirecting with one search result

…$wp_query; if ( 1 === $wp_query->post_count ) { switch_to_blog( $wp_query->posts[‘0’]->blog_id ); wp_redirect( get_permalink( $wp_query->posts[‘0’]->ID ) ); exit(); } } } The code is originally from WP Beginner. If you want to redirect particular search terms to posts without going through the search results page, that looks like this: add_action( ‘template_redirect’,…

Related Posts:

Comment Section:

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed