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. [php] /* add search fields to woocommerce orders page Allowed search fields: _order_key _billing_first_name _billing_last_name _billing_company _billing_address_1 _billing_city _billing_postcode _billing_country _billing_state _billing_email _billing_phone _order_items */ 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; } [/php]

Need help with this?
Hire me for a consultation and I'll walk you thru the process.


Submit a Comment

Your email address will not be published. Required fields are marked *

5 star reviews
"WOW! Money WELL spent. Joseph was incredibly knowledgeable in helping me make some final tweeks to my Divi website. He was very caring and went above and beyond. Will 100% use him for any future Divi website needs."
Claire - CMMC

5 star reviews
"You really get what you pay for with Joe. He does more than simply build a website, he sets up websites for success. Functional, clean, professional designs and he keeps up/implements the latest plugins and technology. Thank you Joe. I will continue to refer you work."
Mark Winger

5 star reviews
"The best WordPress guy I’ve worked with on WordPress, hands-down (and I’ve worked with dozens). Remarkably good with theme customizations with a quick turn. Kept it on budget as well. A rarity with hourly contracts."
Nate Wright

5 star reviews
"Thanks for your prompt reply. You’re always so comprehensive. If we could write another review just for your communication skills, then we would."
Alex N

More Tips

Looking for some deals?

Ad - Web Hosting from SiteGround - Crafted for easy site management. Click to learn more.

Cloudways Hosting

WPEngine Hosting

Pressable Hosting

AccuWeb Hosting

Divi PHP Code Module

Ask a Question

"*" indicates required fields