Search Engine Optimization Ready for WordPress Templates

[pthumb][/pthumb]By now, you’ll definitely seen many WordPress Themes that labeled as SEO Optimize or Search Engine Optimize. But what is SEO Optimize? it is a method to improve how your website or data appeared and how it rank in web search engines such as Google, Yahoo, Bing and OSE (Other Search Engine). This generally means more traffic to your site. Your website data or information search engine results pages also known as SERP will depend on how well you optimize your website HTML code and META TAG.

Today i am going to show you how to make your WordPress Themes or Templates Search Engine Optimization Ready the “right way” so that your effort on writing quality posts and building an informative website will not rank low in SERP and disappeared in Search Engine.

Adding a Proper <META> tag in <HEAD>

There are two ways to achieve this, one by adding the proper META tag yourself or used a WordPress plugin such as Yoast WordPress SEO Plugin and All in One SEO WordPress plugin. However if you want to add the META tag by yourself, open your theme functions.php and add this code

[php]
/////////////////////////////////////////////////////
// Add SEO META description and keyword
/////////////////////////////////////////////////////
if( !function_exists(‘add_wp_seo_meta’) ):
function add_wp_seo_meta() { ?>
<!– SEO in META tag –>

<?php if( is_home() ): ?>
<!– if in home –>
<meta name="description" content="<?php echo bloginfo(‘description’); ?>" />
<meta name="keywords" content="<?php
$tags = get_tags();
$post_tags_list = ”;
if ($tags) {
foreach ($tags as $tag) {
$post_tags_list .= $tag->name . ‘, ‘;
}
}
$cats = get_categories();
foreach ( (array) $cats as $cat ) {
$post_tags_list .= $cat->name . ‘, ‘;
}
$post_tags_list = strtolower($post_tags_list);
echo substr( $post_tags_list,0,-2 );
?>" />
<link rel="canonical" href="<?php echo site_url(); ?>" />

<?php elseif( is_singular() ): ?>
<!– if in single page or post –>
<?php if (have_posts()) : while (have_posts()) : the_post();
$taglist = wp_get_post_tags($post->ID);
$excerpt = get_the_excerpt();
?>

<meta name="description" content="<?php echo strip_tags($excerpt); ?>" />

<?php if( has_tag() || has_category() ): ?>
<meta name="keywords" content="<?php
$tags = get_the_tags();
$post_tags_list = ”;
foreach ( $tags as $tag ) {
$post_tags_list .= $tag->name . ‘, ‘;
}
$cats = get_the_category();
foreach ( $cats as $cat ) {
$post_tags_list .= $cat->name . ‘, ‘;
}
$post_tags_list = strtolower($post_tags_list);
echo substr( $post_tags_list,0,-2 );
?>" />
<?php endif; ?>

<link rel="canonical" href="<?php echo wp_get_shortlink(); ?>" />

<?php endwhile; endif; ?>

<?php elseif( is_attachment() || is_category() || is_archive() || is_search() || is_date() ):
//no index for category, archive and attachment ?>
<meta name="robots" content="noindex,follow" />

<?php endif; ?>
<!– /SEO in META tag –>
<?php }

add_action(‘wp_head’, ‘add_wp_seo_meta’);
endif;
[/php]

Proper use of <H1> Headline HTML

I’ve seen many WordPress Themes use <H1> for their header site name and some featured articles section. It is not SEO Friendly by doing this. Search Engines first priority crawl the existed <H1> in web pages so having too many <H1> in one page is bad for Search Engine indexing. There are two place you should use <H1> headline only.
[list type=”check”]

  • Site Title in Homepage only
  • Main Title in single post or page

[/list]

For homepage site title you can use similar code like this in theme

[php]<<?php if( !is_singular() ){ echo ‘h1 ‘; } else { echo ‘div ‘; } ?>><a href="<?php echo home_url( ‘/’ ); ?>" title="<?php echo bloginfo( ‘name’ ); ?>" rel="home"><?php bloginfo( ‘name’ ); ?></a><<?php if( !is_singular() ){ echo ‘/h1 ‘; } else { echo ‘/div ‘; } ?>><p id="site-description"><?php echo bloginfo( ‘description’ ); ?></p>[/php]

in this code, it will check if you currently in single page or post, the site title will use <div> instead and change to use <H1> in Homepage. This will prevent duplicate use of <H1> in single page or post since post title will using HTML something like <h1 class=”post-title”>

<H3> and <H4> Headline in aside or sidebar

Like i mention before, do not use <H1> in any other place in template other than homepage title and single post title. Therefore in aside or sidebar, you should use <H3> for the widget header title and <H4> for post title in your aside featured post. Try not to use <H5> and <H6> cause the index crawling probability are low.

Add Schema Support for WordPress Themes

Schema markup in WordPress Theme can help you organize your posts and data structure more appealing in search engines. There are some doubt if this can improve or increase your SERP ranking but definitely worth the effort adding this to your WordPress templates. You can check out how to add schema to your WordPress templates here.

[list type=”arrow”]

[/list]

Using Table-less and HTML5 Semantic Coding

Search engines love fast, clean and modern semantic markup like HTML5. If you want your WordPress Themes to be fully SEO Optimize Ready, you should use Tableless CSS Layouts for your template layout coding.

The New HTML5 Tags. HTML5 has several newer tags to help make things easier for humans as well as Google bots to understand.
[list type=”dot”]

  • Article Tag. The article <article> tag helps sites announce that the article can be syndicated. Google will definitely add more weight to an article (or blog post, forum post, etc.) that is associated with this tag, so it’s important for publishers to use.
  • Header Tag. The <header> tag actually has less weight in the eyes of a search engine. However, it helps make things very easy for humans as well as Google bots. The Google bots can figure this out already, but it takes them time. With this easier tag, your SEO should improve because it only helps your navigation and helps the bots understand your site without any confusion.
  • Section Tag. The <section> tag helps determine different sections of an article or of a webpage. Google bots often pay more attention to smaller sections than one huge section, so it should help your SEO in that sense.
  • Aside Tag. The <aside> tag works similarly to the section tag: It helps determine content between article and aside post. <aside> tag mostly used in sidebar or area outside contents.
  • Footer Tag. The <footer> tag works similarly to the header tag: It helps to keep things organized despite the fact that it may hold less weight in the eyes of Google bots.

[/list]

Here’s a beginner guide on how to create a simple HTML5 template

Optimization outside of templates coding

That’s all folks, above are few tips on creating a search engine optimize and friendly WordPress Themes. if you haven’t done so, try applying the method mention above in your templates. On side note, here are some SEO tips to improve your site ranking outside of coding skills.

[olist style=’green’]

  1. Monitor where you stand
  2. Keywords, keywords, keywords!
  3. Link back to yourself
  4. Create a sitemap
  5. Search-friendly URLs
  6. Avoid Flash
  7. Image descriptions
  8. CONTENT is KING
  9. Social media distribution
  10. Link to others

[/olist]

Check out 10 Basic SEO Tips here.

Scroll to Top