Never forget Image Optimization. Search Engine Optimization is not only about doing keyword researches and building strong backlinks, there are some little but vital SEO techniques of Image Optimization.
Why should I do Image Optimization?
Images have a great effect on blogs/websites SEO and articles ranking on search results. Google/Bing uses the keywords in your images alt texts, alt titles and src to display images each time a visitors search a particular keyword. Image optimization also helps search engine bots to detect the meaning of your images from alt titles and text.
How To Do Image Optimization For SEO?
In the previous post, I made on the post how to improve SEO with image optimization. But optimizing each image can be very difficult which brings us to the main deal. Today I'm going to tell you how to automatically do Image optimization for SEO. By just adding a javascript code in your blog template's body tag.
1. Login to blogger.com or draft.blogger.com
2. Navigate to Themes Option > Edit HTML.
3. Search for </body> or </body> , then copy and paste the code, below javascript code just above the body tag.
<script type='text/javascript'> //<![CDATA[ $(document).ready(function() { $('img').each(function(){ var $img = $(this); var filename = $img.attr('src') $img.attr('alt', filename.substring((filename.lastIndexOf('/'))+1, filename.lastIndexOf('.'))); }); }); //]]> </script> <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('.'))); }); }); //]]> </script>
4. Click on Save Template.
Important Notice
Above javascript code fetches the image name and uses it as the alt text and alt title. So, always name the title of your image with quality keywords.Thanks For Reading. Please Keep Visiting
Read More: 2 Reasons Why Your Blog Is Not Showing Up On Google Search Engine
Comments
Post a Comment