Optimizing WordPress Media: Disable Unnecessary Thumbnails and Free Up Server Space

Optimizing WordPress Media
WordPress automatically generates multiple image thumbnails for every upload, often consuming excessive server storage—especially on media-heavy sites. This guide shows you how to stop unnecessary thumbnail creation, identify which plugins or themes are adding extra image sizes, and safely delete existing thumbnails you no longer need. You'll also learn how to use plugins and child themes to maintain long-term control over your media settings. Whether you're tight on hosting space or want to keep your site lean and fast, optimizing WordPress media is a must. Follow these steps to clean up and future-proof your media library effectively.

Optimizing WordPress Media is the solution to the issue many users face for excessive server storage usage due to the automatic generation of multiple thumbnail files for every uploaded image. By default, WordPress and various themes or plugins create several image sizes, many of which may not be necessary for the site’s needs.

Here’s the Idea:

  1. Disable Automatic Thumbnail Creation:
    • Prevent WordPress from generating unnecessary thumbnail files during image uploads.
    • Ensure only the original uploaded image is retained, or limit thumbnails to only those sizes actively used on the site.
  2. Identify Sources of Image Handling:
    • Determine whether themes or plugins are registering custom image sizes or overriding default behavior.
    • Disable or modify these settings to prevent unnecessary image size creation.
  3. Remove Existing Thumbnail Files:
    • Clear out previously generated thumbnails that are no longer required.
    • Safely clean up server storage without affecting the functionality of the site.

This issue is relevant for anyone seeking to optimize their WordPress site’s storage usage, especially for those with limited hosting space or sites that frequently upload media files. To achieve the goal of disabling automatic thumbnail generation in WordPress and identifying potential plugins or themes that might influence image handling, follow these steps to for Optimizing WordPress Media:

1. Disable Thumbnail Creation in WordPress

WordPress generates thumbnails based on default settings or custom settings from themes and plugins. To prevent the creation of unnecessary thumbnails:

  1. Set Media Sizes to Zero:
    • Go to Settings > Media in your WordPress dashboard.
    • Set the values for “Thumbnail size,” “Medium size,” and “Large size” to 0.
    • Save the changes.
  2. Modify functions.php in Your Theme:
    • Open your theme’s functions.php file (preferably via a child theme to avoid losing changes on updates).
    • Add the following code to disable additional image sizes:

2. Identify and Disable Image Sizes Added by Plugins

Plugins like may register custom image sizes. To identify and disable them:

  1. Check Plugin Documentation or Settings:
    • Look for specific settings in the plugin for image sizes.
  2. Find Registered Image Sizes: Add the following code snippet to your functions.php to list all registered image sizes:

This will output all registered sizes, which you can then disable using the code in Step 1.

3. Delete Existing Thumbnails

Once you’ve disabled automatic thumbnail creation, you can clean up existing thumbnail files:

  1. Use a Plugin:
    • Install a plugin like Media Cleaner or Advanced Bulk Image Deletion to scan and remove unused thumbnail files.
    • Be cautious and back up your site before using such tools.
  2. Manual Cleanup:
    • Access your server via FTP or cPanel.
    • Navigate to the wp-content/uploads directory.
    • Remove thumbnail files (e.g., image-150x150.jpg) while keeping the original images intact.

4. Check Theme and Plugin Conflicts

Since theme and plugins can have conflicts anytime:

  1. Review Theme-Specific Functions:
    • Check the theme’s documentation or files for any custom image sizes registered via the add_image_size function.
    Example location:
    • wp-content/themes/custom-theme/functions.php
    • Look for add_image_size calls and remove or modify them.
  2. Disable Plugins One by One: Temporarily deactivate plugins and test if thumbnails are still generated. This will help identify any plugin-related image handling functionality.
  3. Override Theme Defaults: If the theme adds mandatory sizes and doesn’t respect your settings:
    • Use a child theme to override the add_image_size or wp_generate_attachment_metadata functions in the parent theme.

5. Prevent Regeneration of Thumbnails

If plugins or other actions trigger thumbnail regeneration:

  1. Install the Stop Generating Unnecessary Thumbnails plugin.
    • This plugin prevents thumbnail regeneration, even if new sizes are registered.

6. Testing and Validation as final step in Optimizing WordPress Media

After making changes:

  1. Upload a new image and verify no thumbnails are created.
  2. Check the WordPress Media Library to confirm only the original file is listed.

By following these steps, you can effectively stop WordPress from creating unnecessary thumbnails, clean up server space, and ensure your changes persist. Let me know if you encounter issues during implementation!




    Full-Service Agency

    Here at PrefrCo, we’re on a mission to create opportunities for clients. We believe nothing is more important than partnerships that drive long-term business success. Our diverse team maximizes impact for our clients. We outthink the competition, not outspend them.

    It goes without saying that we’re big fans of purpose-driven design. We craft innovative digital experiences to give your customer’s the most effective interaction with your brand. We understand the time and effort it takes to build an audience in today’s digital world, which is why we value efficiency, security and custom solutions above all else.

    • Website Development 
    • Responsive Design
    • Website Accessibility
    • Search Engine Optimization
    • Hosting & Server Management
    • Email Marketing

    Looking to take control of your online social presence? Look no further. We’ll monitor your brand, industry and competitors and create relevant content that keeps your business ahead of the curve. All with the goal of gaining customer loyalty and confidence in your brand.

    • Platform & Reputation Management
    • Review Monitoring
    • Organic Posting
    • Paid Social Advertising

    Customized conversion tracking? Personalized analytics programs? Dedication to data-informed decisions? Check, check and check! Our in-house data team sifts through large data sets every day to provide our clients with valuable insights and the highest possible return on investment. In short, data drives everything we do.

    • Ad Tracking & Measurement
    • Custom Reporting & Analysis 
    • A/B Testing
    • Market & Industry Research
    • Conversion Rate Optimization