How to stop X Theme generating thumbnail images?

I look into the files through FTP and found that there were many thumbnail files.
I think I don’t need all that thumbnail sizes, so I installed the plugin Simple Image Sizes.

But I tried some with the plugin, however, it seems like X Theme overwrites the thumbnail setting over the setting that I made.

Is there any essential thumbnail sizes for X Theme? I want to disable thumbnail auto-generation with Medium Large size thumbnail only excluded if there is no problem disabling all other thumbnail sizes.

Overall, I’d be happy to know if I could just make the plugin works fine without the interference from the thumbnail setting of X Theme.

Hello Arisa,

Thanks for writing in!

By default, X theme defines its own image sizes to be used specifically in some parts of the theme like the featured image for the single posts and for the blog indexes. If you want to disable it, assuming the child theme is set up, please add the following code in your child theme’s functions.php file

// Remove X theme image sizes
// =============================================================================
function remove_x_image_sizes() {
  remove_image_size('entry');
  remove_image_size('entry');
  remove_image_size('entry-fullwidth');
  remove_image_size('entry-cropped-fullwidth');
}
add_action('init', 'remove_x_image_sizes');
// =============================================================================

The code will only stop generating these images sizes when you upload new images. Any existing X thumbnail images in your wp-uploads folder will not be deleted.

If you need anything else, please let us know.

Hi, @RueNel!

After I appy that code to my wordpress, will the images displayed in the media selection (uploading?) be shown properly?

I tried to delete existing all thumbnail files, and after that I couldn’t select media files because I can’t see any thumbnails at all.

Hello Arisa,

Please install “Regenerate Thumbs” plugin and regenerate your image thumbnails first.

If nothing is helping, please provide access to your site in a secure note so that we can take a closer look.

Regards.

I just tried and it seems like there are 4 thumbnail files for each image file.

So this 4 thumbnail files are minimum number of thumbnail files for proper loading right?

Hello Arisa,

The 4 thumbnails are the default WordPress image sizes. They are thumbs, medium, large and full.

Hope this helps.

Uh… something maybe wrong?

I only applied the code that you provided, and the current image files are just like the image above.

And I checked the wordpress media setting and post-thumbnail, entry-cropped, medium_large are activated.

Is this something wrong? And also, I’m curious why there is weird size thumbnail image such as DSC00007-768x512-25x25.jpg. There’s already DSC-00007-768x512.jpg exists.

I set all the Thumbnail size, Medium size, Large size to 0px (both max. height and width).

Hello Arisa,

There was a typographic error in my code. Please update the PHP code and use this.

// Remove X theme image sizes
// =============================================================================
function remove_x_image_sizes() {
  remove_image_size('entry');
  remove_image_size('entry-cropped');
  remove_image_size('entry-fullwidth');
  remove_image_size('entry-cropped-fullwidth');
}
add_action('init', 'remove_x_image_sizes');
// =============================================================================

After that, please regenerate the thumbnail images again.

The 25x25 image size might be coming from a plugin or other image setting.

Works fine! Thanks @RueNel

Have a nice day :smiley:

You’re most welcome!
Thanks for letting us know that it has worked for you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.