Ad

How Can I Add Nofollow Tag To Every Post

- 1 answer

I have simple wordpress site which contains quiz games. User go to my site www.site.com and there he can choose which quiz game he want to play. Every quiz game is a new post.

Every post contains copied description of a PC game (for example GTA V) and several questions. At the end user can see how many mistakes he made by answering.

The thing is, that my site contains a lot of post and every post contains copied description of a video game. Because of that my site was banned from google search for copy content. How can i prevent that? I should add nofollow tag to every post of my site? If so, how can i do that to every post at once?

Ad

Answer

You can use wp_head hook:

add_action('wp_head', function()
{
    if ( is_singular('your_post_type') ) :
        ?><meta name="robots" content="nofollow"><?php
    endif;
});

References:

Ad
source: stackoverflow.com
Ad