How to Bulk Edit Product Prices in WooCommerce
Photo by Artem Beliaikin On Unsplash
We’re pretty sure that if your online store is holding a sale, all you want to do is apply a bulk discount to your WooCommerce products without having to create a coupon code. In this article, Mangcoding will discuss how to bulk edit product prices. To find out how, please keep reading!
Don’t forget that while coupons are trackable and allow you to evaluate your marketing efforts through usage stats, they require customers to take an extra step at checkout (i.e., entering the correct coupon code).
In this post, we’ll look at the 3 recommended options for applying bulk store discounts. The best method depends on the type of products you have (simple vs. variable, for example) and whether you want to handle this via the dashboard or with a bit of PHP.
This is the easiest solution. You can do it from the “Products” admin page in your WordPress dashboard. Here’s how:
- Go to the “Products” admin page.
- Select all the products you want to apply a sale price to.
- Click Bulk Actions > Edit.
- Choose Sale > “Change to:”.
- Select “Set to regular price reduced by a fixed amount or % discount”.
- Enter, for example, 30%.
- Save/Update.

This method only works for simple products. It won’t update variable products, grouped products, or any products with price ranges (min – max).
If your store has many variable products (like a clothing store with different sizes, colors, styles, etc.), the method above won’t work.
Instead, we recommend using a plugin. Below are WooCommerce plugins we suggest based on market reputation, quality of support, clean code, long-term reliability, and active update support from WordPress.
A. Bulk Table Editor for WooCommerce
Sold on the official WooCommerce marketplace, the Bulk Table Editor transforms your product admin into a spreadsheet-like table (like Excel). It provides bulk editing functions for stock, prices, sale prices, sale start and end dates, as well as search, filter, and pagination tools.
You can also delete products and variations in bulk by simply removing rows from the plugin’s spreadsheet. This makes it easy to move items to the trash.
Additionally, you can bulk delete sale prices and quickly set up mass store-wide offers in seconds.

B. YITH WooCommerce Bulk Product Editing
With just one click, you can automatically apply the same bulk discount to both variable and simple products. You can also filter by category or use advanced search to easily find the exact products you want to edit.

This is our favorite method. It requires adding a bit of PHP code to your child theme’s functions.php file.
In this case, the coupon will automatically be applied to the cart once the user opens the WooCommerce Cart page.
Steps first, create a coupon from the WordPress > Dashboard WooCommerce > Coupons. Make sure to set the coupon to apply a percentage discount to the cart (not a fixed amount). Save the coupon code because you’ll need it in the PHP snippet.
Then apply the coupon programmatically if the product is in the cart by following these notes:
- Create the coupon code you want to apply after a specific product is added to the cart (go to WooCommerce / Coupons / Add New and set your coupon code. For example, “freeweek”, which is the coupon code we will use later in the PHP snippet).
- B. Identify your product ID (go to WordPress / Products and hover over the product you want the coupon to apply to. Note any ID shown in the URL bar. In our example, we are targeting product ID = “745”).
/**
* @snippet Apply a Coupon Programmatically if Product @ Cart - WooCommerce
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @compatible WC 4.1
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/
add_action('woocommerce_before_cart', 'bbloomer_apply_matched_coupons');
function bbloomer_apply_matched_coupons() {
$coupon_code = 'freeweek';
if (WC()->cart->has_discount($coupon_code)) {
return;
}
foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) {
// this is your product ID
$autocoupon = array(745);
if (in_array($cart_item['product_id'], $autocoupon)) {
WC()->cart->apply_coupon($coupon_code);
wc_print_notices();
}
}
}
Then, apply the coupon programmatically if a specific product is in the cart :
/**
* @snippet How to Apply a Coupon Programmatically - WooCommerce Cart
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @compatible WC 4.1
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/
add_action('woocommerce_before_cart', 'bbloomer_apply_coupon');
function bbloomer_apply_coupon() {
$coupon_code = 'freeweek';
if (WC()->cart->has_discount($coupon_code)) {
return;
}
WC()->cart->apply_coupon($coupon_code);
wc_print_notices();
}
That’s the article on how to bulk edit product prices in WooCommerce from Mangcoding. Please feel free to try out the methods we’ve shared above. Hopefully, this article is helpful, solves your problems, and provides you with the right solution.
Reference : How to Bulk Edit Product Prices in WooCommerce