• Resolved documentaryvine

    (@documentaryvine)


    Hi,

    I’m a bit sleep deprived so perhaps I’m just being dumb, but I can’t work out how I make new tags noindex by default?

    So when I create a new post and enter some new tags, the tag pages are set to ‘noindex’?

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi @documentaryvine,

    You can set all tags to have noindex applied to them by default.
    However, this won’t allow you to enable indexing again.

    So when I create a new post and enter some new tags, the tag pages are set to ‘noindex’?

    This is possible, via a filter.

    The following filter only runs before the term is saved with TSF enabled, and it can be added to your theme’s functions.php file.
    I haven’t tested it, but it ought to work 🙂

    add_filter( 'the_seo_framework_get_term_meta', function( $meta = array(), $term_id = 0 ) {
    	if ( is_tag( $term_id ) ) {
    		$meta['noindex'] = 1;
    	}
    
    	return $meta;
    }, 10, 2 );

    Cheers!

Viewing 1 replies (of 1 total)
  • The topic ‘Tags noindex by default?’ is closed to new replies.