Monday, 21 August 2017

Optimize Blog Images By Adding Alt and Title Tags Automatically


Under: ,
Automatically Add Alt and Title Tags to Blogger
We always keep trying to improve our blog's SEO to be a part of ever improving SEO race. A better SEO let us compete with our competitors and rank better than others in search engines. It becomes very difficult task when it comes to optimizing blog images for SEO. Blogger by default provides adding Alt and Title tags to images manually for 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'> //<![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 any query or suggestion, you can drop a comment below. 

0 comments:

Confused? Feel free to ask!

We love comments! We appreciate your queries but to protect from being spammed, all comments will be moderated by our human moderators. Read our full comment policy here.
Let's enjoy a happy and meaningful conversation ahead!

 

Copyright © 2017 All Rights Reserved by BBeginner.Com ׀ Designed by Hammad Ansari. DMCA.com Protection Status