Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter fletsch

    (@fletsch)

    Any chance to get help? I guess it’s not a big deal to adapt this code for Better Search?

    
    add_filter('relevanssi_pre_excerpt_content', 'rlv_trim_vc_shortcodes');
    function rlv_trim_vc_shortcodes($content) {
        $content = preg_replace('/\[\/?vc.*?\]/', '', $content);
        $content = preg_replace('/\[\/?mk.*?\]/', '', $content);
        return $content;
    }
    Plugin Author Ajay

    (@ajay)

    You can use bsearch_content instead of the relevanssi filter if you’re using seamless mode or get_bsearch_excerpt if you’re not using seamless mode.

    Hello,

    Can you please specify the exact code to add to the theme’s functions.php to filter out the Visual Composer shortcodes?

    We have seemless mode turned off.

    Thanks!

    Plugin Author Ajay

    (@ajay)

    
    add_filter('get_bsearch_excerpt', 'rlv_trim_vc_shortcodes');
    function rlv_trim_vc_shortcodes($content) {
        $content = preg_replace('/\[\/?vc.*?\]/', '', $content);
        $content = preg_replace('/\[\/?mk.*?\]/', '', $content);
        return $content;
    }
    

    Can you try this ?

    That works perfectly. Thank you!

    Plugin Author Ajay

    (@ajay)

    Thanks. That is great to know. One for my FAQ!

    Thread Starter fletsch

    (@fletsch)

    wow that works just perfect!! thanks a lot for your help! =)

    thanks, this helped me aswell.

    Its not working for me. I tried almost all tutorials i found on this. my search results its showing this:

    [/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_single_image image=”17107″ img_size=”718×500″ alignment=”center” onclick=”img_link_large” img_link_target=”_blank”][vc_column_text] Local Stone Fabricator Shop [/vc_column_text][vc_column_text] Courtesy – Shutterstock [/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_single_image image=”17106″ img_size=”full” alignment=”center” onclick=”img_link_large” img_link_target=”_blank”][vc_column_text] Local Wood Fabricator Shop [/vc_column_text][vc_column_text]

    Right now i have this code in function.php

    add_filter('relevanssi_pre_excerpt_content', 'rlv_trim_vc_shortcodes');
    function rlv_trim_vc_shortcodes($content) {
        $content = preg_replace('/\[\/?vc.*?\]/', '', $content);
        $content = preg_replace('/\[\/?mk.*?\]/', '', $content);
        return $content;
    }

    This shortcodes stop showing if i turn off this feature in relevanssi -> Custom excerpts/snippets

    Visual studio -> Version 5.1.1

    Am i doing anything wrong ?

    Plugin Author Ajay

    (@ajay)

    @sahilmoldharia is this question for Better Search or Relevanssi? If it’s Better Search you’ll need to code above

    @ajay its for relevanssi.

    Plugin Author Ajay

    (@ajay)

    @sahilmoldharia You’ll need to post this in the relevanssi forum as they would be better placed to answer. It’s not a plugin I’m familiar with.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Visual Composer Shortcodes in Search Results’ is closed to new replies.