How to Add a Custom Column to the WordPress Users Table

How to Add a Custom Column to the WordPress Users Table
On this page
  1. Why Add Columns to the Users Table
  2. Step 1: Show Billing City in the Users Table
  3. Troubleshooting
  4. Frequently Asked Questions
  5. Conclusion

You can add a custom column to the WordPress users table by hooking into two admin filters: one that registers the new column header, and one that fills it with whatever WooCommerce customer data you need, such as billing city or total orders.

Why Add Columns to the Users Table

  • See customer billing details at a glance without opening each profile
  • Sort or scan your customer base by a field that matters to your business
  • Surface WooCommerce-specific data (city, phone, order count) that WordPress doesn’t show by default
  • Speed up support and fulfillment workflows for staff who live in wp-admin

Step 1: Show Billing City in the Users Table

The first filter adds the column heading, the second decides what prints inside it for each row.

PHP
/** Show each customer's billing city in the WordPress Users table */
add_filter( 'manage_users_columns', 'register_customer_city_column' );

function register_customer_city_column( $columns ) {
    $columns['customer_city'] = 'City';
    return $columns;
}

add_filter( 'manage_users_custom_column', 'populate_customer_city_column', 10, 3 );

function populate_customer_city_column( $output, $column_name, $user_id ) {
    if ( 'customer_city' === $column_name ) {
        $customer = new WC_Customer( $user_id );
        $output   = $customer->get_billing_city();
    }
    return $output;
}
Add a custom column to the WordPress users table: the page before adding the code
Before
Add a custom column to the WordPress users table: the page after adding the code
After

Showing a Calculated Value Instead

You aren’t limited to a single stored field — the column can run any calculation, such as counting completed orders.

PHP
/** Show each customer's completed order count in the Users table */
add_filter( 'manage_users_columns', 'register_order_count_column' );

function register_order_count_column( $columns ) {
    $columns['order_count'] = 'Orders';
    return $columns;
}

add_filter( 'manage_users_custom_column', 'populate_order_count_column', 10, 3 );

function populate_order_count_column( $output, $column_name, $user_id ) {
    if ( 'order_count' === $column_name ) {
        $output = wc_get_customer_order_count( $user_id );
    }
    return $output;
}

Troubleshooting

The column shows but is always blank

Double check the column key used in both filters matches exactly — a mismatch between customer_city in one function and a typo in the other is the most common cause.

Column order looks wrong

New columns are appended at the end of the $columns array. Use array_slice() with the + operator to insert the new key at a specific position if the default placement bothers you.

Frequently Asked Questions

Can I add more than one custom column at once?

Yes — register multiple keys in the same manage_users_columns callback and handle each one with its own condition inside the column-content callback.

Will this slow down the Users page for large customer lists?

A little, since each row runs a lookup. For stores with thousands of customers, cache the value in user meta on order completion instead of calculating it live on every page load.

Does this work for custom user roles too?

Yes, the column shows for every row of the Users table regardless of role — add a role check inside the callback if you only want it for customers.

Conclusion

A couple of WordPress filters are all it takes to add a custom column to the WordPress users table and surface the WooCommerce data your team checks most often. Start with one field, confirm it renders correctly, then extend the same pattern to any other customer detail you need visible at a glance.

See also How to Add a Custom Column to the WooCommerce Products Table.

Prefer no code? All-in-One Utilities handles this kind of change from a settings screen. Its Users Screen guide also shows how.

Leave a Reply

Schedule a call