Posted on


Elementor is a popular page builder. It works rather well with Relevanssi.

Highlight in documents breaks entrance animations

In some cases enabling Relevanssi in-document highlighting breaks pictures with entrance animations. You can add this function to your site to fix the problem.

add_filter( 'relevanssi_clean_excerpt', function( $content ) {
    if ( preg_match_all( '/data-settings="(.*?)"[ >]/', $content, $matches ) ) {
        $source  = array();
        $replace = array();
        foreach ( $matches[1] as $match ) {
            $source[]  = $match;
            $replace[] = str_replace( '"', '"', $match );
        $content = str_replace( $source, $replace, $content );
    return $content;
} );

Conditional and Inline CSS Load Experiment

Elementor has this new experimental feature. For some reason, using it with Relevanssi may cause the inline CSS to disappear from the search results page, leading to broken layouts. Disabling the experimental feature solves this problem.

2 comments Elementor

  1. Relevanssi is providing search results as expected; however when I try to customize the search results page it stops working.

    In Elementor, I go to: Theme Builder > Search Results and add a custom theme to control the display of my search results; however, when I do this I no longer get search results.

    1. I don’t know how Elementor works, so I can’t help with this, unfortunately. It’s possible the Elementor custom theme is incompatible with Relevanssi; I can’t say for sure, because I have no idea how it works.

Leave a Reply

Are you a Relevanssi Premium customer looking for support? Please use the Premium support form.

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