Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

Disable WordPress from Generating Various Image Sizes Automatically

November 10, 2022
in Blog, Wordpress
0
ADVERTISEMENT

Table of Contents

If you are using WordPress when you upload an image it will automatically generate six images of varying sizes. WordPress generating multiple sizes is a little bit pointless especially when you’re not going to use those images as it will take your hosting space.

There is a simple way to disable it in a simple way without a plugin. And luckily this post will explain how to disable WordPress from generating various image sizes automatically with two methods, without a PHP code and with a PHP code inside your theme function.php.

Disable Generating Auto Image Sizes Without Coding

To prevent WordPress from generating different image sizes after uploading an image, follow these steps:

Log into WordPress with the Administrator role account.
On the Dashboard in the left sidebar, go to Settings, and go to Media (see the screenshot below).
In the Media Settings, set the width and height to zero for Thumbnail size, Medium size, and Large size.
Click on Save Changes, to save the changes.

Note Note: This method has cons which are it still generates medium large images, 1536×1536 and 2048×2048 sizes.

Disable Generating Auto Image Size with Coding to Your function.php

If you want to completely disable all the image sizes, insert this code to your function.php

function disable_media($sizes) {
    unset($sizes['thumbnail']);
    unset($sizes['medium']);
    unset($sizes['medium_large']);
    unset($sizes['large']);
    unset($sizes['1536x1536']);
    unset($sizes['2048x2048']);
    return $sizes;
}
add_filter('intermediate_image_sizes_advanced', 'disable_media');
add_filter('big_image_size_threshold', '__return_false');

You might also want to add this to set the size to zero to disable WordPress from generating images when you activated your theme

if (isset($_GET['activated']) && is_admin()) {
    update_option('posts_per_page', 12);
    update_option('thumbnail_size_w', 0);
    update_option('thumbnail_size_h', 0);
    update_option('thumbnail_crop', 1);
    update_option('medium_size_w', 0);
    update_option('medium_size_h', 0);
    update_option('medium_large_size_w', '0');
    update_option('medium_large_size_h', '0');
    update_option('large_size_w', 0);
    update_option('large_size_h', 0);
}

That’s it, now WordPress won’t autogenerate all the images you upload from now on.

If you want WordPress to generate a thumbnail with the sizes you set, insert this code.

// This will set your thumbnail size to 421x263.
add_image_size('bigthumb', 421, 263, true);
5/5 - (1 vote)
Previous Post

How to Upgrade Symantec Endpoint Protection 14 to Latest Version

Next Post

How to Upgrade Symantec Endpoint Client Remotely from SEPM

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

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

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory