Back to Community

Understanding and Troubleshooting Speed Optimizer's Image Compression

Content

Image compression is a powerful feature of the Speed Optimizer plugin, designed to boost site performance by reducing image file sizes. However, users often encounter confusion about how it works, how to reverse it, and why results may not always meet expectations. This guide breaks down the common issues and their solutions.

How Speed Optimizer's Image Compression Works

The plugin processes images by applying a selected compression level (None, 25%, 60%, or 85%). A critical point to understand is that this process overwrites your original image files by default. This is a permanent change unless you enabled the backup option beforehand.

Common Issues and Solutions

1. Unhappy with Image Quality After Compression

Problem: You applied a high compression level (e.g., 85%) and images now look blurry or pixelated.

Solution: The method to fix this depends entirely on whether you created backups.

  • If You Enabled Backups: Navigate to Media -> Image Compression -> Edit -> Compression Level -> None and confirm. This should restore your original images from the backup files, which are saved with a .bak. prefix (e.g., image.bak.jpg).
  • If You Did NOT Enable Backups: Unfortunately, the original images have been overwritten. The only way to restore full quality is to re-upload the original image files from your personal backups.

2. Compression is Not Working on Images in Custom Folders

Problem: The plugin optimizes images in the standard WordPress Media Library but may not process images stored in custom directories created by other plugins (e.g., /wp-content/uploads/custom-folder/).

Solution: This is a known limitation. The Speed Optimizer plugin is designed to work with the core Media Library. For images outside of it, a dedicated image optimization plugin that supports custom directories may be required.

3. File Size Increased After Optimization

Problem: Your overall disk usage went up after enabling optimization.

Solution: This is almost always because you enabled the "Generate WebP Copies" feature. This creates an additional, modern WebP version of each image alongside the original (or compressed) JPEG/PNG. While this improves site speed for visitors, it increases storage usage. Disable WebP generation if disk space is a primary concern.

4. Needing a Custom Compression Level

Problem: The preset levels (25%, 60%, 85%) are too limiting, and you need a specific value like 45%.

Solution: Users have requested a filter hook to set custom compression levels for years. While a filter exists for WebP quality (sgo_webp_quality), a similar filter for standard image compression is not currently available. The plugin developers have been made aware of this feature request for future consideration.

Key Takeaways and Best Practices

  • Always Backup First: Before running bulk compression on existing images, enable the "Back up all original images" option. This gives you a safety net to revert changes.
  • Test Compression Levels: Use the plugin's preview tool to compare quality at different levels before applying them site-wide. For portfolios or photography sites, low (25%) or no compression is often best.
  • Compression is Cumulative: Applying 60% compression on an image that was already compressed at 85% will further degrade quality. It always works on the current file, not the original.
  • It Doesn't Remove Metadata: The optimization process is reported to preserve metadata, such as copyright information.

By understanding these mechanics, you can better leverage the Speed Optimizer's image compression to improve performance without sacrificing the visual quality your site requires.

Related Support Threads Support