You should be able to do this with the same filter that is talked about here.
The full-size images are being kept by WordPress. It’s not really a WooCommerce thing. As well as the settings for images in WooCommerce you will also need to set minimum image size in WordPress’s Settings>Media... Then this script (see the link above for complete discussion) should remove the originals.
add_filter( 'wp_generate_attachment_metadata', 'delete_fullsize_image' );
function delete_fullsize_image( $metadata )
{
$upload_dir = wp_upload_dir();
$full_image_path = trailingslashit( $upload_dir['basedir'] ) . $metadata['file'];
$deleted = unlink( $full_image_path );
return $metadata;
}
Related Posts:
- WooCommerce single products images doesn’t zoom on hover and doesn’t change clicking on gallery
- woocommerce image product add a class and data-src attributes
- Image is not displayed in overridden woocommerce email
- WordPress Twenty Seventeen header image size not responsive for mobile
- How to upload images from wordpress front-end (the first image must be thumbnail and the rest without first must be in gallery woocommerce product)
- How to delete 1000s of duplicated images in WordPress?
- Some images aren’t shown on wordpress after installation on host
- Add custom CSS class to product images
- How do I make the product image smaller on a WooCommerce product page?
- Updating product image
- Images not uploading on product page of woocommercr
- How to solve `Error getting remote image` in woocommerce rest api script?
- Images not showing on site – Even though they are there
- Delete product image using WooCommerce API?
- Set Post Thumbnail to external URL
- Correct method of reducing the number of images created by WP and Woo together
- Titles with thumbnails in media library
- WordPress pointing animated GIF images with wrong file name upon upload (GIFs animation not working)
- Blurry product card image – rendered is 486×452 vs 300×279 in real image. Smaller versions being autocreated and served using srcset
- Export Woocomerce Image Product URL
- How do I get my image for my product to not be blurry
- Woocommerce Gallery Image Caption: Use “caption” — not “alt tag”. Keep alt tag as is
- Product categories don’t appear as option to build menu
- Woocommerce show cross sells on singe product page [closed]
- Search results don’t show products
- Is there a way to get customers logged out without calling wp-login.php?
- How to filter Post using Meta Data REST API
- WooCommerce checkout: How can I change $field_container of a checkout field?
- Is it possible to recalculate cart prices? [closed]
- Woocommerce: Get Cart ID
- Woocommerce – remove sale price field from dashboard [closed]
- WooCommerce Country Drop Down colours CSS [closed]
- Fatal error: Call to undefined method WooCommerce::nonce_field()
- Where do I find where woocommerce stores product data in cpanel file manager?
- Woocommerce wp-admin search products through custom meta value too
- show shop instead of 404 page for missing products
- if statement for search results
- Woocommerce exclude specific categories products from related products
- Woocommerce: Prevent sending of email when order is “Completed”
- Server-Based CRON Job
- How to incluide custom field in WooCommerce email using placeholder
- Woocommerce: Can’t put items in cart in iframe and on iphone
- Display products by category in Woocommerce cart page?
- Checkout form looks terrible [closed]
- How to upload multiple image using wp_insert_post
- How can i manage total price in checkout page? [closed]
- In WooCommerce product archive, how can you also set the quantity to be added to cart by typing, instead of just by using +/-?
- WooCommerce product category permalinks
- How to do string attachment with wp_mail
- Can’t show most recent comment on top with wp_list_comments() for WooCommerce reviews
- WooCommerce order complete email logic
- WooCommerce Displaying Price With & Without TAX [closed]
- Filtering variable WooCommerce products by stock level using meta_query
- Woocommerce hook on address field change [closed]
- Maintenance mode just for WooCommerce shop pages [closed]
- Dropdown menu not displaying WordPress
- WooCommerce – Create multiple product tags via rest api endpoint
- WooCommerce which roles and capabilities control user login re-direct to Woo Account Page?
- how do i remove a woo-commerce widget?
- How can I convert woocommerce checkout fields in capital letters
- Conditional action hook
- Sending Email upon registration
- Order by date on category dynamically – Woocommerce
- How To Customize The Product Page Template for a WooCommerce Custom Product Type Plugin [closed]
- Options to develop a non-ecommerce catalog?
- wp_set_object_terms setting only first id from array
- I need to export all products and images but I don’t know which table the images are in
- Add only sku to product url woocoomerce
- What is better way to sync wp multisite woocommerce products
- Remove required from a custom field created from WooCommerce Checkout Field Editor plugin
- Displaying Woocommerce Product Attributes on single product page
- WooCommerce – Child Category wont show, but Parent does
- How to hide a random text with a div tag using a class on product pages with a specific tag
- Woocommerce digital download not working – database error Cannot add or update a child row: a foreign key constraint fails [closed]
- Recently viewed products – Order by viewed
- How can i add product Accessories from front-end using custom php form?
- How to save order item custom attributes save into custom table
- Manually create an order with a product ID woocommerce
- WooCommerce subscriptions give option of manual renewal on checkout [closed]
- Change order status after checkout
- Is it safe to update an old site after backing it up and activating a child theme?
- How to add coupon expiry date into the followup emails?
- Disable Woocommerce main shop page, but not the product category archive pages
- access Woo commerce | WordPress methods externally
- How to store ACF from product in user_meta?
- Woocommerce set single city to sell to
- Trying to link to a custom css file in a new folder
- eCommerce solution doesn’t want to display its shortcodes or any content where it’s set to [closed]
- How do I make a diagonal strikethrough on wordpress? [closed]
- Woocommerce – Remove ‘Buy Product’ Button from shop page [closed]
- Add woocommerce.css in template?
- How to dublicate WC Product title to shortdescription field? [closed]
- Change variants URL
- Use a woocommerce hook to create a table and populate it with a query
- Woocommerce product and category in url [closed]
- Woocommerce ajax checkout get wc_checkout_params is not defined
- Struggling with Per-Item Shipping and Classes
- Woocommerce plugin increasing Database size
- Show Featured products with custom taxonomy template
- Snippet to Log “Payment Failed” in Syslog [closed]