Skip to content

Instantly share code, notes, and snippets.

@nosilver4u
Last active February 28, 2025 17:56
Show Gist options
  • Save nosilver4u/bc44efdb9f4163f0b37703135fa3c21d to your computer and use it in GitHub Desktop.
Save nosilver4u/bc44efdb9f4163f0b37703135fa3c21d to your computer and use it in GitHub Desktop.
Disable Woo thumbs and auto re-generation
<?php
/*
Plugin Name: Disable Woo Thumbs
Description: Disables all thumbs from WooCommerce and prevents them being regenerated.
Version: 1.0.0
*/
add_action( 'init', 'disable_woo_thumbs_on_init' );
function disable_woo_thumbs_on_init() {
remove_image_size( 'uncode_woocommerce_nav_thumbnail_regular' );
remove_image_size( 'uncode_woocommerce_nav_thumbnail_crop' );
remove_image_size( 'shop_thumbnail' );
remove_image_size( 'shop_single' );
remove_image_size( 'shop_catalog' );
remove_image_size( 'woocommerce_gallery_thumbnail' );
remove_image_size( 'woocommerce_single' );
remove_image_size( 'woocommerce_thumbnail' );
add_filter( 'woocommerce_background_image_regeneration' , '__return_false' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment