Bart SalléFreelance webdeveloper Plan een gesprek
Database

Handige WooCommerce queries

Handige WooCommerce queries

Soms wil je wel eens snel alle WooCommerce orders of producten verwijderen. Je kunt onderstaande database queries gebruiken om het proces te versnellen.

Alle orders verwijderen

DELETE FROM wp_woocommerce_order_itemmeta;
DELETE FROM wp_woocommerce_order_items;
DELETE FROM wp_comments WHERE comment_type = 'order_note';
DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM tmp4b0cb3_posts WHERE post_type = 'shop_order' );
DELETE FROM tmp4b0cb3_posts WHERE post_type = 'shop_order';

Alle producten verwijderen

DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM tmp4b0cb3_posts WHERE post_type IN ( 'product', 'product_variation' ));
DELETE FROM tmp4b0cb3_posts WHERE post_type IN ( 'product', 'product_variation' );

Alle prullenbak producten verwijderen

DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM tmp4b0cb3_posts WHERE post_type = 'product' AND post_status = 'trash' );
DELETE FROM tmp4b0cb3_posts WHERE post_type = 'product' AND post_status = 'trash';

Alle coupons verwijderen

DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM tmp4b0cb3_posts WHERE post_type = 'shop_coupon' );
DELETE FROM tmp4b0cb3_posts WHERE post_type = 'shop_coupon';

Alle order notities verwijderen

DELETE FROM wp_commentmeta WHERE comment_id IN ( SELECT ID FROM wp_comments WHERE comment_type = 'order_note' );
DELETE FROM wp_comments WHERE comment_type = 'order_note';
Vraag advies over dit onderwerp
Bricks Builder

Maak een rollover productafbeelding zonder plugin te gebruiken

4 november 2024 Lees meer
Algemeen

Ik wil web developer worden maar welke opleiding of cursus kan ik dan het beste volgen?

25 september 2022 Lees meer
PHP

Class gebruiken in een WordPress plugin

9 oktober 2021 Lees meer