Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Keep tag, date and author archives out of Google

Tag, date and author archive pages ask search engines not to index them (links on them are still followed). Search results show your posts instead of lists of them.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Category SEO
  • Tested with WordPress 7.1
PHP
<?php

add_filter(
	'wp_robots',
	static function ( $robots ) {
		if ( is_tag() || is_date() || is_author() ) {
			$robots['noindex'] = true;
			$robots['follow']  = true;
		}
		return $robots;
	}
);

Good to know

Categories aren’t included: they’re often worth indexing. SEO plugins have this as a setting.

In these packs

  • SEO basics: Meta descriptions, social sharing tags, article structured data and cleaner indexing, for sites without an SEO plugin.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.