How to Get WooCommerce Product Category Sales Reports (2 Easy Methods)

Product category sales report

How to Get WooCommerce Product Category Sales Reports (2 Easy Methods)

Tracking category performance is one of the smartest ways to understand customer buying behavior in your online store. A detailed WooCommerce product category sales report helps store managers identify top-performing categories, optimize inventory planning, improve marketing strategies, and increase profitability.

Whether you want to analyze category revenue, ordered quantities, discounts, or customer purchasing trends, WooCommerce offers different ways to generate category-based sales reports. In this guide, you’ll learn two practical methods to create WooCommerce sales reports by product category — using SQL queries or a professional reporting plugin.

If you need a faster and beginner-friendly solution, the REPORTiT – Advanced WooCommerce Reporting plugin makes it easy to generate advanced category reports, customize columns, filter results, and export reports in CSV, Excel, or PDF format without writing any code.

What is a sales report by product category?

Sales report by category provides comprehensive information about the orders placed in an online store related to one or more product categories separately. Generally, this report lists the product categories in a table. It reports other information like the number of orders, the number of products, the total sales amount, and others related to those categories in different table columns.

By analyzing the data of this report, you will be able to check information such as sales amount, sales quantity, sales price, and total sales amount, making it easier to manage to supply products and improve customer loyalty by identifying top-selling products.

Now let’s see how you can get WooCommerce product category sales reports with and without a plugin.

Get product category sales reports programmatically 

One of the easiest methods to generate sales reports by product category is running an SQL query in phpMyAdmin. The phpMyAdmin makes it easy to have access to the WordPress database and run queries to generate WooCommerce sales reports. 

In the following, you can find a PHP code to get product category sales report programmatically in WooCommerce.

SELECT IF ( (woocommerce_order_itemmeta.meta_key = '_fee_amount'), 1, 0) AS fee, DATE_FORMAT(it_posts.post_date,'%m/%d/%Y') AS order_date, it_woocommerce_order_items.order_id AS order_id, it_woocommerce_order_items.order_item_name AS product_name, it_woocommerce_order_items.order_item_id AS order_item_id, woocommerce_order_itemmeta.meta_value AS woocommerce_order_itemmeta_meta_value, (it_woocommerce_order_itemmeta2.meta_value/it_woocommerce_order_itemmeta3.meta_value) AS sold_rate, IF ( (woocommerce_order_itemmeta.meta_key = '_fee_amount'), woocommerce_order_itemmeta.meta_value , (it_woocommerce_order_itemmeta4.meta_value/it_woocommerce_order_itemmeta3.meta_value))AS product_rate, IF ( (woocommerce_order_itemmeta.meta_key = '_fee_amount'), woocommerce_order_itemmeta.meta_value , (it_woocommerce_order_itemmeta4.meta_value))AS item_amount, (it_woocommerce_order_itemmeta2.meta_value) AS item_net_amount, (it_woocommerce_order_itemmeta4.meta_value - it_woocommerce_order_itemmeta2.meta_value) AS item_discount, it_woocommerce_order_itemmeta2.meta_value AS total_price, count(it_woocommerce_order_items.order_item_id) AS product_quentity, woocommerce_order_itemmeta.meta_value AS product_id, woocommerce_order_itemmeta_var.meta_value AS variation_id ,it_woocommerce_order_itemmeta3.meta_value AS 'product_quantity' ,it_posts.post_status AS post_status ,it_posts.post_status AS order_status FROM gbQDaFZ_12_woocommerce_order_items as it_woocommerce_order_items LEFT JOIN gbQDaFZ_12_posts as it_posts ON it_posts.ID=it_woocommerce_order_items.order_id LEFT JOIN gbQDaFZ_12_woocommerce_order_itemmeta as woocommerce_order_itemmeta ON woocommerce_order_itemmeta.order_item_id = it_woocommerce_order_items.order_item_id LEFT JOIN gbQDaFZ_12_woocommerce_order_itemmeta as woocommerce_order_itemmeta_var ON woocommerce_order_itemmeta_var.order_item_id = it_woocommerce_order_items.order_item_id LEFT JOIN gbQDaFZ_12_woocommerce_order_itemmeta as it_woocommerce_order_itemmeta2 ON it_woocommerce_order_itemmeta2.order_item_id = it_woocommerce_order_items.order_item_id LEFT JOIN gbQDaFZ_12_woocommerce_order_itemmeta as it_woocommerce_order_itemmeta3 ON it_woocommerce_order_itemmeta3.order_item_id = it_woocommerce_order_items.order_item_id LEFT JOIN gbQDaFZ_12_woocommerce_order_itemmeta as it_woocommerce_order_itemmeta4 ON it_woocommerce_order_itemmeta4.order_item_id = it_woocommerce_order_items.order_item_id AND it_woocommerce_order_itemmeta4.meta_key='_line_subtotal' LEFT JOIN gbQDaFZ_12_term_relationships as it_term_relationships ON it_term_relationships.object_id = woocommerce_order_itemmeta.meta_value LEFT JOIN gbQDaFZ_12_term_taxonomy as term_taxonomy ON term_taxonomy.term_taxonomy_id = it_term_relationships.term_taxonomy_id Where ((woocommerce_order_itemmeta.meta_key = '_product_id' AND it_woocommerce_order_itemmeta3.meta_key='_qty') OR (woocommerce_order_itemmeta.meta_key = '_fee_amount')) AND woocommerce_order_itemmeta_var.meta_key = '_variation_id' AND it_woocommerce_order_itemmeta2.meta_key='_line_total' AND DATE(it_posts.post_date) BETWEEN STR_TO_DATE('2023-02-01', '%Y-%m-%d') and STR_TO_DATE('2024-02-14', '%Y-%m-%d') AND term_taxonomy.taxonomy LIKE('product_cat') AND term_taxonomy.term_id IN (33,25) AND it_posts.post_status IN ('wc-processing','wc-on-hold','wc-completed') AND it_posts.post_parent = '' GROUP BY it_woocommerce_order_items.order_item_id ORDER BY order_id DESC

