Title: Doesn&#039;t optimize all the thumbs?
Last modified: August 21, 2016

---

# Doesn't optimize all the thumbs?

 *  Resolved [Bilal TAS](https://wordpress.org/support/users/bilaltas/)
 * (@bilaltas)
 * [12 years ago](https://wordpress.org/support/topic/doesnt-optimize-all-the-thumbs/)
 * Hi! I am using this excellent plugin but it doesn’t optimize all the thumbs that
   each images has. It only optimizes some standard size thumbnails.
 * I mean, I have a custom size, which is created by get_the_post_thumbnail( ) function,
   in my some images. (59×43) Plugin optimized only full size, 150×150, and a couple
   more but **not 59×43 one**. I think, when it imports all the media, it doesn’t
   import all the files in the wp-content/uploads/date/. It only checks the media
   database. It should not be with this way. It must check the **folder(s)** to 
   get and optimize images. Those are the small images that I show on my home or
   other pages and they are not being optimized.
 * It also doesn’t check the plugin folders to optimize some images when I click
   to “Scan Anything Else.” It should also check them.
 * Thank you in advance for helping.
 * [https://wordpress.org/plugins/ewww-image-optimizer/](https://wordpress.org/plugins/ewww-image-optimizer/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [12 years ago](https://wordpress.org/support/topic/doesnt-optimize-all-the-thumbs/#post-5101935)
 * That’s exactly what ‘Folders to optimize’ is for, and also why the plugin keeps
   track of all images it has optimized separate from the Media Library metadata.
   Not everyone needs to scan their entire wp-content/uploads/ folder. For some,
   it would be rather painful when they have 100,000 images in their database.
 * Same thing for the plugins folder. I prefer (for the sake of efficiency), to 
   only scan folders that actually have images to be displayed on the front-end.
   So we rely on the site owners to specify which folders to scan.
 * Might just be my opinion, but any images created in the wp-content/uploads/ folder
   should be stored in the image metadata under resizes. It is much more efficient
   to query the database for a list of images than to scan an entire folder of 1,000’
   s of images.
 * If you have particular (plugin) folders that you know need to be scanned, we 
   can add those to the auto-detection routine, but I can’t/won’t tell the plugin
   to just blindly scan the entire plugins folder on the thousands of sites running
   EWWW I.O. Long-term, it is preferable to contact the plugin authors and ask them
   to optimize their images, which would save lots of people bandwidth (including
   the wp.org servers).
 *  Thread Starter [Bilal TAS](https://wordpress.org/support/users/bilaltas/)
 * (@bilaltas)
 * [12 years ago](https://wordpress.org/support/topic/doesnt-optimize-all-the-thumbs/#post-5101946)
 * Uh, that’s really nice. I didn’t realize that there is a feature like this in
   the plugin. If we have an opportunity like this, we don’t need to check all of
   the folders that is full of images. Thank you so much…
 *  Thread Starter [Bilal TAS](https://wordpress.org/support/users/bilaltas/)
 * (@bilaltas)
 * [12 years ago](https://wordpress.org/support/topic/doesnt-optimize-all-the-thumbs/#post-5101976)
 * But, one more question, when we add new media, it won’t optimize it’s mentioned
   thumbs automatically. So, what is the solution for it? Please don’t say optimize
   the folder once a week or something like that. 🙂
 *  Plugin Author [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [12 years ago](https://wordpress.org/support/topic/doesnt-optimize-all-the-thumbs/#post-5101978)
 * There are a couple solutions, depending on your abilities. From looking at the
   codex page on get_the_post_thumbnail, you can also use add_image_size to register
   with WordPress that it should be generating the size you want on upload for every
   image. This will also dump it in the attachment metadata (in the database), which
   is where that information belongs.
 * All that said, so long as get_the_post_thumbnail is “doing the right thing” and
   using the WP_Image_Editor class on the backend, all those sizes will be optimized
   when they are created.
 * I couldn’t guarantee that without testing it, but you should be able to test 
   it yourself by uploading an image, then doing whatever is necessary to generate
   that resize (presumably inserting it in a post/page, and then viewing said post/
   page). Lastly, visit the Bulk Optimize page, and click Show Optimize Images to
   verify that the resize is in the list as optimized.
 * Short term, if that isn’t working as it should be, you can optimize them every
   hour automatically with the scheduled optimizer. The scheduled optimization function
   is intended to call the Scan & Optimize function via wp_cron, once per hour. 
   If you’re on shared hosting, and have tons of images, that could be problematic,
   as it is going to hammer your database during the Scan portion as often as once
   per hour. If you have a VPS or dedicated server, it shouldn’t be too big of a
   deal.
 *  Thread Starter [Bilal TAS](https://wordpress.org/support/users/bilaltas/)
 * (@bilaltas)
 * [12 years ago](https://wordpress.org/support/topic/doesnt-optimize-all-the-thumbs/#post-5102035)
 * I’ve add this code in my theme function.php:
 *     ```
       // THUMB IMAGE REGISTRATION
       if ( function_exists( 'add_image_size' ) ) {
       	add_image_size( 'homepage-small-thumb', 59, 42, true );
       }
       ```
   
 * It works now. Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Doesn't optimize all the thumbs?’ is closed to new replies.

 * ![](https://ps.w.org/ewww-image-optimizer/assets/icon-256x256.png?rev=1582276)
 * [EWWW Image Optimizer](https://wordpress.org/plugins/ewww-image-optimizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ewww-image-optimizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ewww-image-optimizer/)
 * [Active Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ewww-image-optimizer/reviews/)

## Tags

 * [EWWW](https://wordpress.org/support/topic-tag/ewww/)
 * [thumbs](https://wordpress.org/support/topic-tag/thumbs/)

 * 5 replies
 * 2 participants
 * Last reply from: [Bilal TAS](https://wordpress.org/support/users/bilaltas/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/doesnt-optimize-all-the-thumbs/#post-5102035)
 * Status: resolved