• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

WordPress Tips and Tricks

  • Home
  • WordPress Tutorials
  • Useful Links

Change Yoast SEO NoIndex Meta Robots Tag

Home - Code Snippets - Change Yoast SEO NoIndex Meta Robots Tag

November 21, 2019 by wptricks

Yoast SEO was adding noindex to the robots meta tag on all custom post types archives. The following code changes it to index.

/* change noindex tag for cpt archives */
add_filter( 'wpseo_robots', function( $string ) {
	if ( is_post_type_archive() )
		return 'index, follow';
	else
		return $string;
});
Category: Code Snippets, SEO
Next Post:Enable Gutenberg in Custom Post Types Content Editor

Sidebar

Recent Posts

  • Truncate Text with CSS
  • CSS { In Real Life }
  • Prevent Links in Gravity Forms Paragraph Text Field
  • Meta Description on Pages
  • Find Out Which Host a Website is On

Categories

  • Code Snippets
  • Design Resources
  • Fonts
  • SEO
  • Tutorials
  • Uncategorized
  • Useful Links
  • WooCommerce

A Few of Our Favorite Products


Copyright © 2023 · WordPress Tips and Tricks · All Rights Reserved

Back to top