<?php

// Add a Shortcode to exclude content from SearchWP's index.
// @link https://searchwp.com/documentation/knowledge-base/prevent-indexing-segments-of-content/
add_shortcode( 'searchwp_no_index', function( $atts, $content = null ) {
	// If the indexer is running do not return anything,
	// else return the content contained in the Shortcode.
	return did_action( 'searchwp\indexer\batch' ) ? '' : $content;
} );