How to Change WooCommerce Prices in Bulk

How to Change WooCommerce Prices in Bulk: 4 Methods

Are you looking for ways to edit the prices of multiple products at once? You’ve come to the right place. In this article, we will show you different methods to change WooCommerce prices in bulk.

Why Change Prices in Bulk in WooCommerce?

There are many situations where you may need need to update prices for multiple products in your store. But if you sell many items, having to change the prices for each product one by one is time-consuming and inefficient. Not only will you waste a lot of time doing a repetitive task, but also you’ll be more likely to make mistakes when typing every single price.

That’s why being able to change prices in bulk will help you save time and make your life easier. If you run a limited promotion or offer a special discount on certain items, for example, you may need to edit the prices of several products. And once the sale or promotion is over, you will have to revert the prices to their original price.

Alternatively, if you want to either increase or decrease the prices of a certain category, type of product, or store-wide, you will need to update the prices of many products. And the more products your store has, the longer it will take.

As you can see, these are common situations for many stores, so it’s helpful to be able to edit the prices in bulk. Let’s see how to do that.

How to Change WooCommerce prices in Bulk

There are different ways to update WooCommerce prices in bulk:

  1. WooCommerce default options
  2. Using a plugin
  3. Exporting and then importing a CSV file
  4. Programmatically

Each method will be more appropriate for different situations. Let’s have a closer look at each of them.

1. WooCommerce Default Options

If your store contains only simple products and you want to update prices of multiple products, the WooCommerce default options got you covered. Keep in mind that the default options don’t support variable products, grouped products, or subscriptions. So if you only offer simple products in your store, this is a good option for you.

First, in your WordPress admin dashboard, navigate to Products > All Products. Select the products you want to edit either manually or by applying filters, select Edit from the Bulk Actions drop-down, and then click Apply.

How to Change WooCommerce Prices in Bulk - WC default

You will now see a product editing form. There you will be able to edit multiple features of the products such as brand, category, and so on. Since we are only interested in changing the price, go to the Product data section and find the Price and Sale options. Here, you can update the prices of your products at once.

Edit Product Prices in Bulk

The default options in WooCommerce to change products prices in bulk include:

  • Price – Increase or decrease the existing price by (fixed amount or percentage): You can increase or decrease the price of all the products by a fixed amount or percentage
  • Sale – Increase or decrease existing sale price by (fixed amount or percentage): Increase or decrease the current sale price by a fixed amount or percentage.
  • Sale – Set to regular price decreased by (fixed amount or percentage): You can set your sale price by reducing the current price by a fixed amount or percentage.

You can also apply these changes to a certain category, brand, or type of product by using the filters.

Once you are happy with the new prices, scroll down and click on the Update button to save the changes. That’s it! You have now successfully updated the prices of your WooCommerce products in bulk.

As mentioned earlier, the default options only work with simple products. So what can you do if you also offer variable or grouped products, subscriptions, and so on? One option is to rely on third-party plugins.

2. Using a third-party Plugin

There are several plugins to edit prices in bulk. For this tutorial, we will use ELEX WooCommerce Advanced Bulk Edit Products, Prices & Attributes. This is a freemium tool that offers multiple features for bulk editing products and is also easy to use.

However, it is important to note that the free version of the plugin only supports simple products. If you want to use it for other types of products, you’ll need to get one of the premium versions that start at 79 USD. With that said, let’s see how you can edit products in bulk using this plugin.

2.1) Install and Configure the Plugin

First, we’ll start by installing the plugin. In your WP Admin Dashboard, navigate to Plugins > Add New. Search for the ELEX WooCommerce Advanced Bulk Edit Products, Prices & Attributes plugin and click Install Now. Once the plugin is installed, activate it.

Install ELEX WooCommerce Product Bulk Edits Plugin

Then head to WooCommerce > Bulk Edit Products and you will find all the settings and features of this plugin.

Plugin Settings

2.2) Select the Desired Products

Now it’s time to filter the products you wish to edit. You can filter products by title, type, categories, and prices range. You can also filter products by attributes and there are two ways to combine them: Group with OR or Group with AND.

  • Group with OR lets you filter products by multiple attributes in such a way that the product is selected if it has at least one of the attributes.
  • Group with AND lets you filter products by multiple attributes in such a way that the product has to have all the chosen attributes to get selected.

How to Change WooCommerce Prices in Bulk - ELEX plugin

Once you have filtered the products, press the Preview Filtered Products button at the bottom-right corner and you will be taken to the preview page. Here you can have a look at the selected products and make sure that you’ve only selected the products you want to update.

