Löschen aller Produkte und Kategorien in Woocommerce

ACHTUNG!!! Wie immer, vorher Backup erstellen!

Gegebenfalls bitte das Tabellen-Prefix ändern. (Ersetze wp_ durch EuerPrefix_)

Viel Spaß beim Nachkochen.

Löschen aller Produkte per SQL

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');

Quelle

Löschen aller Kategorien und Schlagwörter

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'

Quelle

3 Kommentare zu „Löschen aller Produkte und Kategorien in Woocommerce“

  1. Alle Kommentare löschen

    // Lösche alle unerledigten Kommentare
    DELETE from wp_comments WHERE comment_approved = ‚0‘;

    // Lösche alle bereits genehmigten Kommentare
    DELETE from wp_comments WHERE comment_approved = ‚1‘;

    // Lösche alle Spam Kommentare
    DELETE from wp_comments WHERE comment_approved = ’spam‘;

    // Lösche alle Kommentare im Papierkorb
    DELETE from wp_comments WHERE comment_approved = ‚trash‘;

    // oder alle in den Papierkorb schieben
    UPDATE wp_comments SET comment_approved = ‚trash‘ WHERE comment_karma = 0;

    Quelle: https://bloggen.xyz/alle-kommentare-loeschen-im-wordpress/

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Nach oben scrollen