E
E
eugene1592020-07-05 01:26:28
WordPress
eugene159, 2020-07-05 01:26:28

WooCommerce for products creates additional. pictures (450x450 and 100x100). How to turn it off?

The task is to import a lot of products into Wordpress from XML.

To solve the problem, I found the WP All Import plugin. It works great. But the problem is that when importing images, additional ones are created. pictures with sizes: 450x450 and 100x100. Because of what there is not enough space on MY hosting.

There will be room on the client's hosting, but the client will not agree to the deal until he sees that I can import all products from XML.

Question. How to prevent Wordpress from creating add. Pictures? I understand that it's not good to display original pictures in product previews, which can even be 4K. But, as I said, this is just to show the client that I can import his products into Wordpress.

PS
Wordpress originally created more images, but I went here and put 0 everywhere:
/wp-admin/options-media.php
But that didn't work with the 450x450 and 100x100 sizes.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Ermilov, 2020-07-05
@sergeiermilov

Most likely here you have a question that in XML there is an indication of sizes you do not need. And you need to remove those lines with images and sizes from the XML itself.
There are, of course, a couple of options to turn off the creation of dimensions.
The first option is to search the Woocommerce theme template for similar lines and remove them:

add_theme_support( 'woocommerce', array(
'thumbnail_image_width' => 200,
'gallery_thumbnail_image_width' => 100,
'single_image_width' => 500,
) );

The second option is to use a similar snippet:
// Remove default WC image sizes
function remove_wc_image_sizes() {
    remove_image_size( 'woocommerce_thumbnail' );
    remove_image_size( 'woocommerce_single' );
    remove_image_size( 'woocommerce_gallery_thumbnail' );
    remove_image_size( 'shop_catalog' );
    remove_image_size( 'shop_single' );
    remove_image_size( 'shop_thumbnail' );
}
add_action('init', 'remove_wc_image_sizes');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question