Preview the Selection

After reviewing the selected products, scroll down and press Continue.

2.3) Update Product Prices in Bulk

On the edit products page, scroll down until you see the Price section. Here, you can now increase or decrease the product prices by a fixed amount or percentage or set a flat price for all of them. Similarly, you can increase or decrease the sale price by a fixed amount or percentage or set a flat price as well.

How to Change WooCommerce Prices in Bulk - ELEX plugin 2

After you have updated the product prices, scroll down and click Update Products to save the new prices. All the product prices will be updated, and you will see a success message on the next page.

Update the Changes

That’s it! You have successfully changed your WooCommerce product prices in bulk using a plugin. The process is similar regardless of the type of product you’re updating, so you will be able to edit the prices of your variable and grouped products in no time.

If you’re looking for more tools to edit prices in bulk, check out this list.

Besides the default options and third-party plugins, you can also update the prices using a CSV file. Let’s see how to do that.

3. Change WooCommerce Bulk Prices by Exporting and Importing CSV

For this method, first, you need to export all the product data to a CSV file. You will then edit this file and finally import it to WooCommerce that will update all the current products with the new changes. Let’s have a look at this process step-by-step.

3.1) Export Products Data to a CSV File

First, you need to export your product data. To do that, go to your WP Admin Dashboard and navigate to Products > All Products. Select the products you want to export and click the Export button at the top.

Export All WooCommerce Products

This will take you to the export products wizard. You can also select the type and category of product you want to export from here but we recommend doing that in the previous step. Make sure to check the “Yes, export all custom meta” box and press Generate CSV. This will generate a CSV file containing all the details about your products.

How to Change WooCommerce Prices in Bulk - Export Products to CSV File

For more information about this process, check out our guide on how to export products in WooCommerce.

3.2) Edit the CSV File to Update Prices

Open up the downloaded CSV file using any compatible software like Microsoft Excel and look for the sale price and regular price columns. These contain the current prices of each product. Simply edit the prices you want and then save the file. You can use formulas to apply a fixed or percentage discount to all the products, set the same price for items of the same category, and so on.

Edit CSV File to Update Prices in Bulk

3.3) Import the Updated CSV File

After that, you need to import the file back to WooCommerce. Once again, go to your WordPress Admin Dashboard, navigate to Products > All Products and click the Import button to start the import process.

 Import Products

Choose the CSV file that you just updated and make sure to check the “Update Existing Products” box. Otherwise, the existing products will be skipped instead of updated. Then press Continue.

Import Products from a CSV File

The import wizard will ask you to map CSV fields to products. Just leave everything as default, scroll all the way down and click Run the Importer. This will start importing data from the CSV.

How to Change WooCommerce Prices in Bulk - Import products Mapping

Once the process is complete, you will see a success message that says that the products were updated successfully.

Import Products Successful

That’s it! You can now go to your products page and verify the changes. That’s how easy it is to change WooCommerce prices in bulk by editing a CSV file. The process of exporting and then importing a file may seem troublesome but it’s extremely easy and fast.

For a more detailed explanation about importing files, check out our guide on how to import products in WooCommerce.

The next method to update WooCommerce prices in bulk is by using code snippets. Don’t worry if you’re not a developer! We will provide you with snippets that you can use on your site and explain the code. You don’t need coding skills but a basic understanding will definitely help.

4. Update Prices Programmatically

In this section, we’ll show you how to edit multiple prices at once programmatically. For that, we’ll use discounts that will be applied to the cart.

Normally, you would create a coupon code with a fixed or percentage and the customer would have to apply the coupon code during the checkout to enjoy the discount. However, with our code snippets, you can automate the process. Instead of the customer having to apply the coupon manually, the coupon will be applied automatically.

Before we have a look at the code, let’s see where and how you can add code snippets to your WordPress site.

Where and How to Add Code Snippets to Your WordPress Site

Let’s start with the basics. To edit WooCommerce prices in bulk, you’ll need to add the code snippets to the functions.php file of your current theme.

There are two ways of adding snippets to your sites.

  1. Using a child theme
  2. Using a plugin
1. Using a Child Theme

We recommend using a child theme if you want to make modifications to the functions.php file. If anything goes wrong while making changes directly to the functions.php file of the main theme, it can break your entire site. Additionally, the changes you make to the main theme will be overridden by the theme updates, so you will have to make these changes manually every time the theme receives an update.

Therefore, having a child theme is a recommended practice. If you don’t already have a child theme, you can create one or use any third-party child theme plugins that make the process a lot easier.

