Skip to content

How to remove WooCommerce Variant Description in Bulk

  • by

Hello all!

In this article, we will learn how to delete all product descriptions in WooCommerce in bulk. First of all, make sure you have backed up your website before doing this. Because after doing this, you will not be able to restore your version descriptions unless you upload your backup. If you are ready, let’s get started!

The first thing you need to do is open your theme’s functions.php file. You can do this via your panel or with an FTP client.

Add the following code to the end of your functions.php file and wait a bit then delete it. That’s it! All variant descriptions of your products have been deleted.

function delete_all_variation_descriptions() {
    // Get all product variants
    $args = array(
        'post_type' => 'product_variation',
        'posts_per_page' => -1,
    );

    $variations = get_posts($args);

    foreach ($variations as $variation) {
        // Remove product variant description
        update_post_meta($variation->ID, '_variation_description', '');
    }
}
delete_all_variation_descriptions();

1 thought on “How to remove WooCommerce Variant Description in Bulk”

  1. This work has an almost meditative quality to it. Each sentence feels carefully considered, yet they flow so naturally that it feels effortless. The insights you’ve shared seem to carry the weight of experience, and there’s a gentleness to the way you present them, as though you are offering the reader a piece of wisdom that you’ve carefully cultivated over time.

Leave a Reply

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