Now on all pages of the site in my head

<meta name="robots" content="index, follow" /> 

This phrase is the default for all pages of the site on Wordpress. What code and where to change so that on the categories and tags pages were:

 <meta name="robots" content="noindex, nofollow" /> 

    1 answer 1

    in the directory \wp-content\themes\название_вашей_темы your_theme_name, see the file header.php . With great probability, the code you need lies there. Otherwise, see index.php there, or go search the files in this folder if the topic is relatively complex.

    If on all pages of headings and tags you need to disable indexing, then the plug will be such

     if (is_category() || is_tag()) { ?><meta name="robots" content="noindex, nofollow" /><?php } else { ?><meta name="robots" content="index, follow" /><?php } 
    • so there is only this code in header.php that <meta name = "robots" content = "index, follow" />. It acts on all pages. There is nothing in index.php. Somehow I need to make a condition somewhere, it is possible for certain pages to output <meta name = "robots" content = "noindex, nofollow" />. Just how and where to do I do not know. This is my question - Beginner
    • updated the answer, added a fork - alenkins
    • just that you didn’t put the <? php like - Beginner
    • Well, this is directly inserted into <head> instead of <meta name = "robots" content = "index, follow", right? - Beginner
    • well .. not .. all right, just stayed on all pages anyway <meta name = "robots" content = "index, follow" /> u Maybe I have is_category () on another way .. how can I check this? - Beginner