Adding custom META tags to theme header
There are many plugins that allow you to manage your HTML header and help insert tags for Google, MSN and Yahoo webmaster, BlogCAtalog and many other services that require adding some tag to the header of your HTML.
Managing these META tags with the help of a plugin helps keep your tags nice and tidy even when changing themes.
I will show here how to create your own little plugin to manage your HTML META tags and make sure that they never get lost again.
Below you will find a snippet of code that you can put in a empty my_header_plugin.php and place in your plugin directory.
You may find some examples for the top 3 search engines webmaster tool verification META tags used to verify ownership of your site.
Just replace the placeholders below with your valid keys.
<?php
/*
Plugin Name: My META tags
Version: 0.1
Plugin URI: http://blog-install.com/plugins/
Description: Insert META tags into your HTML headers
Author: blog-install.com
Author URI: http://blog-install.com
*/function insert_my_meta_tag() {
echo <<<EOT
<meta name="blogcatalog" content="INSERT_BLOG_CATALOG_HERE">
<meta name="verify-v1" content="INSERT_GOOGLE_WEBMASTER_KEY_HERE">
<meta name="y_key" content="INSERT_YAHOO_WEBMASTER_KEY_HERE">
<meta name="msvalidate.01" content="INSERT_MSN_WEBMASTER_KEY_HERE">
EOT;
}
add_action('wp_head', 'insert_my_meta_tag',3);
?>
Tweet This Post!



