How to Calculate Cost of Goods Sold (COGS) in WooCommerce
Quick answer: COGS is the direct cost of the products you sold: beginning inventory plus purchases, minus ending inventory, or simply each product’s unit cost times the units sold. WooCommerce doesn’t store product costs, so add them with Cost of Goods for WooCommerce, one by one or in bulk, and it calculates COGS and profit in its reports.
Is your store making a profit? Or what is the profit percentage? Is it higher than your costs or not?
To give me an answer to all these questions, you must definitely calculate what is called the Cost of Goods Sold to determine the profit. So, what is the Cost of Goods Sold (COGS)?
The Cost of Goods Sold represents the direct costs of producing goods sold by your store, including materials, labor, shipping costs, and overhead costs. When you are calculating the cost of goods sold, you can determine whether your eCommerce store is making a profit or not.
But we all know that calculating the cost of goods sold manually takes a lot of time and requires a high level of accuracy; that’s why the WooCommerce Cost of Goods: Product Cost & Profit Calculator plugin exists, which makes the process easier and more efficient.
Why Cost of Goods Sold is an Important Metric to Track?
To simply answer, if you don’t know your costs, then you will never know if you’re making money or losing money.
Your expenses could easily go higher than your profits, and if you’re not tracking your expenses, you will never know.
So the cost of goods sold is a metric that indicates the health and profitability of your business, and without it, it would be impossible to know how good or bad you’re doing in the business field.
The cost of goods sold has an inverse correlation with your profits because COGS represents the direct costs associated with the production of goods or the acquisition of inventory that a company sells. As COGS increases, the gross profit (which is calculated as revenue minus COGS) decreases.
For example:
If you’re selling a pencil in your store for $10 and you acquired it (COGS) for $8, then your profit is $2. But if your supplier raises the price to $9 and your competitors are still selling it for $10, then your cost of goods has increased by $1, and your profit has decreased to $1.
It’s an important metric to track because it has a direct impact on your profits and how much money you can make out of your business, so you will always need to keep this metric in mind.
How to Calculate Cost of Goods Sold
The formula for calculating the cost of goods sold is simple and easy:
Cost of Goods Sold = Beginning Inventory + Purchased Inventory – Ending Inventory
Let’s say you want to calculate the cost of goods sold for your clothing store for Q4. Assume you have stock from Q3 that’s worth $20,000 and you bought additional stock for the holiday season that’s worth $15,000. At the end of Q4, you have a remaining inventory of $5,000.
That is:
Beginning Inventory: $20,000
Purchased Inventory: $15,000
Ending Inventory: $5,000
Cost of Goods Sold = $20,000 + $15,000 – $5,000 = $30,000. Now, of course, you could use pen and paper as you wish, but in the age of technology where sales operations are done in milliseconds and tons of operations are done in one second, it’s going to be hard to track this by hand.
Using a plugin such as WPFactory’s Cost of Goods Sold Calculator will make your life way easier when it comes to calculating COGS.
Here’s how you can calculate COGS) using the appropriate plugin
Step1:
-
Download The Plugin
Download the “WooCommerce Cost of Goods: Product Cost & Profit Calculator” plugin from your WPFactory account, and upload it to your WordPress site.

Step2:
-
Access The Plugin
As the plugin is installed, you can customize it for your business requirements.
Go to WooCommerce > Settings > Cost of Goods Sold.

Here, you can:
- Enter default cost for products.
- Configure how costs should be calculated for variable products.
- Enable automatic COGS tracking for orders.
Step3:
-
Assign Cost to Products
Go to the product page, you can add costs for each product individually or for the bulk products.
-
Edit Individual Product Costs
From here, as shown in the image below, you can add costs for a single product by going to the product page > Product data section > General > Cost

Here, you can input the Regular price, Sale price, and product cost, and then the profit will be automatically calculated and displayed.

-
Edit Bulk Product Costs
If you sell multiple products, this plugin makes it easy for you to add the costs of these products via the Bulk Edit Cost option
Go to your WordPress dashboard > navigate to Tools > Bulk Edit Cost

As shown in the image below, this page allows you to edit the cost, price, and stock of all your products in your store, making it easier and faster to manage these details from a single page.

Step4:
-
Access the Plugin Setting
There are general settings related to the plugin that you can customize by going to Plugin setting > General product options
The first option expresses profit HTML template, which means customizing the template that will display the profit in the interface. For example, the %profit% option shows you the profit amount, and the %profit_percent% shows the profit percentage, while %profit_margin% is used for the profit margin.
So, you can display the profit in the way that suits you.

Step5:
-
Get Price method
This option helps you determine how the product price will be calculated, either:
- Calculating the price including tax.
- Calculating the price excluding tax.

Step6:
-
Cost Field Options
With the Cost Field Label option, you can customize the label on the cost field that appears in the control panel
You can also control where the cost field appears on the product page, for example, you can show it on the products editing page under the general section under prices.

Step7:
-
Admin Products List Columns
This section allows you to add custom columns that appear in the product list. You can add columns that show:
- Product Cost: which shows you the cost of each product in the product list.
- Product Profit: Which shows the amount of profit for each product based on the cost and price.

This is a good way because it gives you a quick overview at the costs and profits of tour products in one look and from one place, allowing you to easily compare products with each other and see which one is more profitable.

Step8:
-
Add Stock
This feature enables you to update the product’s cost and stock by adding a meta box to the product edit page. It helps you to calculate the new average cost of products when adding new inventory.


Step9:
-
Admin Orders List Columns
From the Order tab, you can add order cost and order profit columns, which will appear on the order page.

-
Admin Order Edit
This option will make it easier for you to edit costs from the order edit page

Step10:
-
Refunds
This section allows you to control how the refund affects the cost of the product and profits, simply, enabling one of these options:
- Ignore refunded item cost
- Ignore item refund amount
The refunds will not affect profit or cost calculations. Hence, if you want to ignore the refunds in the profit and cost calculation, activating these two options will suffice.
You can also determine the method of calculating profits through the three existing methods:
- Use default profit calculation mechanism
- Subtract total refunded from profit
- Calculate profit by the difference between Net Payment and Cost

Step11:
-
Extra Payment Gateway Cost
From the Payment Gateways tab, you can add extra costs to orders according to the payment gateways used.

Step12:
-
Extra Shipping Method Costs
And the same thing here, by enabling this section you can add extra costs for your orders based on order’s shipping method

Step13:
-
Multicurrency
If you deal with multiple currencies in your store, this may change the cost of the product from one currency to another. Through this section, you can add the currencies you deal with to be tracked by the plugin and calculate their costs.

Step14:
-
Reports
The final step is “Reports”, this plugin provides you with many reports, which provide you with reports on the product sold, the profit percentage, and costs for each period.
You can access it by navigating to WooCommerce > Reports > Cost of Goods.

Also from here, you can get reports related to your stock.

Final Words
As we always say: correct numbers = correct analysis, which means clarity. While accurate numbers and correct analysis don’t necessarily guarantee profit, they are essential for understanding your business’s financial health and making informed decisions.
So, calculating the cost of goods sold accurately is a fundamental step toward achieving this clarity. It allows you to track your costs, and identify areas for improvement to make your profits.
Prefer watching? This short video summarizes the article in just a few minutes.