To customize this code and instruct it to show the information you need related to specific categories, you can easily replace the Category IDs in the line illustrated below:

PHP code in product category sales report programmatically in WooCommerce
SQL query

Then, after running the query, you will see a report listing the following information in different columns of the table:

  • Order Date
  • Order ID
  • Product Name
  • Order item ID
  • Sold Rate
  • Product Rate
  • Item Amount
  • Item Net Amount
  • Item Discount
  • Total Price
  • Product Quantity
result PHP code in product category sales report programmatically in WooCommerce
Result of query

How to run SQL code in PHPmyadmin?

You need to run this SQL query with phpMyAdmin by following the below instructions:

  • Log in to phpMyAdmin to access the database. 
  • Click on the database name of your WordPress website in the left column.
  • Select the SQL tab on the top of the screen.
  • Look for the database name again above the text field, and confirm this is the correct database you intend to run a query on.
run SQL code in PHPmyadmin
How to run SQL code
  • Write or paste the query in the text field.
  • Press the GO button.
  • Some queries will require a second confirmation to run.

Caution: If running SQL queries, you may change or add data to your database. So, it makes sense to back up your WordPress database before running the code.

If you have no experience in working with PHPMyAdmin, please ask an expert to do this task and run the SQL query or use the WooCommerce report plugin instead. This plugin helps you to generate any type of sales report without coding. 

Use the WooCommerce report plugin to get sales report by product category 

The WooCommerce report plugin is a great tool for generating more than 50 WooCommerce sales reports quickly and easily. It has some default options for creating different sales report with one click and provides a lot of useful features for filtering, customizing and even exporting the generated reports.

We prepared a step-by-step guide to show you how easy is to get a WooCommerce sale report by product category with this plugin.

Step 1: Install WooCommerce report plugin

Like other WooCommerce plugins, you need to download and install the .Zip file of the WooCommerce report plugin on your WordPress website. 

You can find a comprehensive guide about installation and activation of the plugin, here.

REPORTiT - Advanced WooCommerce Reporting plugin by ithemeland

After activation, the iT Woo Report menu will be added to your WordPress dashboard which leads you to the main page of the WooCommerce report plugin.

select  iT Woo Report section in WordPress dashboard
Open REPORTiT plugin

Step 2: Get WooCommerce product category sales report

On the main page of the plugin, you have access to the preset reports in the left panel. To get the category sales report WooCommerce, you need to navigate to the below address: 

Orders > All orders

select all orders section in order menu
Open all orders report

On the “All Orders” page, there is a Search icon designed to let you open the Filter Form and use it for filtering the report based on your needs.

To get a purchase report by product category, first, you need to set a date range in the Date From and Date To fields.

Then, locate the Category field and select one or more categories from the list to receive the reports related to them:

set orders date range in filter form
Filter report

For example, to generate WooCommerce product category sales report for Accessories in the last year, we set the fields in the Filter Form as below:

  • Date From: 2023-02-01
  • Date To: 2024-02-01
  • Category: Accessories
select Accessories category in filter form
Fitler by category