Once you have your child theme ready, let’s see how to edit the functions.php file. In your WP Admin Dashboard, go to Appearance > Theme Editor and make sure your child theme is selected. Then find the functions.php file on the right column and paste the code snippet at the end of the file.

Edit the Functions File

That’s it. This is how you add code snippets to your functions.php file using a child theme. However, if you are not comfortable creating a child theme and editing core files, you can use a plugin.

2. Using the Code Snippets Plugin

Alternatively, you can add snippets using a plugin. For this demonstration, we’ll use the Code Snippets plugin.

First, you need to install it, so go to Plugins > Add New. Search for the Code Snippets plugin and click Install Now. Once the installation is complete, activate it.

Code snippets plugin

After your plugin is activated, navigate to Snippets > Add New. Paste your code snippet in the code section and save the changes. You can also give it a label so that you can easily identify it in the future.

Add New Snippet

With Code Snippets, you don’t need to create a child theme because the plugin handles everything for you. However, we still recommend having one.

Now that you know how to add code snippets to your site, let’s have a look at the code snippets to change WooCommerce prices in bulk.

Edit WooCommerce Prices Programmatically

In this section, we’ll show you how to update prices using two different snippets. The first one will apply the coupon automatically to specific products and the second one will apply it to the overall cart regardless of the products it contains.

Before applying the discount, you need to create a coupon code.

Create a Coupon in WooCommerce

In your WP Admin Dashboard, go to Marketing > Coupons > Add Coupon.

Add Coupon

Select a name, type of discount, amount, and other details, and then press Publish to register your coupon. Write down the coupon code and leave it somewhere handy as you’ll need to add it to the code snippets.

Fill Coupon Details

Now let’s move on to the code snippets.

4.1) Apply Coupon Automatically to Specific Products

To apply the coupon to a specific product, you need to find the Product ID. Just go to your WooCommerce Products page, hover over the product you want to apply the discount to, and copy the Product ID.

Get WooCommerce Product ID

Now add the following code snippet to the functions.php file using your preferred method.

add_action( 'woocommerce_before_cart', 'quadlayers_coupon_individual_products' );

function quadlayers_coupon_individual_products () {

$coupon_code = 'quadlayers30'; //Use your coupon code between single quotes' '

if ( WC()->cart->has_discount( $coupon_code ) ) return;
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {

$autocoupon = array( 2970 ); //Use your product ID inside the array( id )

if ( in_array( $cart_item['product_id'], $autocoupon ) ) {
WC()->cart->apply_coupon( $coupon_code );
wc_print_notices();
}
}
}

Remember to use your coupon code and product ID in the code.

Now every time customers add this specific product to the cart, the coupon will be applied automatically.

Now let’s see how to apply the coupon and update the prices of several products at once.

4.2) Apply Coupon Automatically to the Cart

This snippet will apply a discount to the total amount of the cart, regardless of the products in it.

Simply add the following snippet to your site via your preferred method.

add_action( 'woocommerce_before_cart', 'quadlayers_coupon_overall_cart' );

function quadlayers_coupon_overall_cart () {

$coupon_code = 'quadlayers30'; //Use your coupon code between single quotes ' '

if ( WC()->cart->has_discount( $coupon_code ) ) return;
WC()->cart->apply_coupon( $coupon_code );
wc_print_notices();

}

That’s it! The coupon will now be automatically applied to the cart every time, irrespective of the contents of the cart. Once again, remember to use your own coupon code in the snippet.

Conclusion

All in all, there are several situations in which you may need to update the prices of multiple products at once. Doing this manually is time-consuming and can lead to mistakes, especially if you have many items. That’s why you should find a more efficient solution.

In this guide, we’ve shown you different methods to change the WooCommerce prices in bulk:

  • Using the default WooCommerce options
  • Using a third-party plugin
  • By exporting and then importing a CSV file
  • Updating prices programmatically

The default options get the job done but only let you edit the prices of single products. Alternatively, a dedicated plugin will also allow you to change the prices of any type of product in bulk but you may need to pay for it.

If you have a basic knowledge of spreadsheets, you can export your product data, update the prices and then import them back to your store. This is an excellent option and isn’t as complicated as it may seem. Finally, you can also change prices programmatically using code snippets that allow you to automatically apply discounts to certain products or the whole cart.

Have you ever tried editing your product prices in bulk? Which method did you use and how was your experience? Let us know in the comments section below.

If this article was useful, you may be interested in these guides: