Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk3 min

How to Prevent WordPress From Generating Image Sizes

Stop WordPress from generating selected intermediate image files with the right filter, while preserving sizes your theme and plugins need.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To stop WordPress generating intermediate image files for new uploads, use the intermediate_image_sizes_advanced filter. Return an empty array to suppress every size handled by that filter, or remove only selected sizes to preserve ones your theme or plugins need. WordPress’s separate large-image scaling feature uses big_image_size_threshold; changing that filter does not stop intermediate-size generation.

Choose which image behavior to change

WordPress generates intermediate files from the image sizes registered when it creates attachment metadata. The right control depends on what you want to prevent:

  • Stop intermediate sizes: filter intermediate_image_sizes_advanced. This affects the set of sizes WordPress is about to generate.
  • Stop large-image scaling: filter big_image_size_threshold. WordPress documents a default threshold of 2560 pixels for the maximum width and height; returning false disables this scaling behavior. It does not disable thumbnail or other intermediate sizes.

Disable all intermediate sizes for new uploads

Add this PHP filter in a site-specific plugin or the active theme’s setup code, where WordPress loads filters:

add_filter(
    'intermediate_image_sizes_advanced',
    '__return_empty_array'
);

This returns an empty list of sizes for the filter to process. It is a broad change: layouts, featured-image templates, or plugins may expect particular image sizes and can display images differently if those files are not created.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep needed sizes and remove only the rest

If the site relies on some registered sizes, use a callback to remove only the entries you do not want. The filter receives an associative array of sizes WordPress is about to generate; change that array and return it.

add_filter( 'intermediate_image_sizes_advanced', function ( $sizes ) {
    unset( $sizes['medium_large'] ); // Example: remove one registered size.
    return $sizes;
} );

Use the actual array key registered on your site. Core, themes, and plugins can all register image sizes; custom sizes are commonly added with add_image_size(). Inspect the site’s registrations and check theme templates, featured images, and plugin requirements before removing an entry.

Disable large-image scaling separately

WordPress’s large-image scaling is not the same as generating intermediate sizes. The big_image_size_threshold filter controls whether an image exceeding the threshold is scaled down; the documented default is 2560 pixels, applied to the maximum width and height. To disable that scaling:

add_filter( 'big_image_size_threshold', '__return_false' );

Use this only if you want to retain the original dimensions instead of WordPress’s large-image -scaled behavior. Leave the intermediate-size filter in place or configure it separately if you also want to change thumbnail and other generated sizes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand what happens to existing media

These filters govern generation; they do not clean up files already created. Removing a size registration does not automatically delete its existing generated files, and regenerating attachment metadata does not check for and remove every intermediate file previously created for that image. Treat cleanup as a separate maintenance task: back up the media library and verify that no posts, theme components, or plugins reference the files before deleting them.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Test the upload workflow used on your site

Do not assume every upload follows the same server-side hook sequence. In the Block Editor’s documented client-side processing flow, wp_generate_attachment_metadata can run with context create and again with context update after a finalize request. Client-side processing uses size filters even though some server-side image hooks do not fire. Test with the site’s WordPress version, editor, theme, and plugins, then confirm both that unwanted files are no longer created and that displayed images still work.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.