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

8 comments:

Muhammad Nadeem on 09 January, 2018 said...

https://information2505.blogspot.com/ kindly check my seo mistake on my sites and tell me plzzzz

Hammad Ansari on 09 January, 2018 said...

@Muhammad Nadeem
You're doing a great SEO work :) Keep going Buddy!
One small advice: Minimize the popup ads shown on your blog. Sometimes it becomes irritating to the reader and hence the reader leaves the blog.

Stay in touch with BBeginner to get latest SEO updates :)

Yuvraj Kore on 04 April, 2018 said...

when i try to paste this code, on my html showing a warning notification. what i do ?

lkckd on 10 April, 2018 said...

Is it possible to replace alt text with post title instead of file name ?

WOWS Blogger on 05 May, 2018 said...

No longer works, have you updated this code?

sunday ebuka on 08 May, 2018 said...

Pls check my site for seo advice www.ebunzy.com

PAYROLL SOFTWARE on 16 June, 2018 said...

Impressive!!! Really i m searching that's like info. Thanks for shared it
PAYROLL SOFTWARE

factoHR on 05 July, 2018 said...

Thanks for the information. factoHR is an excellent and fast enterprise platform to provides many features like Payroll Software, HRMS, Leave Management System, Attendance Management System Software, Payroll Process, PMS and many more for all business at Affordable Price. Also their support team is very helpful and helped us streamline the entire Payroll and HR Processes.

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!

 

Facebook

Recent Comments

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