relevanssi_disabled_shortcodes

apply_filters( 'relevanssi_disabled_shortcodes', array $shortcodes )

There are shortcodes that do not work well with Relevanssi. These shortcodes can be blocked from the indexing with this filter hook. Relevanssi disables all shortcodes listed with this hook.

Parameters

$shortcodes
(array) An array of shortcode names to disable. For the default values, see below.

More information

When Relevanssi indexes posts, if shortcode expansion is enabled in the Relevanssi indexing settings, Relevanssi removes uncompatible shortcode functions and replaces them with __return_empty_string() to get rid of the shortcodes.

If you want to add a new shortcode to the block list, do this:

add_filter(
  'relevanssi_disabled_shortcodes',
  function( $shortcodes ) {
    return array_merge( $shortcodes, array( 'blocked_shortcode', 'another_shortcode' ) );
  }
);

Relevanssi Premium users can add blocked shortcodes from the Relevanssi indexing settings.

If you only want to disable a shortcode in the excerpt-building – perhaps it works fine in indexing, but messes up excerpts – you can use the relevanssi_disable_shortcodes_excerpt filter hook.

Here’s the default list of blocked shortcodes:

	$default_disables = array(
		'contact-form', // Jetpack Contact Form causes an error message.
		'starrater', // GD Star Rating rater shortcode causes problems.
		'responsive-flipbook', // Responsive Flipbook causes problems.
		'avatar_upload', // WP User Avatar is incompatible.
		'product_categories', // A problematic WooCommerce shortcode.
		'recent_products', // A problematic WooCommerce shortcode.
		'php', // PHP Code for Posts.
		'watupro', // Watu PRO doesn't co-operate.
		'starbox', // Starbox shortcode breaks Relevanssi.
		'cfdb-save-form-post', // Contact Form DB.
		'cfdb-datatable',
		'cfdb-table',
		'cfdb-json',
		'cfdb-value',
		'cfdb-count',
		'cfdb-html',
		'woocommerce_cart', // WooCommerce.
		'woocommerce_checkout',
		'woocommerce_order_tracking',
		'woocommerce_my_account',
		'woocommerce_edit_account',
		'woocommerce_change_password',
		'woocommerce_view_order',
		'woocommerce_logout',
		'woocommerce_pay',
		'woocommerce_thankyou',
		'woocommerce_lost_password',
		'woocommerce_edit_address',
		'tc_process_payment',
		'maxmegamenu', // Max Mega Menu.
		'searchandfilter', // Search and Filter.
		'downloads', // Easy Digital Downloads.
		'download_history',
		'purchase_history',
		'download_checkout',
		'purchase_link',
		'download_cart',
		'edd_profile_editor',
		'edd_login',
		'edd_register',
		'swpm_protected', // Simple Membership Partially Protected content.
		'gravityform', // Gravity Forms.
		'sdm_latest_downloads', // SDM Simple Download Monitor.
		'slimstat', // Slimstat Analytics.
		'ninja_tables', // Ninja Tables.
	);