Ticker

6/recent/ticker-posts

How To Add Auto Alt Text To Images In Any Website


Auto image SEO Script For Blogger or WordPress or any website

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 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 </head>

STEP 3: Copy This Code and paste above </head>

    <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/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('title', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.')));  
   $img.attr('alt', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.')));  
  });  
 });  
 //]]>  
 </script>

STEP 4: Now save the template.

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

Post a Comment

0 Comments