Created
August 5, 2016 08:43
-
-
Save gwarnants/0fc906d170e15188688d4182f096fdfd to your computer and use it in GitHub Desktop.
Disable pages indexation in Drupal (meta robots=noindex)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_preprocess_html(). | |
*/ | |
function <theme>_preprocess_html(&$vars) | |
{ | |
$meta = array( | |
'#tag' => 'meta', | |
'#attributes' => array( | |
'name' => 'robots', | |
'content' => 'noindex, nofollow', | |
), | |
); | |
drupal_add_html_head($meta, 'robots'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment