Answers for "delete all woocommerce products sql"

PHP
1

how to delete all products woocommerce in phpmyadmin

DELETE relations.*, taxes.*, terms.*
FROM wp_term_relationships AS relations
INNER JOIN wp_term_taxonomy AS taxes
ON relations.term_taxonomy_id=taxes.term_taxonomy_id
INNER JOIN wp_terms AS terms
ON taxes.term_id=terms.term_id
WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type='product');
  
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product');
DELETE FROM wp_posts WHERE post_type = 'product';
Posted by: Guest on November-03-2020
0

rermove categories woocommerce sql

DELETE a,c FROM wp_terms AS a 
LEFT JOIN wp_term_taxonomy AS c ON a.term_id = c.term_id
LEFT JOIN wp_term_relationships AS b ON b.term_taxonomy_id = c.term_taxonomy_id
WHERE c.taxonomy = 'product_tag';

DELETE a,c FROM wp_terms AS a
LEFT JOIN wp_term_taxonomy AS c ON a.term_id = c.term_id
LEFT JOIN wp_term_relationships AS b ON b.term_taxonomy_id = c.term_taxonomy_id
WHERE c.taxonomy = 'product_cat'
Posted by: Guest on April-26-2021
0

delete all products from woocommerce

DELETE relations.*, taxes.*, terms.*
 
FROM wp_term_relationships AS relations
 
INNER JOIN wp_term_taxonomy AS taxes
 
ON relations.term_taxonomy_id=taxes.term_taxonomy_id
 
INNER JOIN wp_terms AS terms
 
ON taxes.term_id=terms.term_id
 
WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'));
 
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'));
 
DELETE FROM wp_posts WHERE post_type IN ('product','product_variation');
Posted by: Guest on August-25-2021

Code answers related to "delete all woocommerce products sql"

Browse Popular Code Answers by Language