Latest

Post Top Ad

Your Ad Spot

3/05/2019

How to AUTO add ALT and TITLE tag in Images in Blogger


Howdy Everyone, Today we are going to show you How to AUTO add ALT and TITLE tag in Blogger.

Images plays an important role for blogger it is useful if you want your content to be more attractive to readers. People often say "Images/Picture is worth a thousand words", from the pictures itself your readers will already know what is the message of your blog content or what is it that you are trying to convey.

On the other hand, when you are using images on your blog you have to consider that ALT and Title tag of Image/s is one of the most important part of Search Engine Optimization (SEO). As simple as by adding ALT and title tag to your image/s you are giving it name so that google robot can understand the kind of image you have and they will indexed it on Google images search or even from other search engine website.

Now let us proceed with the tutorial.

How to AUTO add ALT and TITLE tag in Images in Blogger

Installation Steps:

Step 1: Go to your Blogger dashboard
Step 2: On Blogger dashboard Click: Template -> Edit HTML
Step 3: Noe search </body> in your Template (use CTRL + F keys)
Step 4: Just ABOVE </body> paste the below script:

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

5. Save your template! Done

Note: Before uploading images in your blog you have to check for the image name for it is exactly what this script will extract to use for ALT and title tag.

That's it! Happy blogging and please share if you find this post useful.

No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages