Home › Guides › How to search WooCommerce orders by custom fields, SKU and order notes

How to search WooCommerce orders by custom fields, SKU and order notes

Part of our WooCommerce add-ons.

Short answer

You can’t search WooCommerce orders by custom fields out of the box. Type a PO number, a gift message or a delivery date and it comes back empty, because order meta isn’t searched by default. A developer can add a meta key with a filter. Order Search Pro for WooCommerce lets you tick the key and rebuild its index instead.

Key points

  • On HPOS, core search covers the order ID, transaction ID, billing email, the customer’s name, address and phone, and product names on the order. Custom fields, SKUs and order notes are not in it.
  • On our test store, order #13 carried _po_number = PO48213. WooCommerce 11.2.1 found nothing for PO48213.
  • Code can add a meta key on both storage types. On HPOS the filter has limits worth knowing, covered below.
  • Order Search Pro searches SKUs and notes out of the box, and any custom field once you tick it and rebuild the index. It never picks custom fields on its own.

Can WooCommerce search orders by custom field?

No, not by default. WooCommerce’s order search reads a fixed list of places, and your custom fields aren’t on it. A custom field on an order is a meta key and value, such as _po_number with the value PO48213. Core search never looks at those unless code adds the key.

Core search also skips order notes and SKUs. Order Search Pro searches both from one bar, next to the phone numbers, order numbers and transaction IDs core search already finds; coupon codes have their own filter. If a search snippet stopped working after your store moved to HPOS, our guide on what HPOS changed in WooCommerce order search explains why.

We checked this on 12 Oct 2026 on our lab store (WordPress 7.1.2, WooCommerce 11.2.1, HPOS on). Order #13 had _po_number set to PO48213. Searching PO48213 on WooCommerce » Orders returned “No items found”. So did a search for the SKU TOTE-LIN-01.

WooCommerce Orders screen on our lab, search box holding PO48213, and the table showing No items found.
WooCommerce 11.2.1 on our lab, with no add-on: PO48213 is on order #13 as _po_number, and the search finds nothing.

Less than staff expect. These lists come from the WooCommerce 11.2.1 search code.

On HPOS stores (orders in their own tables), the All option runs these lookups, in OrdersTableSearchQuery.php:

  • the order ID, when the search is a number,
  • the payment transaction ID,
  • the billing email,
  • customers: the billing and shipping address index, which holds the name, address, email and phone,
  • product names on the order’s line items.

On legacy storage (orders as posts), search_orders() in class-wc-order-data-store-cpt.php looks at the billing and shipping address index, billing last name, billing email, billing phone, the order ID and the product names on the line items.

Neither checks SKUs, order notes or any other custom field. Product search matches the line item’s name, not the product’s _sku. Order notes live in the comments table as order_note comments, outside the order data, so the order search never sees them.

What does the dropdown do on HPOS stores?

It narrows the search, never widens it. HPOS adds All, Order ID, Customer Email, Customers and Products next to the box, and picking one runs that lookup alone. Order ID only filters numeric searches. WooCommerce’s issue tracker has the background: Improve Order Search Performance When HPOS is Enabled, opened March 2024 and closed April 2024. Our guide on how HPOS changed WooCommerce order search covers the move in more detail.

How do you search order meta with code (HPOS and legacy)?

Add the meta key to the list core search already reads. Each storage type has its own filter, so a store that might switch should add both. We checked these hook names in the WooCommerce 11.2.1 source on 12 Oct 2026, and our developer ran each snippet on the lab store, where all of them worked.

// Legacy (posts) storage. Core reads this list of order meta keys.
add_filter( 'woocommerce_shop_order_search_fields', function ( $fields ) {
	$fields[] = '_po_number';
	return $fields;
} );

// HPOS storage. Same idea, different filter (since WooCommerce 7.0).
add_filter( 'woocommerce_order_table_search_query_meta_keys', function ( $keys ) {
	$keys[] = '_po_number';
	return $keys;
} );

The HPOS filter has two catches, found in the source and confirmed on our lab. It only runs inside the Customers lookup, so it works under All or Customers and nowhere else. And if you have switched on HPOS full text search indexes, WooCommerce searches the address table instead and skips this meta list entirely.

For a dropdown option of its own, WooCommerce 8.9 added two filters. woocommerce_hpos_admin_search_filters adds the option. woocommerce_hpos_generate_where_for_search_filter supplies the SQL it runs.

add_filter( 'woocommerce_hpos_admin_search_filters', function ( $options ) {
	$options['po_number'] = 'PO number';
	return $options;
} );

add_filter( 'woocommerce_hpos_generate_where_for_search_filter', function ( $where, $term, $filter, $query ) {
	if ( 'po_number' !== $filter ) {
		return $where;
	}
	global $wpdb;
	$orders = $query->get_table_name( 'orders' );
	$meta   = $query->get_table_name( 'meta' );
	return $wpdb->prepare(
		"`$orders`.id IN ( SELECT order_id FROM $meta WHERE meta_key = %s AND meta_value LIKE %s )",
		'_po_number',
		'%' . $wpdb->esc_like( $term ) . '%'
	);
}, 10, 4 );

