SEO For Wordpress - Making your blog SEO Friendly
March 25, 2007 – 2:37 amComparing a website, optimized for SEO and a default installation of Wordpress, one can conclude that it lacks friendliness in SEO, except the fact that it uses feeds, proper navigation and linking, pinging search engines etc.
Some of the things I observed are,
- You can’t have a separate title other than the post title, and the title tag gets messed up with so many things. You don’t have full control on title by default.
- Meta Tags.. Default installation does not come with options to add/edit meta tags
- Content duplicity - The same content repeats in category pages, archives etc..
If you agree with above, I have few tips for you to improve the SEO performance of your blog. The knowledge level required to try my tips is entry to medium level.
First customization, you might do is changing the look and feel of your blog. Wordpress themes are available for free download from many designers and it does not need any code editing capabilities to change a Wordpress theme.
Help crawlers to index your page properly - Validating XHTML code
Most of the themes will be coded in XHTML which is very good for SEO as it reduces the document size a lot for better crawlability. But what I observed is most of the theme developers don’t bother much to validate the XHTML code, resulting in lot of W3C validation errors. This is as bad as keeping a theme based on HTML and tables. Get the themes validated and all the errors fixed for better SEO performances.
This blog currently contains valid XHTML code which you can verify yourselves..
Choosing the right permalink structure
You might know about Apache’s mod_rewrite or URL rewriting. Make sure that you host your blog in a server running on Linux OS and using Apache web server configured with mod_rewrite for making use of the URL rewriting features.
For enabling your custom permalink structure, you need to simply add a .htaccess file into your hosting directory.
Go to Options > Permalinking on your Wordpress admin.
There you can specify which way your URL’s should look like. I prefer site.com/postname/ as the URL for my post instead of site.com/2007/06/05/postname/ . In former, you are pushing your page name to the start of your URL string. The more you push your main keyword to the front, its advantageous for you in terms of SEO (My View).
So you need to just select ‘custom’ permalink option and should give /%postname%/ in the field provided. Once you update the permalink structure by clicking below, Wordpress will instruct you to update content of your .htaccess file (if exits) or create new one. Just copies the content suggested by Wordpress and use it.
If you need .html extension for your posts, you can just enter /%postname%.html in the custom permalink field.
For more info on permalink structures, refer http://codex.wordpress.org/Using_Permalinks
Title and Meta Tags - Beginner Level
By default a title tag will look in following form in a post.
SEOLion ’s Personal Blog » Blog Archive » Basic On Page Optimization for beginners
Here your main keyword will be pushed far from the starting character of your title and by default it contains the title you have given for your post.
Here is where you can use SEO plugins available for Wordpress. For example I am using a plug-in called ‘Another Title’. You can download and install this plugings from Wordpress site. This title will make the same post title to appear in the title tag and blog name and other words are not displayed in title.
For meta tags, I am using a plugin ‘add meta tags’. All these plugins you can download from Wordpress site.
Title and Meta Tags - Medium to Expert Level
The above method is for beginners. And what I am explaining below is for experts who can do a bit of PHP programming, and want to have a customized title other than the default post title to appear.
In Wordpress, you can define custom fields. While making a post, you can enter value for a custom field and it can be retrieved in the blog post for display.
For example, you can give a ‘key’ for your custom field as ‘my_own_title’ and give the full title in the value field.
This custom field will be saved when you save the post.
Now you can edit your theme files, particularly the header and put this small code where you want to display the value you just entered.
<?php if(is_single())
{
echo get_post_meta($post->ID, “my_own_title”, $single = true);
}
else
{ ?>
<?php bloginfo(’name’); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?>
<?php
}
This code will check whether you are viewing a single page/post or a category page or an archive page. If it’s a single post or page it will retrieve the custom field value for ‘my_own_title’ and display it.
The custom field is really a very handy option in case you would like to store custom alt tags or header tags for your page. Similar way you can keep custom fields for keywords and description.
I am using a plugin called ‘custom field gui’ which you can customize and make the custom fields to get displays as usual fields in the post creation page.
Avoiding Content duplicity
You can add the following code to display only an extract of the post in archive and category pages. The actual post only will contain the complete post contents. This can help you coping with Content duplicity issues.
In Wordpress loop, there is a portion to display the actual post content.
It will look like
<?php the_content(__(’(more…)’)); ?>
Or
<?php the_content(); ?> Etc..
Modify the above to
<?php if(is_single()) {
the_content();
} else {
the_excerpt();
}
?>
Here this code will check whether the current page is a single post or archive or a category page. If it is single, it will display full post content.
While creating the post/page, there is a provision to add the excerpt for that particular post/page. An excerpt is similar to a short description of that page/post. If an excerpt is present, it will be shown in above case when a category or an archive page is loaded. If excerpt is not present, Wordpress will show few starting lines of the post in the place of excerpt.