Don't Crawl Posts,Categories Using Meta Tags in Wordpress

If we want to google or other search engines do not crawl our posts and categories in wordpress . For this we can use following script,
Go to functions.php file in your theme-:

function add_meta_tags()
{
      if(is_single() || is_archive())
       { ?>
         <meta name="robots" content="noindex,nofollow"/>
       <?php  }
}

add_action('wp_head ','add_meta_tags');

If you want to use other pages like author,tags and date just replace if statement

if(is_author() || is_tag() || is_date())

Thanks.

Comments

Popular posts from this blog

How to Get Access of Database of Dynamic Site Without cPanel Details

Create New Project in Laravel

How to Create Secondary Menu in Squarespace