Auto image SEO Script For Blogger 

Give the auto alt and title tag will help you to Getting a mass Traffic to your website from image searches and make a Search Engine Optimization friendly Web Page for the Search Engine.

there are many auto image SEO scripts but maybe one per thousand work, but i find one latest and fully working script, which i am also using in my this blog.

How this Script Works?

This is a very simple JavaScript which will add the alt tag as well title tag to your images automatically when you upload and insert into post. Alt tag is the tag which is used to display your alternate text to the image. Sometimes it may happens that your images is not opening due to slow internet speed. At that time your alt text will be displayed instead of images, also it will help bot to understand what object is that and what information it contains.

How this trick will work?
 
This trick is a JavaScript code where we take the name of the image as the alt and title attribute value.
In order, this trick to be efficient your images should have relevant image names.
Before you upload the image file just give it the exact name and then upload.

What should follow this trick?

This trick is not for the blogs where images are uploaded without naming it correctly.

Don't use the name of the images like 1.png, 1.jpeg etc give it short and relevant name to the image.

It will be useless if you don't have any relevant name to the images. Visually impaired users will not be able to know what exactly the image is about.

STEP 1: Go To Theme Section and edit HTML.

STEP 2: After Clicking on Edit HTML Search for </body> [As it is always in bottom]

STEP 3: Copy This Below Code-

<script type="text/javascript">

let img,p,a,s;

p = /^.*[\\\/]/g;

img = document.querySelectorAll('img');
img.forEach((el, i, array) => {

s = el.getAttribute('src');

a = s.replace(p, '').split('.')[0].replace(/%2B/g, ' ');
if(!el.getAttribute('alt')){
el.setAttribute('alt', a);
}
if(!el.getAttribute('title')){
el.setAttribute('title', a);
}
});
</script>


STEP 4: Now paste and save the template.


This trick is to make your images to get the recommended alt and title attributes.