Earlier  i told you best seo tips for images which were all manually to be  followed. However, its not that easy to optimize each and every image  for search engines. So, here is a JavaScript code for your blog which  will add all necessary attributes such as ALT, Title etc to your images  and optimize all your blog images for search engines. This is one of the  easiest way to optimize all images in your blog posts and  implementation process only takes less than a minute. This will not only  optimize new images but will also optimize all images that your blog  have in older posts.
- Go to Dashboard > Design > Edit HTML (else move to next step)
- Now, search for code in your template (tip: press CTRL + F and paste this code)
- Paste below given code just Before </body>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
$('img').each(function(){
var $img = $(this);
var filename = $img.attr('src')
$img.attr('alt', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.')));
});
});
//]]>
</script>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
$('img').each(function(){
var $img = $(this);
var filename = $img.attr('src')
$img.attr('title', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.')));
});
});
//]]>
</script>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
$('img').each(function(){
var $img = $(this);
var filename = $img.attr('src')
$img.attr('alt', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.')));
});
});
//]]>
</script>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
$('img').each(function(){
var $img = $(this);
var filename = $img.attr('src')
$img.attr('title', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.')));
});
});
//]]>
</script>
- Save Your Template


 





 
 
 
 
 
 
 
 
 
 
1 comments:
Could you please describe us the reason behind making use of ALT and title tag in an image?
Post a Comment