In one of my WordPress blogs, I used to divide comments into pages. The single post looked shorter than having all comments in one page and hence the page layout looked better. But comment pagination has some disadvantages and I wanted to get rid of that.
Page 2 of 3
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:
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.
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.