This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Exclude content from 1 website in multisite

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Exclude content from 1 website in multisite

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #53970
    pbainespbaines
    Participant

    Hi,

    We have a multisite install which is indexing 2 websites. I’m trying to determine if it’s possible to continue indexing both those websites but for one of them, exclude the post content (but keep indexing the website’s post titles, tags, categories etc).

    Thanks

    #53974
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    I’m afraid this is not possible – there is only a single configuration for the network. However it might be doable via a custom code:

    add_action(
    	'asp_it_args',
    	function ( $args ) {
    		if ( get_current_blog_id() == 1 ) {
    			$args['index_content'] = 0;
    		}
    		return $args;
    	},
    	10,
    	1
    );

    The custom code above will turn off content indexing for blog ID = 1, change that to the corresponding blog ID.

    Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.