Automatic SEO for Images - Add Proper ALT and Title Tags Automatically - My Blogger Market

Breaking

Post Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

12/07/2011

Automatic SEO for Images - Add Proper ALT and Title Tags Automatically

Automatic SEO for Images - Add Proper ALT and Title Tags Automatically
Earlier i told you best seo tips for images which were all manually to be followed. However, its not that easy to optimize each and every image for search engines. So, here is a JavaScript code for your blog which will add all necessary attributes such as ALT, Title etc to your images and optimize all your blog images for search engines. This is one of the easiest way to optimize all images in your blog posts and implementation process only takes less than a minute. This will not only optimize new images but will also optimize all images that your blog have in older posts.


  • Go to Dashboard > Design > Edit HTML (else move to next step)
  • Now, search for code in your template (tip: press CTRL + F and paste this code)
  • Paste below given code just Before </body>
Automatic SEO for Images - Add Proper ALT and Title Tags Automatically
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.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:not([alt])").attr('title', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.')));
$("img:not([alt])").attr('alt', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.')));

//]]>
</script>
Save Your Template

No comments:

Post a Comment

Your feedback is always appreciated. We will try to reply to your queries as soon as time allows.
Note:
1. Make sure to click the "Subscribe By Email" link below the comment to be notified of follow up comments and replies.
2. Please "Do Not Spam" - Spam comments will be deleted immediately upon our review.
3. Please "Do Not Add Links" to the body of your comment as they will not be published.
4. Only "English" comments shall be approved.
5. If you have a problem check first the comments, maybe you will find the solution there.

Post Top Ad

Responsive Ads Here