Skip to content
Snippets Groups Projects
Commit 6a5e7aed authored by Anuprita Kulkarni's avatar Anuprita Kulkarni
Browse files

ISTWCMS-5705 Prevent webforms themselves from being indexed

parent 9316731e
No related branches found
No related tags found
1 merge request!261ISTWCMS-5705 Prevent webforms themselves from being indexed
......@@ -1309,3 +1309,21 @@ function uw_cfg_common_fillpdf_form_form_pre_form_build_alter(FillPdfFormForm $f
$fillpdf_form->set('default_entity_type', 'webform')->save();
}
}
/**
* Implements template_preprocess_html().
*/
function uw_cfg_common_preprocess_html(&$variables): void {
// Setting the meta tag for web forms getting indexed
// if not used any content.
if (!isset($variables['node_type']) || $variables['node_type'] == NULL) {
$noindex = [
'#tag' => 'meta',
'#attributes' => [
'name' => 'robots',
'content' => 'noindex',
],
];
$variables['page']['#attached']['html_head'][] = [$noindex, 'noindex'];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment