Skip to main contentSkip to footer

A Relevanssi Premium customer bumped into a weird problem with CM Tooltip Glossary (and probably Elementor). Using Elementor, CM Tooltip Glossary and Relevanssi custom excerpts together caused the search results to break in an unusual way: each page of the search results showed the same results.

I couldn’t figure out what’s causing this, but it was this particular combo: disabling CM Tooltip Glossary helped, and so did disabling Relevanssi custom excerpts.

In the end, the solution I came up with was to remove all CM Tooltip Glossary filters on the_content with a simple filter function. This does not affect CM Tooltip elsewhere, but removes this problem:

add_action( 'relevanssi_pre_the_content', 'rlv_disable_cmtt_content_filters' );
function rlv_disable_cmtt_content_filters() {
    global $wp_filter;
    foreach ( array_keys( $wp_filter['the_content']->callbacks ) as $priority ) {
    	$wp_filter['the_content']->callbacks[ $priority ] = array_filter( $wp_filter['the_content']->callbacks[ $priority ], function( $key ) {
    		if ( 'CMTT' === substr( $key, 0, 4 ) ) {
    			return false;
    		}
    		return true;
	    }, ARRAY_FILTER_USE_KEY );
    }
}

Add this to your site.

Your account

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

Search

Popular Resources

Modernize
Modernize is a neat Premium theme that has a problem with Relevanssi. Relevanssi highlighting can cause problems on Modernize search…
GDPR Compliance
We have a privacy policy that covers your use of this web site and our customer data use. However, if…
Martfury
Martfury is a WooCommerce theme that comes with a built-in dropdown search. That’s great, except that as usual the dropdown…

Related Posts:

Comment Section:

2 Comments. Leave new

  • Yazan Yousef
    August 6, 2021 2:00 pm

    Very interesting. I happen to also be using CM Tooltip Glossary and Relevanssi Premium, latest version of each, and have not encountered that issue – granted, I don’t use Elementor.

    Reply

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