Filter Orders by Product for WooCommerce
Filter Orders by Product for WooCommerce
Description
Have you ever wanted to filter your order page results by a specific product? With this plugin, now you can!
Once installed, a new filter dropdown will appear on the WooCommerce Orders screen, displaying a list of all products. Simply select a product and click the “Filter” button to view orders containing only that product.
This plugin supports filtering orders by:
- Product Name
- Product Category
Note: This plugin is compatible with both WooCommerce’s new HPOS (High-Performance Order Storage) and the legacy WordPress posts storage. Whether you’re using HPOS or the traditional storage method, this plugin will work seamlessly.
Installation
There are three different ways to install this plugin, as well as any other plugin from the WordPress.org repository.
Automatic Installation via WordPress Dashboard
- Log in to your WordPress admin dashboard.
- Navigate to
Plugins>Add New. - Search for “Filter Orders by Product for WooCommerce”.
- Click
Install Nownext to the plugin. - Once installed, click
Activate.
Manual Upload through WordPress Dashboard
- Download the “Filter Orders by Product for WooCommerce” plugin ZIP file.
- Log in to your WordPress admin dashboard.
- Navigate to
Plugins>Add New. - Click
Upload Plugin. - Click
Choose File, select the plugin ZIP file you downloaded, and clickInstall Now. - Once the installation is complete, click
Activate Plugin.
Installation via FTP
- Download the “Filter Orders by Product for WooCommerce” plugin ZIP file and extract it to your computer.
- Using an FTP client, connect to your web server.
- Navigate to
/wp-content/plugins/. - Upload the extracted plugin folder to the
/wp-content/plugins/directory on your server. - Log in to your WordPress admin dashboard.
- Navigate to
Plugins. - Locate “Filter Orders by Product for WooCommerce” in the list and click
Activate.
After the installation is complete, a new filter will appear on the WooCommerce Orders page.
Screenshots
Faq
Currently, this plugin only works for published products. To make it work for all product statuses (e.g., draft, private), add the following code to your theme’s functions.php file:
add_action( 'wfobp_product_status', 'filter_order_by_product_status' );
function filter_order_by_product_status(){
return 'any';
}
Reviews
Good improvement
By Artem Yanin (brainiacx) on November 16, 2024
Hi friend, thanks for your plugin! i tried to integrate search by SKU for woo, but then i found your plugin. I did small improvement to your code, so now we can search products by SKUs also, i would like that you will add it to your code, so we'll not lose it with next update:)
i did change in dropdown_fields() function
and replaced your query:
public function dropdown_fields() {
global $wpdb;
$status = apply_filters( 'wfobp_product_status', 'publish' );
$sql = "SELECT p.ID AS product_id, p.post_title AS product_title, pm.meta_value AS product_sku
FROM $wpdb->posts as p
LEFT JOIN $wpdb->postmeta as pm ON pm.post_id = p.ID
WHERE p.post_type = 'product'
AND pm.meta_key = '_sku'";
$sql .= ( $status == 'any' ) ? '' : " AND post_status = '$status'";
$all_posts = $wpdb->get_results( $sql, ARRAY_A );
$fields = array();
$fields[0] = esc_html__( 'All Products', 'woocommerce-filter-orders-by-product' );
foreach ( $all_posts as $all_post ) {
$fields[ $all_post['product_id'] ] = $all_post['product_title'] . '(' . $all_post['product_sku'] . ')';
}
return $fields;
}
You used select2 search for dropdown, so now we have sku in product name and we easily can search product by typing SKUs in search dropdown 🙂
Excellent plugin
By Knut Sparhell (knutsp) on May 22, 2024
This plugin does exactly what it says, and good. Very handy and simply a must have. I have made my own (private) plugin depend on this one. Can't live without it.
filter by product - completely useless
By volkerforster on January 7, 2024
Great and simple!
By toni12 on April 23, 2023
Thank you very much, great and simple plugin!
Handy, but needs one more thing...
By 4wdabcwebmaster on April 6, 2023
Four stars for now... add the ability to EXCLUDE one product or category, and it gets a fifth 🙂
Very nice plugin
By renisauria on April 2, 2021
Works perfectly and is very helpful
By creativexagency on December 18, 2020
Very helpful!
By yositsitsu on May 15, 2020
Perfect
By NightL on July 30, 2019
Works like a treat!
By hoobsiii on March 13, 2019
Changelog
4.1.2 – Sep 21, 2025
- Tweak: Plugin name updated
4.1 – May 20, 2024
- Tweak: Readme updated
4.0 – Dec 31, 2023
- Tweak: Added WooCommerce HPOS support
3.3 – Aug 20, 2023
- Fix: Resolved PHP notice caused by incorrect use of the
is_search()function
3.1
- Readme updated
3.0
- New: Now it’s possible to filter by Product Category
- Code refactored
2.0.7
- Fix: Products with same name only appeared once before
2.0.6
- Added hook for changing product status
2.0.5
- Fixed SQL injection bug
2.0.4
- Improved code
2.0.3
- Fix: Language
2.0.2
- Fixed translation bug (Thanks to Kasperta)
2.0.1
- Fixed a minor bug
2.0.0
- New: search dropdown
- Fixed a major bug
1.0.0
- Initial release

