• Hello!

    Is there a way to exclude content inside a shortcode?

    We are using the Divi theme and want to exclude content inside fullwidth sliders from the search results.

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Exclude where? In indexing, or in excerpts? What is the name of the shortcode you want to exclude?

    Thread Starter SeeThrough Web

    (@seethroughweb)

    Hi Mikko,

    Ideally both, we don’t want the content to be indexed or shown in the excerpts.

    The shortcode starts with et_pb_fullwidth_slider

    Plugin Author Mikko Saari

    (@msaari)

    If you add this to your theme functions.php and rebuild the index, does it fix the problem?

    add_filter( 'relevanssi_page_builder_shortcodes', 'rlv_fullwidth_slider' );
    function rlv_fullwidth_slider( $shortcodes ) {
        array_unshift( $shortcodes, '/\[et_pb_fullwidth_slider.*?\].*\[\/et_pb_fullwidth_slider\]/' );
        return $shortcodes;
    }

    If so, I can make this adjustment to Relevanssi Divi features in the next version. Currently Relevanssi will just remove the slider shortcode tags, but not the contents.

    Thread Starter SeeThrough Web

    (@seethroughweb)

    Hi Mikko,

    No we’re still seeing the content on the search results.

    Plugin Author Mikko Saari

    (@msaari)

    Have you made the change outlined here to make Divi use Relevanssi excerpts? That is, are those excerpts generated by Relevanssi in the first place?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Exclude content inside a shortcode’ is closed to new replies.