I maintain a large number of Magento installations. I tend to find Google verification scripts littered across many production servers and many times the file is created directly on the box, failing to make it into source control, e.g.:


I'm aware of the other ways of verification including meta tags, DNS records. I would be open to any suggestions that detail how you work with site verifications in your production environments.

I'm also curious if anyone has written up a blog or found some explanation of best-practices with regard to maintaining multiple verifications over time which, though I use Google in my example, obviously apply to more than just Google.

  • Am I right in stating those files only need to be there for the initial verification of google. Once done, they could actually be deleted. Not tested, but I am sure that is the case. Thus a process could be to create, verify, and delete (or a scheduled task on the box can grep for and clean them out periodically) – ProxiBlue Sep 3 '13 at 23:05
  • @ProxiBlue - I thought that too, but this -> stackoverflow.com/questions/15837199/… would suggest otherwise (and I have had to periodically had to revalidate and just did it without thinking about it too much) – McNab Sep 3 '13 at 23:08
  • In Magento's case, I suppose an admin section that displayed commonly known verification files that are loaded for that store would be handy. Seems pretty niche, but if you were to include other script based additions (with unique API credentials, that sort of thing) into one area, that would be incredibly helpful when you're jumping back and forth between a handful of sites each day and can't always remember which version of jQuery is there, and which version of JWPlayer is there, etc... – pspahn Sep 3 '13 at 23:51
  • I considered just adding in the meta tag under "Misc Header Scripts" but wasn't sure and too lazy to look into it further. Was curious what other devs do. If you remove the verification files, especially for adwords and some affiliate networks, you need to replace and re-verify. – philwinkle Sep 4 '13 at 0:12
  • I use/prefer DNS verification, so not run into this issue. Then again, later DNS entries ned to be cleared / managed, but since I am a dev, not been my problem ;) – ProxiBlue Sep 4 '13 at 2:40

After much thought and research I've settled on the meta tag in System > Config > Design > Miscellaneous Head Scripts method for the following reasons:

  • It allows me to set a new verification for multiple websites, even by store view (handy for subdomained translations, e.g. en.mystore.com)
  • Prevents files from being created on a production site, omitted from source control, only to lose the on a switch/tag/update/backup/restore later on.
  • It's editible via the CMS, instantly available on all web servers even in a load-balanced situation

The final result:

enter image description here

And how it outputs in source:

enter image description here

  • A client asked us to put the verification code in only the homepage of their website. Do you know if it matter if it's on every page or just on the homepage? Here (support.google.com/webmasters/answer/35179?hl=en), it does say "add to your homepage." – musicliftsme Nov 2 '13 at 0:48
  • 1
    It doesn't matter if it's on every page - but it definitely needs to be on the index page. – philwinkle Nov 2 '13 at 0:57

Another way is to firstly set up google analytics on the site :

System -> Configuration -> Sales -> Google API

and then verify webmaster tools via analytics, no exta code needed.

  • I like this approach now, but 3 years ago this wasn't available. – philwinkle May 19 '16 at 12:31
  • Ah, good point! Don't suppose you know where else the home page title can be cahnged if the home page isn't in CMS->Pages and changing the default title in HTML Head doesn't work ? – garym66 May 25 '16 at 10:40

protected by philwinkle May 19 '16 at 12:31

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.