Wordpress SEO <head> s

Discussion in 'WordPress' started by just-4-teens, Oct 2, 2010.

  1. #1
    Here i hope to help you with your wordpress SEO, the following post will help you to optimise your <head>..</head> section of your wordpress theme and pages.

    I have tried to keep it simple, if you have any problems make a post below.


    Title tags
    Replace everything between
    <title>...</title>
    PHP:
    with
    <title><?php if(is_home()) { echo 'Keyword 1 | Keyword 2'; } else { echo 'Site/Brand Name:'; wp_title('') ;} ?></title>
    PHP:
    This will display
    as your sites homepage title
    and
    as your single post pages

    Meta description
    replace
    <meta name="description" content="..." />
    PHP:
    with
    <?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <meta name="description" content="<?php the_excerpt_rss(); ?>" />
    <?php endwhile; endif; elseif(is_home()) : ?>
    <meta name="description" content="a short description here" />
    <?php endif; ?>
    PHP:
    this will display your post excerpt (without formatting tags) as the meta description for single posts and 'a short description' as the meta description for your homepage.

    optional
    Meta robots
    add
    <?php if(is_home() || is_single() || is_page()) { echo '<meta name="robots" content="index,follow" />'; } else { echo '<meta name="robots" content="noindex,follow" />'; } ?>
    PHP:
    This will stop search engine spiders from indexing category, search and archive pages to help avoid duplicate pages, they will stil index the homepage, single posts and single pages.
     
    just-4-teens, Oct 2, 2010 IP