How do I add a specific meta-tag to all the pages of a site?
You can use the Metatag module for this, in order to add meta tags to every page of your site:



If you want to do it by coding, it is possible to implement the theme_preprocess_html hook to add the meta tag manually:

function theme_preprocess_html(&amp;$variables)
{

    $noindex = [
            '#tag' =&gt; 'meta',
            '#attributes' =&gt; [
                'name' =&gt; 'robots',
                'content' =&gt; 'noindex',
            ],
        ];
    $variables['page']['#attached']['html_head'][] = [$noindex, 'noindex'];
}


(more details here: https://stackoverflow.com/questions/35913739/add-meta-tag-to-head-in-drupal-8)