WooCommerce is the world’s leading eCommerce platform. As of September 2021, it powers 93 % of WordPress eCommerce sites and 28 % of eCommerce sites worldwide.
Built by Woo, WooCommerce addresses many of the needs of business with its core product, but not every need.
That’s what makes WordPress themes like Astra and Astra Pro popular with millions of customers — they enhance WooCommerce both in terms of speed and functionality.
The ability to bulk edit product information is another area where WooCommerce needs a little help.
WP All Export allows you to export data from any WordPress or WooCommerce database table. Its sister product, WP All Import, allows you to bring data in, which on its own supports bulk updates.
Combine these two capabilities and you have the ability to bulk edit any data in the WooCommerce/WordPress system. That includes data stored by third-party plugins and themes like Astra.
What Is Bulk Editing and Why Do You Need It for WooCommerce Products?
Imagine a scenario where your online store is a reseller of products from hundreds of suppliers. Naturally, the data for those products is constantly changing, especially price and stock levels. New products may be added, while existing products may be dropped.
Manually updating your store with all these changes would be a nightmare, not to mention prone to errors.
WP All Import allows you to automate the entire process, including the automatic retrieval and processing of supplier files on a predefined schedule.
Set it up once for a supplier and it will keep your store synchronized with that supplier from that point on, completely hands-free!
Now imagine a scenario where you decide to make changes to hundreds or even thousands of existing products.
Using WooCommerce on its own, you would have to make these changes manually through the interface, one by one, which could take you hours or even days.
To significantly shorten this process, you simply:
- Export the relevant data to a spreadsheet using WP All Export.
- Modify that data in the spreadsheet, where you can apply formulas and copy and paste.
- Import the data using WP All Import.
That’s the example we’re going to show you first.
To follow along, use this convenient sandbox feature and select WooCommerce Store as the demo type.
You have decided to hold a sale by cutting the price of all products over $30 by 20%. To emphasize this fact, you would also like to temporarily change the product name to include an “ON SALE -” prefix.
Here is how you would do this with WP All Import and WP All Export:
Step 1 – Choose the Type of Data That You Want to Export:
Click All Export -> New Export in the WordPress navigation menu.
In the New Export screen, choose WooCommerce Products as the post type:
As you can see from this selection list, you can export any type of data from WordPress or WooCommerce, including data from third-party add-ons or plugins.
Step 2 – Apply Filters
As soon you choose a post type, an Add Filtering Options panel will appear below the post type section.
Expand this panel and create this simple filter:
Click the Add Rule button. When you do this, WP All Export will apply your filter to select only those products with a price greater than 30.
In our test database, there are 27 such products.
Step 3 – Select the Export Columns
Click the blue Customize Export File button near the bottom of the screen. This will call up the drag and drop interface. There is an Available Data section on the right-hand side of this interface.
Expand the Product Data panel and drag the Price and Sale Price fields into the column selection area.
Your screen should now look like this:
Step 4 – Complete the Export
Click the blue Continue button at the bottom of the screen, which will bring you to the Export Settings screen:
Click the green Confirm & Run Export button on the right-hand side. This will bring you to the Confirm & Run screen:
When the export finishes, click the blue CSV button in the Click to Download section in the lower half of the screen. This will download the export file.
Open the export file in your favorite spreadsheet.
Insert a column to the right of the Title column and enter this formula in the first data row of the new column (Row 2 in our spreadsheet): =”ON SALE – “&B2
Note, this is the formula for Microsoft Excel. It may differ for other spreadsheets.
When this formula is applied, it will create a value like “ON SALE – Red Mini Dog Tag from Jetpulse”.
Copy the formula to all the rows in your new column so that the affected area of your spreadsheet looks something like this:
Copy all the values from your new column into the old Title column, but paste them as values to get rid of the formula. Then delete your new column.
If your test data is like ours, the Price column will be Column K and the Sale Price column will be Column L. Also, the Sale Price column will be blank. Enter the following formula in the first data row (Row 2 in our spreadsheet) of the Sale Price column: =K2*0.8
When this formula is applied, it will calculate the Sale Price as 80% of the price.
Format the Sale Price column to 2 decimal places. The two columns should now look like this:
Save the spreadsheet.
Click All Export -> Manage Exports.
You should see your product export at the top of the list in the Manage Exports screen.
On the far right of your export row, under the Info & Options section, click Import with WP All Import. This will start the import process.
In the New Import screen, click Upload a file and select your modified product file. After your file uploads, your screen should look like this:
Click the Continue to Step 2 button. In fact, keep hitting the Continue button for all subsequent screens until you come to the Confirm & Run screen, where you simply click the green Confirm & Run Import button.
When the import is complete, you should get a confirmation like this:
If you now check the affected products in WooCommerce, you will find that any product with a Price > 30 now has a 20% discount applied to it and also has the “ON SALE – “ prefix added to its Title field (shown in the WooCommerce Products interface as “Name”):
In other words, you just saved yourself a lot of time and work, especially if this update had involved hundreds or even thousands of products!
But how did WP All Import know to automatically handle all of those import screens?
Because WP All Export and WP All Import are designed to work together. As long as your export file has the required information, WP All Import knows what to do with it.
Bulk Edit WooCommerce Products Using Supplier Updates
This is the scenario where your WooCommerce store contains products from different suppliers, and those suppliers periodically send you updates on things such as the available stock level and price.
For example, let’s say that you have a number of WooCommerce products with these existing inventory levels:
Then the supplier sends you this new product file: [WP Astra: file Supplier Inventory Update File.xml has been sent as an attachment ]
This is an XML file structured as follows:
Note that this file has a relatively simple structure containing a few product identification elements as well as the InventoryLevel element.
To make it easier to detect successful updates, we’ve also set the inventory levels to 50 for all four products.
Our goal is to use this file to update only the Stock field of our existing WooCommerce products.
To achieve this, we take the following steps:
Click All Export -> New Import in the WordPress navigation menu.
In the New Import screen, make the following selections:
- Click the Upload a file button.
- Select the supplier’s XML file.
- Click the Existing Items button.
- Choose WooCommerce Products as the update target.
Click the blue Continue to Step 2 button near the bottom. This will bring up the Review Import File screen. As you can see, WP All Import has correctly interpreted the supplier’s XML file:
Click the blue Continue to Step 3 button. This will bring up the Drag & Drop screen. However, this is really more of a screen for mapping the incoming fields to the corresponding WooCommerce fields.
Expand the WooCommerce Add-On panel. Note that WP All Import will automatically select the General tab in this panel.
Drag the SKU element from the XML record panel in the upper right into the SKU field of the General tab in the WooCommerce Add-On panel, as shown here:
Click the Inventory tab on the left side. In the Manage stock? section of this tab, click the Yes option. This will open two new edit boxes, one for Stock Qty and the other for Low stock threshold.
Drag the InventoryStatus element from the XML record panel into the Stock Qty edit box. The following image reflects these actions:
Click the blue Continue to Step 4 button. This will bring up the Import Settings screen.
In the “Records in your file will be matched with Products on your site based on…” section, click the Custom field option. This will open a Name/Value pair of fields.
The Name field should already contain an “_sku” value without the quotes. Drag the SKU element from the XML record panel into the Value field.
This screenshot reflects these actions:
In the “When WP All Import finds new or changed data…” section, uncheck the Create new products from records newly present in your file option.
In the same section, check the Choose which data to update option. This will open up a number of secondary options.
Click Unselect All.
Reselect Custom Fields. This will expand into a set of secondary options.
Click Update only these Custom Fields, leave the rest alone. This will open an edit box.
Start typing in this edit box. When you do this, a selection list will appear. Choose the _stock field from this list.
The “When WP All Import finds new or changed data…” section should now look like this:
Click the blue Continue button. This will bring you to the Confirm & Run screen.
Click the green Confirm & Run Import button. Because the import is small, it should only take a few seconds.
When the import is complete, navigate to Products -> All Products. You should now see that the Stock levels for the four updated products are set to 50.
Understanding the True Value of Bulk Editing Capabilities
To help you learn the concepts of bulk editing WooCommerce products, we have kept the examples in this article as simple as possible.
But as you may have already sensed by the large number of screens and panels that we bypassed, WP All Import is capable of far more complex import and update processes than we have described here.
With more than a decade of import experience behind it, WP All Import can handle pretty much every import task imaginable!
For more information, see Easily Bulk Edit WooCommerce Products.