how to hide specific post from google search

Hook into the action wp_head, test if you are on the category archive or a single post with that category, and print the proper meta element:

add_action( 'wp_head', 'wpse_91073_noindex' );

function wpse_91073_noindex()
{
    if ( ( is_singular() && in_category( 'CATEGORY_SLUG' ) ) 
        or is_category( 'CATEGORY_SLUG' )
    )
    {
        print '<meta name="robots" content="noindex">';
    }
}

Replace CATEGORY_SLUG with the real slug of the category (you can find that in wp-admin/edit-tags.php?taxonomy=category).

Leave a Comment