It is generally not advised to directly add markup in the head through template files as it could cause issues on your site.
The recommended way to add meta information to the head is through the metatag module. It also supports tags that are used by social media sites such as Facebook or Twitter.
Alternatively, and if the metatag module does not cover your needs, you can the edit head of the site through the html.html.twig file. Please use a dev instance of your site to make sure that everything works OK before you make changes on your production server.
If a certain theme does not contain this template by default, you should copy it from core/themes/classy/templates/layout/html.html.twig and paste it into the templates folder of your theme.
DO NOT edit the html.html.twig directly into the original folder (https://www.drupal.org/docs/7/site-building-best-practices/never-hack-core).
After you have made your changes clear your Drupal cache so that your site is aware of the new files and edits you have made.
Contact Us
- Post a Public Question
- Email Us
- Live Chat!
-
Drupal 8 Themes »
Thanks so much for your detailed answer. You guys are the best.
Eder Miranda
UNODATA, March 2017I’m marking this as solved. You guys are awesome. I’ll never go anywhere else for my themes. Your service and support have been awesome and this was literally above and beyond. Thanks!
Dan White
President, Nexxus Cloud LLC., April 2015You are great! Problem solved. Thank you so much for nice and helpful support.
Schoonheid in pixels, July 2016
All is good now.
Thanks for your excellent support!David Cardinal
Cardinal Photo, April 2015Find us