How to Optimize Images for SEO Automatically

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 are automatically indexed by search engines like google so you are not bothered by adding them manually (adding a description to <img alt="description of the image" height="125" scr="/image.png" width="125" /> when posting a picture).
This method can be said to be troublesome. With this automatic method, each image has the same description as the image title. Therefore, you must provide the appropriate name for each image that will be posted.

Why do you have Image Optimization to Automatically SEO?

Because the image on the blog page is one of the media that can be used for traffic on search engines because some internet users like to search or just browse to see pictures.


Here's how to install an automatic SEO code in the image

Look for the code </body> in your blog template, then copy and paste the code below just above the code </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[
var scrollTimer = 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 blog image that you install in an article will automatically have an SEO friendly code.

May be useful.
Give us your opinion
Open Comments
Close comment

Quảng Cáo Gần Cuối Bài

Inilah Solusi Jasa Pembuatan Website Praktis, Terbukti Klien Puas!

"Penawaran ini cocok untuk Anda yang ingin memulai membuat sebuah website hingga pemain portal berita / media online yang ingin bersaing langsung dengan situs web populer di kota Anda... Efektif, All in One pasti lebih Efisien!" Klik Disini

Themes for Members

avatar
Admin Welcome to NQnia, if you have anything to ask please via our WhatsApp
Admin Stress Hi there! Hello, Can I help you?
:
Chat with WhatsApp