Optimize Blog Images By Adding Alt And Title Tags Automatically

Automatically Add Alt and Title Tags to Blogger Optimize Blog Images By Adding Alt and Title Tags Automatically
We always keep trying to improve our better SEO but it really became a headache to add these tags manually to each and every image. So today I am introducing a great script which automatically adds Alt and Title tags to all your blog images in one go. You just need to rename your blog image before uploading as this script fetches the name of images and add it as Alt and Title tags. So let's start adding this great script to your blogger blog.

How this script works? :

This script simply takes the image name and use it as the title and alt tag for that particular image.
So to use this script carefully, you have to name your post images correctly. An example of an image with alt and title tag is below:

How to Add Script to Add Alt and Title Tags Automatically:

You just need to follow below-given simple steps to successfully add this great script. So let's start:
  1. Go to Your Blogger Dashboard.
  2. Open the Theme Tab and Click Edit HTML.
  3. Edit your template.
  4. Search the </body> tag in your template editor. ( Use Ctrl+F for quick find)
  5. Then paste the below code before the </body> tag.
    <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' type='text/javascript'/> <script 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> 
  6. Now save it.
You'are done! You have successfully added the script which enhances your blog's SEO and surely increase organic visits too. Now check your blog images by pointing mouse cursor to them.
If you have an e-commerce driven blog or website powered by wordpress and if you need advanced SEO services for an e-commerce site you might have to consult a professional SEO agency.
If you have any query or suggestion, you can drop a comment below. 

Comments

Popular posts from this blog

How To Backup Blogger Template And All Posts?

How To Add Google Translate Button In Blogger?

How To Remove Powered By Blogger - Attribution Widget?