Home » , » Onpage SEO: Adding ALT tags and title tags for Gravatar in wordpress

Onpage SEO: Adding ALT tags and title tags for Gravatar in wordpress

Written By Unknown on Sunday, February 9, 2014 | 6:46 AM

When it comes to SEO will not be missed onpage SEO techniques , especially onpage optimized HTML5 standard .
Also in onpage SEO techniques , to comply with HTML5 , compulsory on all blog images should have ALT . This is not hard when we can use plugin like SEO Friendly Image alt tags will help more , title or can reasonably add alt , title 1 when writing by hand ( although time consuming but the alt tags , title will be accurate and more efficient ) .
But when we have done everything to optimize onpage still have one problem that is when we check the onpage SEO reports will usually not always perfect by lack of alt , title for Gravatar , especially Blogging is for large quantities comment . If your report onpage only problem is you do not need to worry because most blogs are wordpress common problems encountered . But if you are meticulous in onpage SEO is the authentic article for you!


Onpage SEO: Adding ALT tags and title tags for Gravatar in wordpress

By default WordPress will capture your avatar on Gravatar internet users (a service providing unique avatar 1 email in bloom all over the internet) to make your avatar when readers comment on blogs. But what is lacking here is the avatar of readers to leave a comment no title and alt. That is why the meticulous SEOer will not be satisfied when see onpage SEO report.
 
Add ALT tags and title tags for Gravatar in wordpress SEO onpage optimization

To do this you simply need to open the functions.php file and add to it the following code:



function replace_content($text)
{
$alt = get_the_author_meta( 'display_name' );
$text = str_replace('alt=\'\'', 'alt=\'Avatar for '.$alt.'\' title=\'Gravatar for '.$alt.'\'',$text);
return $text;
}
add_filter('get_avatar','replace_content');
 
 
 
Save okay again and see the results!