Webmaster Verification Plugin

Posted by jeff

[UPDATE: this is now the webmaster_tools]

As a contractor I often help clients with basic Search Engine-related tasks such as setting up Google Analytics and webmaster accounts with Google Webmaster Tools, Yahoo! Site Explorer and MSN Live Webmaster Tools.

Three great tastes that don’t taste great together

Each of the Big 3 search engines require webmasters to verify control of their websites and each has their own way to verify ownership. All three offer the option to add a meta-tag to the site, which works well for small teams but can quickly become unwieldy when there are a dozen people that would like access.

In addition, each search engine offers the option to upload a file to the server with a unique name and/or content. Yahoo! requires you to add specific content, Google does not require any content in the file and MSN Live requires a specially formatted XML document with the id’s of all of the authenticated users. With either method, the search engines re-authenticate your site ownership periodically, so you must keep the meta-tags or uploaded files on the server.

While Google allows you to see who else has authenticated (and the key that they use, so you could remove it from the site if need be), Yahoo! and MSN Live do not. So in addition to having multiple files with long, ugly filenames lying around, I also had to keep track of which files pertained to which users.

Keepin’ it clean

After getting that not-so-fresh-feeling from the ways I had handled it in the past, I recently developed the webmaster_verification plugin. This plugin let’s you keep track of each of your authenticated webmasters for all 3 search engines in a single YAML file that looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
  google:
    someone@example.com: google121212.html
    edna: google131415.html
    betty: google3435365.html
  yahoo.com:
    eugene:
      filename: y_key_185746.html
      content: 098374
    edna:
      filename: y_key_185746.html
      content: 323454
  live:
    edna: 6565656564734839

Now, whenever a new user wants to see the webmaster tools they just create an account and email you their passcode along with the email address they used to access the webmaster account. You add the appropriate entries to the YAML file (which doesn’t require the server to be restarted) and the new user can successfully authenticate using the file-upload method.

If one of them stops working on the project, you can easily delete them from verification from all three sites by removing their entries from the YAML config, and the next time the webmaster tools sites re-authenticate those users will be un-verified.

Installation

Via Git:

1
git clone git://github.com/zilkey/webmaster_tools.git vendor/plugins/webmaster_tools

To install, simply run

1
script/generate webmaster_verification

The generator creates a file named config/webmaster_verification.yml and adds a map.webmaster_verification to config/routes.rb. The controller routes will be created auto-magically, thanks to Jamis Buck’s excellent post on routing internals

Can you hear me Tommy?

Google, Yahoo!, MSN Live – if you are listening, here’s what would make your webmaster tools services much more useful:

  • Once a person has verified that they control the site, give them a simple “Add User” option that pre-verifies the new user and sends an email with instructions on how to create an account
  • Allow users to be admins or simply viewers
  • Agree on a standard format for verification – say, a single xml file that looks like:
1
2
3
4
5
<webmasters>
  <webmaster service="Google">1bt57xyt45s</webmaster>
  <webmaster service="Yahoo!">EEbt57xE6gt%</webmaster>
  <webmaster service="Live">AIbt57xHDHD77es</webmaster>
</webmasters>
  • Allow any admin user view all other users and un-verify any user

You agreed on the sitemaps protocol – how about making it a little easier on the admin side?

Comments

Leave a response

Comment