Page 2 of 3

Better way to display title meta tag

To display title meta tag in WordPress, we can use wp_title function. But it’s not enough if you want your theme SEO friendly. In TwentyTen, TwentyEleven and Underscores (_s) themes, WordPress team has tried to solve the SEO issue by using the following code:

<title>< ?php
/*
 * Print the <title> tag based on what is being viewed.
 */
global $page, $paged;

wp_title( '|', true, 'right' );

// Add the blog name.
bloginfo( 'name' );

// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
    echo " | $site_description";

// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
    echo ' | ' . sprintf( __( 'Page %s', '_s' ), max( $paged, $page ) );

?></title>

What it does is formatting the title tag as:

  • For homepage or front page: Site name – Site description
  • For other pages: Page title – Site name (and maybe) – Paged

It’s ok if we just accept it. But when we go into the code, we’ll see it’s not very good:

Continue reading → Better way to display title meta tag

WordPress: Automatically Remove Short Words In URL For Better SEO

WordPress: Automatically Remove Short Words In URL For Better SEO

According to Matt Cutts’s answer in his interview at Pubcon, for good SEO, the URL should contains 3-5 words. If there are more than 5 words, Google’s algorithms typically will just weight those words less and just not give you as much credit. So, we should keep our URL as short as possible, and remove all unwanted words.

Continue reading → WordPress: Automatically Remove Short Words In URL For Better SEO

How To Add Canonical Link In Blogger

How To Add Canonical Link In Blogger

Canonical link is a link tag in the header of HTML document that tells search engines the preferred location of this url. Canonical link is an useful instruction for search engines to deal with duplicate content problems. If your site has identical or vastly similar content that’s accessible through multiple URLs, this format provides you with more control over the URL returned in search results. It also helps to make sure that properties such as link popularity are consolidated to your preferred version.

Continue reading → How To Add Canonical Link In Blogger