Wordpress header.php Meta SEO Tricks
- SEO |
(wp-content/themes/yourthemename/header.php)
Place this in your wordpress themes header.php file, if the page is a single, page, or if its the home page then the robots will index and follow links on it. Otherwise search engines will not index the pages but will still follow the links.
<?php if(is_single() || is_page() || is_home()) { ?>
<meta name="googlebot" content="index,noarchive,follow,noodp" />
<meta name="robots" content="all,index,follow" />
<meta name="msnbot" content="all,index,follow" />
<?php } else { ?>
<meta name="googlebot" content="noindex,noarchive,follow,noodp" />
<meta name="robots" content="noindex,follow" />
<meta name="msnbot" content="noindex,follow" />
<?php }?>
OK here is a great resource with all the info you need to know about meta-tags in wordpress:
http://codex.wordpress.org/Meta_Tags_in_WordPress
Basically you need to do this manually by adding the meta-tag code to your theme's header.php file (wp-content/themes/yourthemename/header.php)
add this code between the <head> ... </head> tags:
<meta name="description" content="This is the description sentence or short paragraph about your website." />
<meta name="keywords" content="your, keywords, here" />
If you want to get fancy, you could use the most common additional meta tags:
<meta name="resource-type" content="document" />
<meta http-equiv="content-type" content="text/html; charset=US-ASCII" />
<meta http-equiv="content-language" content="en-us" />
<meta http-equiv="author" content="Harriet Smith" />
<meta http-equiv="contact" content="harrietsmith@harrietsmith.us" />
<meta name="copyright" content="Copyright (c)2008
Harriet Smith. All Rights Reserved." />
There are however more important things other than meta tags that you should be worried about to really optimize your site with keywords...
To improve your SEO (search engine optimization) There are things you MUST do:
#1: Set your Permalinks to something with your post title in the url. This changes your URL structure from the ugly : yoursite.com/?page_id=34 to something much more search engine friendly, by putting the keywords in your url, like this : yoursite.com/sample-post/
To configure your Permalinks, login to your Wordpress dashboard, click 'Settings' then click 'Permalinks'. Here you can customize however you want your url's to be structured.
For example, to make it like : yoursite.com/sample-post/ click the bottom radio button, Custom Structure and enter this: /%postname%/
(Be careful with this structure if you are planning on creating other folders within your root folder, because if you create a folder as the same name as the post, it will not show your blog post, but will default to the new folder you created)
I personally use and recommend using the date before my post titles, here is the way to do that:
/%year%/%monthnum%/%day%/%postname%/
which will produce: yoursite.com/2008/10/28/sample-post/
#2: I highly suggest you install The All In One SEO Pack
Automatic Search Engine Optimization (SEO) out of the box for your wordpress blog ... This plugin is streamlined for some best practices for Wordpress SEO. While it gives you many options the defaults reflect the settings I recommend using.
Anyone else have any other tips or tricks?
- Jared
Thanks
Zaheer