• Resolved astridix

    (@astridix)


    Hi there,

    I would like to know the supported (proper) way to delete all products along with its attributes (I don’t use categories).

    I’ve used available SQL scripts that does it, but I would like to know what WooCommerce considers a supported way of doing it. I don’t know if the available SQL scripts does what is really required.

    I also have a side problem which leads to this question. The wp_termmeta table is huge (250K+ records for just 750 simple products, no variations). The table grows by 10K with each 750 record imported, is it supposed to do that?

    Thanks, Caesar.

Viewing 5 replies - 1 through 5 (of 5 total)
  • corsonr – a11n

    (@corsonr)

    Automattic Happiness Engineer

    Hi @astridix,

    If I am capturing this correctly, you’d like to properly delete all products and attributes.

    If you go to WooCommerce > Status > Tools, there’s a builtin feature for that:


    Link to image: https://d.pr/i/TevkuZ

    You can also consider using WP-CLI with something like:

    wp post list --field=ID --post_type=product | xargs wp post delete --force

    Thread Starter astridix

    (@astridix)

    Hi, Thank you for the response.

    My WooCommerce Status -> Tools screen does not display those two options.

    I have the following options:
    Woocommerce Status Tools

    Thanks, Caesar.

    Thread Starter astridix

    (@astridix)

    Hi Remi,

    wp-cli worked with minor alterations.

    1. The wp-cli.phar needs to be renamed to wp and placed in a path directory.
    2. Make wp executable (chmod +x wp)
    3. The command line needs to have –path=(/wp directory)

    wp post list –field=ID –post_type=product –path=/var/www/mywpsite | xargs wp post delete –force –path=/var/www/mywpsite

    Many Thanks, Caesar.

    Thread Starter astridix

    (@astridix)

    Hi Remi,

    Haven’t heard from you on the Delete Products & Variations options that I’m missing from my Woocommerce dashboard.

    Please help? Is there an official support channel (paid is fine)?

    Many Thanks, Caesar.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @astridix I archived your duplicate topic. Please do not post duplicates, those get archived when found.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to properly delete all products and attributes?’ is closed to new replies.