How to add search fields to WooCommerce orders page

May 25, 2019 | WooCommerce Tips | 0 comments

You may find it useful to have additional search fields in the WooCommerce orders page in the WP admin area.

Add the function below to your child theme functions.php file.

/* add search fields to woocommerce orders page 
Allowed search fields:


add_filter( 'woocommerce_shop_order_search_fields', 'woocommerce_shop_order_search_order_total' );
function woocommerce_shop_order_search_order_total( $search_fields ) {
    $search_fields[] = '_billing_first_name';
    $search_fields[] = '_billing_last_name';
    $search_fields[] = '_billing_company';
    $search_fields[] = '_billing_address_1';
    $search_fields[] = '_billing_city';
    $search_fields[] = '_billing_postcode';
    $search_fields[] = '_billing_state';
    $search_fields[] = '_billing_email';
    $search_fields[] = '_billing_phone';
    return $search_fields;


Submit a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.