Skip to content

Instantly share code, notes, and snippets.

@wp-seopress
Created February 28, 2019 20:02
Show Gist options
  • Save wp-seopress/d0c884aa43fe491b0efd8ac09a3cb5ec to your computer and use it in GitHub Desktop.
Save wp-seopress/d0c884aa43fe491b0efd8ac09a3cb5ec to your computer and use it in GitHub Desktop.
Filter meta robots
function sp_titles_robots($html) {
//you can add here all your conditions as if is_page(), is_category() etc..
$html = '<meta name="robots" content="noindex"/>';
return $html;
}
add_filter('seopress_titles_robots', 'sp_titles_robots');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment