Skip to main content

How To Automatically Optimize Images For SEO

How To Automatically Optimize Images For SEO


     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.




2. Navigate to Themes Option > Edit HTML.

3. Search for </body> or &lt;/body&gt , 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

Popular posts from this blog

Download Free Antivirus Software | Avast 2019 PC Protection

Avast Free Antivirus Lighter, more powerful – and absolutely free “Scores high... an excellent choice for free antivirus protection” Official Download link Cloud-light, award-winning free virus protection Packed with the largest threat-detection network, machine-learning virus protection, easy password management and home network security that won’t slow down your PC. Easy to install, effortless to use Avast Free Antivirus scans for security and performance issues and tells you how to fix things instantly. It protects you in real-time by analyzing unknown files before they get to you. So relax: With Avast, you’re running the most trusted antivirus out there. What’s inside the latest version? A beautifully intuitive interface, advanced application protection, a new passive mode for running multiple security products in parallel — and a little something for you gamers and movie buffs. Designed for effortless security Just a clic

Top 6 Best Android Photo Recovery Apps and Software without Root

Primary Reasons for Deleted Images on Android Before getting these photo recovery apps and software, you should first understand the common causes of photo deletion: Hasty removal of memory cards Memory card formatting error Unexpected power failure during the copying process Virus attack that corrupts images Incorrect ejection of memory card Accidental pressing of delete option Using one card for several gadgets Clicking photos continuously without pauses Ignoring full memory and low battery warnings You’re in the process of tinkering with your Android device. Suddenly, you delete an image or several images accidentally. Fear not, you can always get an affordable photo recovery app. This state-of-the-art software helps Android users get back erased images from the hard drive, Secure Digital (SD) or memory cards, and digital cameras. 1. DiskDigger Photo Recovery DiskDigger undeletes and helps restore deleted photos from the internal memory or memory car

Best Free Web Hosting Sites 2019

            Today we are going to talk about top best free hosting sites that do not make you have ads on your website as part of the deal. These web hosting sites offer a lot of great features and easy to follow steps to make it super easy to have your very own website for free without any annoying advertisement on your hosted free website.            Hosting is an important step when you need to start a website to promote your product or business. However if you’re tight on budget, I mean like ‘no budget at all’  your ultimate choice would be choosing a no cost-free website hosting. There are hundreds of free hosting choices when you search online, how would you choose the best suitable one?            Although it's a cost-less hosting, there is still a couple of factors you need to consider when choosing a free web hosting. They are the hosting uptime, bandwidth allowed, disc space allowed, PHP support version, memory can use, control panel support, support among other