Skip to main content

How to Get WooCommerce Thumbnail Size

If you’re using the WooCommerce plugin for WordPress, you may want to change the thumbnail size. The default size is 150 pixels square, but WooCommerce generates its own thumbnail image sizes.

The size name of WooCommerce image size is “woocommerce_thumbnail” and “shop_catalog”. After knowing the names, we can retrieve them from a list of image size names with a global variable called $_wp_additional_image_sizes.

//get all size names with their dimensions
global $_wp_additional_image_sizes; 

//get width and height of woocommerce_thumbnail
$woo_image_size = $_wp_additional_image_sizes['woocommerce_thumbnail']['width'].'x'.$_wp_additional_image_sizes['woocommerce_thumbnail']['height'];

By continuing to use the site, you agree to the use of cookies.