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.
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
Post a Comment