The Ultimate Guide to Excluding Images from Optimization in Media Optimizer
                            At Media Optimizer, our goal is to streamline your entire library for peak performance. However, we understand that “one size fits all” is not a professional strategy. There are specific situations where you might need to prevent certain images or entire groups of images from being processed. This could be to preserve a pixel-perfect original, prevent conflicts with a specific script, or simply to save your optimization credits for more important content.
Table of Contents
Our plugin provides a powerful and granular set of exclusion tools designed to give you complete control over the optimization process. This comprehensive guide will walk you through every exclusion method available, explaining not only how to use it but also when and why you should consider it.
Why Exclude an Image in the First Place?
Before diving into the “how,” let’s understand the “why.” Here are the most common scenarios where excluding an image is the right choice:
- Pixel-Perfect Artwork: For digital art, highly detailed technical diagrams, or medical imagery, even our visually lossless “Smart Optimization” might alter pixel data in a way that is unacceptable. Excluding these ensures they remain untouched.
 - Pre-Optimized Images: You may have images that have already been perfectly optimized in a tool like Photoshop using “Save for Web.” Running them through another optimization process is unnecessary and might even slightly increase their file size.
 - Compatibility with Other Plugins: Some JavaScript libraries, sliders, or gallery plugins might rely on specific filenames or attributes. While rare, excluding images used by such tools can prevent compatibility issues.
 - Credit Management (PRO Users): You may want to reserve your valuable optimization credits for user-facing, high-impact images (like product photos and blog post images) and exclude less critical ones (like author avatars in a comment section).
 - Troubleshooting: Temporarily excluding an image is a great way to diagnose if it’s the source of a layout or display issue on your site.
 
The Three Levels of Exclusion in Media Optimizer
Our exclusion system is designed with a “top-down” approach, giving you both broad and fine-grained control. You can exclude images based on their size, their location and name, or even their thumbnail type.
Level 1: Excluding by File Size (The Broadest Stroke)
The simplest way to avoid wasting resources is to tell Media Optimizer to ignore tiny images where the potential savings are negligible.
- Where to find it: Settings > Media Optimizer > Advanced settings > Minimum File Size Threshold
 - What it does: This setting establishes a global minimum file size. Any image file smaller than this value will be completely ignored by all optimization processes—both bulk and on-the-fly.
 - How to use it: The default value is 20 KB. This is an excellent, well-balanced starting point. Icons, tiny spacers, or decorative elements are often smaller than this, and optimizing them would save mere bytes while still costing a credit (in PRO) and processing time. You can set this value to 0 to disable this feature entirely, but we highly recommend keeping it.
 - Best for: Globally preventing the unnecessary optimization of small, insignificant images like icons, saving credits and speeding up bulk processing.
 
Level 2: Excluding by Path and Filename Patterns (The Most Powerful Tool)
This is your primary tool for surgical exclusions. It allows you to exclude individual files, entire folders, or images based on parts of their filenames.
- Where to find it: Settings > Media Optimizer > Advanced settings > Exclude images by patterns
 - What it does: This textarea accepts a list of keywords or path fragments. If any part of an image’s full server path or filename matches one of these patterns, it will be excluded. The matching is case-insensitive.
 - How to use it: Enter one pattern per line. Here are some practical examples:
 
Example 1: Excluding a Specific Logo File
Your site uses a highly optimized logo, my-company-logo-final.png. You don’t want it touched.
my-company-logo-final.png
This will exclude any image with this exact filename, no matter where it’s located.
Example 2: Excluding an Entire Year’s Worth of Uploads
You’ve just migrated a blog from 2018, and those images are already optimized. You want to exclude the entire /wp-content/uploads/2018/ directory. 
IGNORE_WHEN_COPYING_START
IGNORE_WHEN_COPYING_END
/uploads/2018/
This pattern will match any image whose path contains /uploads/2018/, effectively excluding the entire folder and all its sub-folders (e.g., /01/, /02/, etc.).
Example 3: Excluding All Images in a Specific Theme Folder
Your theme uses a folder of images for its demo content that you don’t want to optimize. 
IGNORE_WHEN_COPYING_START
IGNORE_WHEN_COPYING_END
/themes/your-theme-name/images/demo/
This is a very precise way to target a specific folder within your theme’s directory.
Example 4: Excluding Images with a Common Naming Convention
You have a series of product shots that include “_raw” in their filename before you edit them, like product-shot-A_raw.jpg. 
IGNORE_WHEN_COPYING_START
IGNORE_WHEN_COPYING_END
    _raw.jpg
This pattern will exclude any .jpg file that has _raw at the end of its name.
Combining Patterns:
You can, of course, combine all of these in the settings box:
IGNORE_WHEN_COPYING_START
IGNORE_WHEN_COPYING_END
    my-company-logo-final.png
/uploads/2018/
/themes/your-theme-name/images/demo/
_raw.jpg
- Pro Tip: This tool is incredibly powerful. Start with specific patterns and broaden them if needed. It’s a great way to protect images used in page builder templates or specific plugins.
 
Level 3: Excluding by Thumbnail Size (The Fine-Tuning Tool)
This feature is designed for precise control over your Media Library, allowing you to save credits by skipping the optimization of specific, generated thumbnail sizes.
- Where to find it: Settings > Media Optimizer > Advanced settings > Exclude thumbnail sizes
 - What it does: This section lists all registered thumbnail sizes in your WordPress installation, including both default sizes (thumbnail, medium, large) and any custom sizes added by your theme or other plugins. Checking a box next to a size tells Media Optimizer to not optimize any thumbnail generated for that specific size. This does not affect the full-size original image.
 - How to use it:
 
Scenario: You run a photography blog. Your most important images are the full-size originals and the “large” thumbnails used in your articles. However, your theme also generates a small 150×150 cropped thumbnail that is only used in a “Recent Posts” widget in the sidebar. The visual impact of optimizing this tiny thumbnail is minimal.
Solution:
- Go to the “Exclude thumbnail sizes” settings.
 - Find the line that says Thumbnail (150 × 150).
 - Check the box next to it.
 - Save your settings.
 
From now on, when you upload a new image, Media Optimizer will optimize the full-size original, the medium version, the large version, and any other custom sizes, but it will completely ignore the 150×150 thumbnail. If you had 5 thumbnail sizes, this simple action just reduced your credit usage for every new upload by 20%.
When is this most useful?
- High-Volume Sites: If you upload dozens of images a day, excluding non-critical thumbnails can lead to significant credit savings over time.
 - WooCommerce Stores: You might want to optimize your main product and gallery images (woocommerce_thumbnail, woocommerce_single) but exclude the tiny woocommerce_gallery_thumbnail used in the cart widget.
 - Themes with Many Custom Sizes: Some complex themes can register 10-15 different thumbnail sizes. This tool allows you to identify and exclude the ones that aren’t critical to your site’s appearance and performance.
 
Conclusion: A Strategy for Smart Exclusions
Mastering Media Optimizer’s exclusion tools allows you to transition from a “brute-force” optimization strategy to a smart, surgical one.
- Start Broad: Set a reasonable Minimum File Size Threshold (like 20KB) to eliminate waste.
 - Get Specific: Use Path and Filename Patterns to protect critical, pre-optimized images or to exclude entire legacy directories.
 - Fine-Tune: Use the Thumbnail Size Exclusions to maximize your credit efficiency by focusing only on the image sizes that have the biggest impact on your site’s performance.
 
By combining these three levels of control, you can ensure that Media Optimizer works exactly the way you want it to, delivering maximum performance where it matters most while giving you the power to protect the assets that need to remain untouched.