Bulk Attributes 3.1.1 Security update · free for every buyer · download it from My Account · security update What's new

How to bulk delete multiple WooCommerce attributes in phpMyAdmin

Bulk delete attributes in the database

Our plugin, Bulk Attributes for WooCommerce, allows WooCommerce shop admins to add hundreds of WooCommerce attributes easily to their store… That’s something very cool and appreciated by our users…

But sometimes, when using this plugin, it can happen that you add hundreds of attribute terms into the wrong place (attribute). What to do then? Here is how to get out of this…

Deleting WooCommerce attributes from phpMyAdmin

  1. Access phpMyAdmin from cPanel
    phpMyAdmin icon in the cPanel Databases section
    Depending on your hosting provider, this could open in another tab, so check the pop-up blocker settings of your browser.
  2. Locate the database used by that WordPress install and click on it… then click on SQL in the top bar.
    Selecting the WordPress database and the SQL tab in phpMyAdmin
  3. Now copy and paste this SQL query into the text area available there:
    DELETE FROM wp_term_taxonomy WHERE taxonomy = 'pa_attributename';

    Please make sure you replace “attributename” with your own attribute name.

    • To find out the real name of the attribute whose terms you would like to delete, go back to Products > Attributes. From there, click on the name of the attribute that contains the terms you would like to remove.
    • In the URL that opens, something like https://www.mywebsite.com/wp-admin/edit-tags.php?taxonomy=pa_brands-models&post_type=product, the part in red is the real attribute name that you need to use in the SQL query.
      The query in my case is:

      DELETE FROM wp_term_taxonomy WHERE taxonomy = 'pa_brands-models';

    Update (November 2026): back up your database first, these queries cannot be undone. Replace wp_ with your own table prefix (see $table_prefix in wp-config.php). The single query above only removes the rows of wp_term_taxonomy and leaves orphan rows in the other term tables. To remove the terms cleanly, run these queries instead, in this order:

    DELETE tr FROM wp_term_relationships tr INNER JOIN wp_term_taxonomy tt ON tt.term_taxonomy_id = tr.term_taxonomy_id WHERE tt.taxonomy = 'pa_attributename';
    DELETE tm FROM wp_termmeta tm INNER JOIN wp_term_taxonomy tt ON tt.term_id = tm.term_id WHERE tt.taxonomy = 'pa_attributename';
    DELETE t FROM wp_terms t INNER JOIN wp_term_taxonomy tt ON tt.term_id = t.term_id WHERE tt.taxonomy = 'pa_attributename';
    DELETE FROM wp_term_taxonomy WHERE taxonomy = 'pa_attributename';

    Then go to WooCommerce > Status > Tools and run “Regenerate the product attributes lookup table”. Products and variations that used these terms keep the attribute in their settings, so check them afterwards. Today you can also delete terms without SQL: Products > Attributes > Configure terms, select them all, then Bulk actions > Delete.

  4. Run this query from phpMyAdmin to have all the attribute terms deleted… Repeat as many times as needed.
    Running a DELETE query on wp_term_taxonomy in phpMyAdmin

I hope that this little tutorial was helpful to you…