How to bulk delete multiple Woocommerce attributes in phpMyAdmin

James Munford Help Leave a Comment

How to bulk delete multiple Woocommerce attributes in phpMyAdmin

Our plugin, allow woocommerce shop admin to add hundreds of woocommerce attributes easily to their store….Thaat’s something very cool and appreciated by our suers….

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

Deleting Woocommerce attributes from phpMyAdmin

  1. Acces phpMyAdmin from cPanel

    Depending on your hosting provider, this could open in another tab, so check your pop up blocker settings in your browser.
  2. Locate the table concern by that worpdress install and click on it….then click on SQL in the top bar
     
  3. now copy and paste that sql query into the text area available in there:
    DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_attributename';

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

    • To find out the real name of the attributes which terms you would like to delete, go back to Products > Attributes. From there click on the attribute name, which contains terms you would like to remove.
    • In the url that will be open, something like https://www.mywebsite.com/wp-admin/edit-tags.php?taxonomy=pa_brands-models&post_type=product. 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 LIKE 'pa_brands-models';
  4. Run this query from phpMyAdmin to have all attribtues terms deleted ….Repeat as much as need

I hope that this little tutorial was helpfull for you….

Leave a Reply

Your email address will not be published. Required fields are marked *

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

I agree to these terms.