A custom option only runs when someone picks it. The All search runs WooCommerce’s five core lookups and nothing else.

Each of these is an unindexed LIKE '%term%' scan over meta values. Fine on a few hundred orders; test on a copy before trusting it on tens of thousands.

How do you make checkout, ACF and plugin fields searchable?

Find the meta key first, then add it with the filter above or tick it in Order Search Pro. The key depends on what saved the field.

  • Block checkout fields. Fields registered with WooCommerce’s additional checkout fields API need an ID in namespace/name form. WooCommerce saves contact and order fields as _wc_other/ plus that ID, and address fields as _wc_billing/ or _wc_shipping/ plus the ID.
  • ACF fields on orders. ACF saves a value under the field’s name. A Group field saves each sub field as group_subfield, per ACF’s Group field docs. Checkbox and multi-select values are saved as arrays.
  • Plugin meta. Delivery date, gift message and PO number plugins each pick their own key. The plugin’s docs or your developer can tell you. On HPOS the values sit in the wc_orders_meta table, on legacy storage in postmeta.

Two limits apply in Order Search Pro. It only indexes plain text or number values that aren’t empty, so an ACF checkbox (an array) won’t be searchable. And it hides keys that start with WooCommerce’s own prefixes, such as _billing_ and _shipping_, from the tick list. If a checkout plugin saves its field under one of those, type the key into the manual box.

How do you search by SKU and by order note text?

Not with core search, and not with a one-line filter either. An SKU lives on the product, so code has to find product IDs by SKU, then the orders whose line items point at them. Order notes are comments, so code has to query comment_content for order_note comments and feed the order IDs back through woocommerce_shop_order_search_results (legacy) or a custom HPOS dropdown option.

Order Search Pro indexes both with no setup. SKUs come from each line item’s product, including variations. Notes include customer notes and private notes.

There’s one catch with SKUs. The index reads the SKU from the product when it indexes the order. If the product has been deleted, the order has no SKU to index.

If you’d rather not maintain that code, this is the fix we sell: Order Search Pro, which indexes SKUs and notes with no code to keep up.

How do you search custom fields with Order Search Pro?

Tick the key, save, then rebuild the index. Skip the rebuild and orders you already have stay unsearchable by that field until each is re-saved or gets a note, or you rebuild.

  1. Go to WooCommerce » Order Search Pro and open the Searchable Fields tab.
  2. Tick the meta key. The list comes from the keys on your last 50 orders, minus WooCommerce’s own internal keys. Nothing is ticked by default.
  3. If the key isn’t listed, type it under Add custom meta key(s), one per line.
  4. Click Save searchable fields.
  5. In the Search index card below, click Rebuild search index. It runs in batches through WP-Cron, so it needs site traffic or a real cron job to move.
Order Search Pro Searchable Fields tab on our lab, with the meta key _po_number ticked, the Add custom meta key(s) box below it and the Save searchable fields button.
The Searchable Fields tab in Order Search Pro 1.2.4 on our lab. _po_number was the only custom key on the last 50 orders, so it was the only row.

On our lab, the order matters. Before we ticked _po_number, PO48213 found nothing. After ticking it but before the rebuild, it still found nothing. After the rebuild, it returned order #13 alone, with “matched a custom field” in the Matched in column.

WooCommerce Orders screen on our lab with Order Search Pro active: a search for PO48213 returns order #13 for Demo Customer, Matched in says matched a custom field.
The same search with Order Search Pro 1.2.4 after ticking _po_number and rebuilding the index: one result, order #13, and the Matched in column says why.

What the search box covers in version 1.2.4: customer name and email, billing and shipping address, product names (including variations), SKUs, order notes, order tags and the custom keys you ticked. It matches the start of words, so PO482 finds PO48213 but 48213 does not.

Order numbers, transaction IDs and phone numbers still work. Order Search Pro replaces WooCommerce’s search rather than adding to it, so since version 1.2.2 it runs those three lookups itself. Type an order number or a full transaction ID as one word. A transaction ID search needs at least 4 characters and must include a digit. A phone number needs 6 to 15 digits and matches on the end of the number, with or without the country code.

What it won’t do. The text search doesn’t match coupon codes, which have their own filter instead. A hyphenated SKU such as TOTE-LIN-01 is split at the hyphens, so check the Matched in column if other orders share a part.

Order Search Pro supports HPOS and legacy storage in its code. We have tested it on HPOS only.

Yes. Order Search Pro adds filters above the orders list that stack with the search and with each other: payment method, shipping method, billing country, customer group (guests included), order total range, coupon code, tag and date range. Any search plus its filters can be saved with Save this search and shared with the team.

Why can’t you find old orders after renaming a product?