By pressing the Search button, the plugin will create the report like the below:

result orders report in Report Plugin
Result of created orders report

In the category sales report WooCommerce, you can find all the information you need in the separate columns of the table, including:

  • Order ID, Order Status, Order Date
  • Name, Last Name, Email, Customer, Phone No.
  • Sate, Country
  • Payment Method
  • Category, Products, Variation
  • Ordered Quantity
  • Product Amount, Product Discount, Net Amount, Shipping Amount
  • Invoice Action
  • SKU
  • Rate
  • Coupon Code

You can also review a Summary report displaying the Total Order Count, Total Product Count, Total Quantity, Product Amount, Discount Amount, and Net Amount of the Category you have filtered in the Search form.

result Summary report in Search form
Summary report

Extra features of sales report by product category

The wooCommerce report plugin comes with extra features enabling you to search, customize, or export the report very fast and smoothly.

Continue reading to get familiar with these amazing features in the WooCommerce sale report by product category.

Customize the table columns of the purchase report by product category

One of the advantages of the WooCommerce report plugin is the ability to customize the columns of the table report. After generating a category sales report WooCommerce, you can open the dropdown list of Select Columns designed above the table and mark the columns you need.

Customize table columns of purchase report by product category
Customize columns to display

For example, we marked some columns as illustrated in the above picture and the result looks like below:

result Customize table columns of purchase report by product category
Report table

Export sales report by product category

If you want to export WooCommerce sale report by product category, you can simply click on the Download icon on top of the table and choose one of the file formats including:

  • Excel
  • CSV
  • PDF
Export sales report by product category
Export your report

It is also possible to have a hard copy of the report by selecting the Print option in the list.

Search in the purchase report by product category

To help store managers review their preferred information in the WooCommerce product category sales report, we designed a Search box on the top of the table. You can search any value like User name, Email, Order ID, Country, etc. to see the related report in the table.

For example, if you want to see which categories have been ordered by Horton, type Horton in the Search box:

Search in the purchase report by product category
Search box

So, the Plugin will filter the report and show the related information in the table as illustrated above.

REPORTiT - Advanced WooCommerce Reporting plugin by ithemeland

Why do store managers need sales reports by category?

Store managers generate sales reports by product category to:

  • Analyze which product categories had the most sales in a date range.
  • Have an insight into the most favorable categories in their online store.
  • Plan marketing strategies and promotions for the categories with less customer attention to boost their sales.
  • Predict which product categories need to be supplied more in the future.

Conclusion

Generating a WooCommerce product category sales report gives store managers valuable insights into which categories drive the most revenue, attract loyal customers, and need more inventory or marketing attention. While SQL queries can help advanced users extract category sales data directly from the database, they often require technical knowledge and manual customization.

For a more flexible and user-friendly solution, REPORTiT – Advanced WooCommerce Reporting provides powerful filtering, export options, customizable report tables, and ready-made WooCommerce sales reports in just a few clicks. Whether you manage a small WooCommerce store or a large online business, using the right reporting tool can help you make smarter business decisions and improve your overall sales performance.

FAQ

How can I generate a WooCommerce product category sales report?

You can generate a WooCommerce product category sales report either by running SQL queries in phpMyAdmin or by using a reporting plugin like the REPORTiT plugin. The plugin method is much easier because it does not require coding skills.

Does WooCommerce have a built-in category sales report?

WooCommerce includes basic analytics, but it does not provide advanced category-based reporting with flexible filters, export options, or customizable columns. That’s why many store owners use dedicated WooCommerce reporting plugins.

Can I export WooCommerce category sales reports to Excel or CSV?

Yes. With the REPORTiT plugin, you can export WooCommerce category sales reports to Excel, CSV, or PDF files for further analysis or sharing with your team.

Why are product category sales reports important in WooCommerce?

WooCommerce category sales reports help store managers identify top-selling categories, track sales performance, forecast inventory needs, analyze customer behavior, and improve marketing campaigns based on real sales data.

Is it possible to filter WooCommerce sales reports by category and date?

Yes. Using a WooCommerce reporting plugin, you can easily filter reports by specific categories, date ranges, order status, products, customers, and many other conditions to generate accurate sales insights.

What is the easiest way to create advanced WooCommerce sales reports?

The easiest method is using a plugin like the REPORTiT plugin because it provides ready-made reports, advanced filtering, export tools, and customizable tables without requiring technical knowledge.

Related Articles

You might also be interested in these articles

Reader Comments

Join the conversation and share your thoughts

Leave a Reply

Start Your Journey

Sign in / Sign up account to continue