# How to show company names in the WooCommerce orders list

> WooCommerce shows the customer's name in the orders list by default. For B2B stores, that isn't what you want to see. Here's the filter that swaps it for the billing company name, with a fallback to the customer name when the field is empty.

Published: 2024-07-08T01:38:24.000Z
Updated: 2026-04-24T10:00:00.000Z
Author: Shameem Reza
Category: WordPress
Canonical: https://shameemreza.com/show-company-names-in-woocommerce-order-lists/

---

import Tldr from '../../components/Tldr.astro';

A support request came in from a store owner who kept missing orders from repeat B2B customers because the orders list showed the buyer's personal name, not the company they were ordering for. "Alex Martin" told them nothing. "Contoso Engineering" told them exactly who the order belonged to.

WooCommerce exposes a filter for this, so it's a one-snippet fix. No custom columns, no plugin, and the billing company field is already on every order, you just have to tell WooCommerce to surface it.

<Tldr>
  Hook the `woocommerce_admin_order_buyer_name` filter and return `$order->get_billing_company()`. If the company field is empty (for a B2C order mixed in among B2B ones), fall back to the original `$buyer` value so the row still shows a name. Drop the snippet into a child theme's `functions.php` or the [Code Snippets](https://wordpress.org/plugins/code-snippets/) plugin.
</Tldr>

## The default behavior

Out of the box, the orders list shows the billing first and last name in the buyer column. That's fine for most stores, but if most of your orders come from businesses, it buries the information you actually care about.

![WooCommerce orders list showing customer names by default](/uploads/show-company-names-in-woocommerce-order-1024x555.webp)

## The filter

`woocommerce_admin_order_buyer_name` was added specifically so you can customise what appears in that column. The snippet below returns the billing company name:

```php
add_filter( 'woocommerce_admin_order_buyer_name', function ( string $buyer, WC_Order $order ): string {
    return trim( $order->get_billing_company() );
}, 10, 2 );
```

That works for a pure B2B store. Every order has a company name, so every row is correct.

## Add a fallback for mixed B2B and B2C orders

If you sell to businesses and individuals from the same store, the snippet above will leave rows for B2C customers blank, because those orders don't have a billing company. Add a fallback to the original buyer name:

```php
add_filter( 'woocommerce_admin_order_buyer_name', function ( string $buyer, WC_Order $order ): string {
    $company = trim( $order->get_billing_company() );

    return $company !== '' ? $company : $buyer;
}, 10, 2 );
```

Now the column shows the company name when it's filled in and the customer name otherwise.

![Orders list showing company names after the filter is applied](/uploads/show-company-names-in-woocommerce.gif)

## Where to put the snippet

Drop it into your child theme's `functions.php` or the [Code Snippets](https://wordpress.org/plugins/code-snippets/) plugin. The column pulls straight from the billing address, so you get company names on the orders screen without any extra meta, a custom column, or a separate plugin.
