How To Add Auto Alt Tag Generator For Images To Blogger

September 14, 2017
As I have already told you how to add code box in blogger? Now I will show you how to add auto alt tag generator for images to your blogger blog. Seo is very important for any webmaster to rank at good position in search engines. And for getting a good position in search engine, you have to follow all ranking factors.

One of the major ranking factors is proper optimising of images for SEO. Many bloggers are lazy to add an alt tag to images. But if you add alt tags to your blog's images, then you might get tired.  But now you will not be tired. Yes, you have heard right. Because I have a code that will add t tag automatically in your blog Images. So, today I am showing you how to add auto alt tag generator for your images to blogger blog.

add-auto-alt-tag-generator-for-images-in-blogger

How This Script Works


This script can read the name of the image. Means whenever you upload an image in your blog post then this script read the name of the image and add that as an Alt tag. And this code can also add "+" if there is space in the name of the image. So, before uploading an image to your blog post, rename it properly.


How To Add Auto Alt Tag Generator For Images To Blogger


1. Login to your blogger blog Dashboard.

2. Then go to "Theme" > "Edit HTML".

add-auto-alt-tag-generator-for-images-in-blogger


3. Click anywhere inside the code area to open blogger search box.

4. Now search for <head> and just below it paste the code given below:
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' type='text/javascript'/>

Note:- If you have already added jquery in your blogger Template, just leave this step and follow next step.

4. Copy or write </body> in search box and press Enter.

5. When you find the code just above
  </body>  tag and paste the code given below:
<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>
6. Now click on "Save Template" and you are done.

Wrapping Up

So, this was the easiest way of adding auto alt tag generator for images to blogger. I hope you liked the post. Comment down your problems related to this content and do not forget to share it.

Share this

Related Posts

Previous
Next Post »