Webmaster Tools Verification

All three of the major search engines offer some kind of website service. The most popular being Google Webmaster Tools. Yahoo offers Site Explorer and Bing has Webmaster Center. All three require that you verify your site and offer various methods to do so. This plugin uses the meta option and inserts a meta tag in your sites section of your site.

If you’ve used WordPress.com then this will look familiar since it’s based on that tool.

Installation is simple:

  1. Download the plugin from WordPress.org.
  2. Copy it to the wp-content/plugins directory of your blog.
  3. Enable the plugin in your admin panel.
  4. An option for Webmaster Tools Verification will appear under Settings.
  5. Enter the verification code for each service you wish to use

FAQ

  • Where do I get the verification code?
    Go to either Google Webmaster Tools, Yahoo Site Explorer, or Bing Webmaster Center, find the option to add/verify a new site then select the meta option. You be provided with a piece of code and instructions to add it to your site.
  • What do I do with the code once I have it?
    All you need is the actual content= code, the plugin will automatically format the meta tag when it inserts it.
    Ex.: Google will give you a piece of code like this: <meta name='google-site-verification' content='dBw5CvburAxi537Rp9qi5uG2174Vb6JwHwIRwPSLIK8'>
    You want to copy the code: dBw5CvburAxi537Rp9qi5uG2174Vb6JwHwIRwPSLIK8 and paste it in the input box for Google.
  • I’m using WPMU but I don’t want the plugin automatically activated for each site. Can I just put it in the wp-content/plugins directory so each blog owner can choose whether or not they want it activated?
    WPMU is no longer supported but the plugin should work fine with WordPress in network mode.

Support
If you like this plugin and want to support me, leave a comment or check out my donations and support page!

WordPress MU not adding new users as subscribers to main blog

If you’re using WordPress MU you may have run into a problem where new users aren’t added as subscribers to the main blog (blogid: 1). Some may prefer it this way but I ran into this issue on Stampin Corner because I also wanted users to be able to post in the help forums which use BBPress. For some reason nobody could post in there, and it turns out this was the reason.

According to the developers BBPress is a bit behind handling this integration and it’s assumed at some point it will. That said, I got around this irksome problem by creating my own little plugin. (Actually I maintain a custom-functions plugin for just this type of thing). It’s pretty simple really, just create a new file in your mu-plugins directory and this code to it.

//--------------------------------------------------------//
//---Hook-------------------------------------------------//
//--------------------------------------------------------//
add_action('wpmu_activate_blog', 'add_new_user_to_mainblog', 10,2);
add_action('wpmu_new_blog', 'add_new_user_to_mainblog', 10,2);

//--------------------------------------------------------//
//---Functions---------------------------------------------//
//--------------------------------------------------------//
function add_new_user_to_mainblog($blog_id, $user_id) {
	add_user_to_blog( '1', $user_id, 'subscriber' );
}

Basically all this is doing is using the hook wpmu_activate_blog to trigger the function add_user_to_blog. WPMU also has this habit (not sure why exactly) of removing an existing user from the main blog when they reated another new blog. Not a huge deal again but problematic if they haven’t logged into BBPress already. So the second add_action triggers on wpmu_new_blog to add the user back.

Simple as that. Of course, this doesn’t handle getting any existing users set as subscribers so you’ll have to do those manually or write a script to do it, but any new users should get added just fine.