Because each order keeps the product name it had when it was bought. WooCommerce stores the line item name on the order, and both core search and Order Search Pro search that stored name, so after you rename “Zip Hoodie” to “Classic Zip Hoodie”, last spring’s orders only answer to the old name. Search by SKU instead, and keep SKUs stable: Order Search Pro reads the SKU from the product at index time, so after a rebuild an old order is found under the product’s current SKU.

Code or Order Search Pro: which should you pick?

Code (core filters)Order Search Pro
One custom field, small storeFine, one filter per storage typeWorks, but more than you need
SKUs and order notesCustom SQL to write and maintainIndexed with no setup
Several plugin or checkout fieldsOne key per line of codeTick each key, rebuild
Large order tablesUnindexed LIKE scansIts own full text index
Order number, phone and transaction ID searchKept, core already does all threeKept, it runs all three lookups itself
CostDeveloper time$59 a year, one site

Pick code for one field, a developer and a small store. Pick Order Search Pro if staff search by SKU, note or several custom fields every day. For other plugins, see our comparison of WooCommerce order search plugins. Test either route on a copy of your store with real orders.

FAQ

Can WooCommerce search order notes?

No. Notes are stored as comments, outside the order data, and the order search never reads them. Order Search Pro indexes customer and private notes.

Does Order Search Pro search custom fields automatically?

No. Nothing is ticked by default. You pick each meta key, then run Rebuild search index for the orders you already have.

Why does my filter work on one store and not another?

Check the storage type. woocommerce_shop_order_search_fields only runs on legacy storage, and woocommerce_order_table_search_query_meta_keys only on HPOS.

Can I search by phone number?

Yes. WooCommerce’s own search does, on both HPOS and legacy storage. Order Search Pro does too: phone search came back in version 1.2.2, matching on the end of the number arrived in 1.2.3, and the 6 to 15 digit rule in 1.2.4. Type 6 to 15 digits and it matches the end of the stored number, with or without the country code.

Sources

  • WooCommerce 11.2.1 source, src/Internal/DataStores/Orders/OrdersTableSearchQuery.php (core lookups, woocommerce_order_table_search_query_meta_keys since 7.0.0, woocommerce_hpos_generate_where_for_search_filter since 8.9.0): https://github.com/woocommerce/woocommerce/blob/11.2.1/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableSearchQuery.php (read 12 Oct 2026).
  • WooCommerce 11.2.1 source, src/Internal/Admin/Orders/ListTable.php (dropdown options, woocommerce_hpos_admin_search_filters since 8.9.0): https://github.com/woocommerce/woocommerce/blob/11.2.1/plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php (read 12 Oct 2026).
  • WooCommerce 11.2.1 source, includes/data-stores/class-wc-order-data-store-cpt.php, search_orders() (woocommerce_shop_order_search_fields, woocommerce_shop_order_search_results): https://github.com/woocommerce/woocommerce/blob/11.2.1/plugins/woocommerce/includes/data-stores/class-wc-order-data-store-cpt.php (read 12 Oct 2026).
  • WooCommerce 11.2.1 source, includes/class-wc-order.php, add_order_note() (notes saved as order_note comments): https://github.com/woocommerce/woocommerce/blob/11.2.1/plugins/woocommerce/includes/class-wc-order.php (read 12 Oct 2026).
  • WooCommerce 11.2.1 source, src/Blocks/Domain/Services/CheckoutFields.php (_wc_other/, _wc_billing/, _wc_shipping/ prefixes, namespace/name IDs): https://github.com/woocommerce/woocommerce/blob/11.2.1/plugins/woocommerce/src/Blocks/Domain/Services/CheckoutFields.php (read 12 Oct 2026).
  • WooCommerce issue 45721, Improve Order Search Performance When HPOS is Enabled: https://github.com/woocommerce/woocommerce/issues/45721 (opened 19 Mar 2024, closed 26 Apr 2024, read 12 Oct 2026).
  • ACF docs, Group field: https://www.advancedcustomfields.com/resources/group/ and update_field() (checkbox values as arrays): https://www.advancedcustomfields.com/resources/update_field/ (read 12 Oct 2026).
  • Order Search Pro for WooCommerce 1.2.4 code (indexer, search query including find_identifier_order_ids(), Searchable Fields settings, changelog for 1.2.2 to 1.2.4, read 12 Oct 2026) and lab test on WordPress 7.1.2, WooCommerce 11.2.1, HPOS on (12 Oct 2026).
  • Order Search Pro product page: https://pluginsprout.com/downloads/wc-order-search-pro/ (read 12 Oct 2026).

Need to search orders by a field we haven’t covered?

Tell us the field and how it gets onto the order, and we’ll tell you whether a tick or a filter fits: ask about your order search. Or go straight to Order Search Pro, with a 14-day money-back guarantee.

Order Search Pro for WooCommerce. One fast, indexed search bar for WooCommerce orders, plus combinable filters, custom-field search and saved segments.

View the add-on