HowTo: Add Google Webmasters Tools verification meta tag via the themes template.php file.

This guide refers to the meta tag verification method available for Google Webmaster Tools and these instructions are specific for Drupal 7.

You can also add any other meta tag you require using this guide.

edit: Since writing this guide a module has popped up that does all this for you. You can find the Site verify module here. However, if you require a more complex approach - see the first comment for an example - or just want to learn a bit more about how it works or simply prefer the DIY approach then please do read on:

What you require:

  • Google Webmasters Tools Account - sign up here: https://www.google.com/webmasters/tools/
  • Custom theme (or a copy of a supplied theme) in either /sites/default/themes/ or /sites/all/themes/
  • Google Webmaster Tools Verification Code (meta tag)

1) Make sure you have your Google Webmaster Tools Verification Code meta tag. It looks something like this:
<meta name="google-site-verification" content="abcdefghijklmnopqrstuvwxyz0123456789" />

Subscribe with RSS Subscribe to RSS - webmaster