Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

how to clear all products woocommerce keep category

-- Delete all WooCommerce products
DELETE FROM wp_term_relationships 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');

-- Delete orphaned postmeta
DELETE pm FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL
Comment

PREVIOUS NEXT
Code Example
Typescript :: nestjs ratelimit 
Typescript :: aws sts get-caller-identity extract account 
Typescript :: divide all elements of list by an integer 
Typescript :: E_MISSING_NAMED_MIDDLEWARE: Cannot find a middleware named "auth" 
Typescript :: .env typescript 
Typescript :: Missing file extension "tsx" for "./App"(import/extensions) 
Typescript :: remove all children of node in typescript 
Typescript :: typescript code region 
Typescript :: googleapis fonts cdn link 
Typescript :: mysql workbench an apparmor policy prevents this sender 
Typescript :: ionic 4 set root page when logout 
Typescript :: union of two sets python syntax 
Typescript :: react native base64 encode 
Typescript :: react forwardref useImperativeHandle typescript 
Typescript :: replace string in typescript 
Typescript :: check return type jest 
Typescript :: angular unsubscribe from observable 
Typescript :: typescript remove whitespace from string 
Typescript :: ts partial record 
Typescript :: regex match round brackets contains any characters 
Typescript :: ts await foreach loop 
Typescript :: simple firestore cloud function update document 
Typescript :: angular reload component on route param change 
Typescript :: vue object array type props 
Typescript :: eslint no-unused-vars typescript interface 
Typescript :: google sheets reference cell static 
Typescript :: typescript iterate over interface 
Typescript :: how to get url parameters snapshots in angular 
Typescript :: deno current directory 
Typescript :: conditional src angular 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =