Monday, April 20, 2015

How to Optimize Images For SEO Automatically


How to Optimize Images For SEO Automatically


This is done so that the images on your blog page automatically indexed by the search engines like google so you are not bothered by adding it manually (add a description of the <img alt = "description of the image" height = "125" scr = "/ image.png" width = "125" /> when posting images).

The way it can be said to be a hassle. With this automatic way each image has the same description with the title of the picture. Therefore, you should give them appropriate names for each picture to be posted. Why should Optimization For SEO Image Automatically? Because the image on the blog page is one medium that can be used for traffic on search engines because most Internet users are very likely to seek or simply browsing to look at pictures.



Here's how to install automated SEO code in the image Find </ body> tags on your blog template, then copy and paste the code below just above the </ body>

<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 [
was scrollwork hours = null;
$(window).scroll(function() {
   var viewportHeight = $(this).height(),
       scrollbarHeight = viewportHeight / $(document).height() * viewportHeight,
       progress = $(this).scrollTop() / ($(document).height() - viewportHeight),
       distance = progress * (viewportHeight - scrollbarHeight) + scrollbarHeight / 2 - $('#scroll').height() / 2;
    $('#scroll')
        .css('top', distance)
        .text(' (' + Math.round(progress * 100) + '%)')
        .fadeIn (100);
    if (scrollTimer !== null) {
        clearTimeout(scrollTimer);
    }
    scrollTimer = setTimeout(function() {
        $('#scroll').fadeOut();
    }, 1500);
});
//]]>
</script>

Next save the template.


Every picture of your blog post in an article automatically will have SEO friendly code.