Use the wc_shipment_tracking_get_providers filter to remove carriers your fulfillment team does not use. A smaller provider list can make the order workflow faster and prevent staff from choosing a similarly named carrier by mistake.
Note:
Removing a provider from the list does not delete tracking items already saved with that provider. Review existing orders and integrations before hiding a carrier that is still in use.
Example
↑ Back to topThis example removes USPS from the United States provider group and returns the modified provider array.
<?php
add_filter(
'wc_shipment_tracking_get_providers',
function ( $providers ) {
unset( $providers['United States']['USPS'] );
return $providers;
}
);
Array keys must match
↑ Back to top| Key | Example | Requirement |
|---|---|---|
| Provider group | United States | Use the exact regional group from the provider list. |
| Provider name | USPS | Use the exact provider key inside that group. |
| Return value | $providers | Always return the filtered array. |
Calling unset() for a key that is not present is safe, which lets the snippet continue working if the built-in list changes. If another callback adds USPS after this callback runs, attach your callback at a later priority so it removes the final value.
What the filter changes
↑ Back to topThe provider disappears from the order editor and the REST API endpoint that lists providers. The filter does not modify the database, rewrite existing provider URLs, or remove tracking data from customer emails. Saved tracking items continue to use the provider information stored on the order.
Verify the change
↑ Back to top- Open the Shipment Tracking panel on an order and confirm the provider no longer appears.
- Request
/wp-json/wc-shipment-tracking/v3/shipment-trackings/providersand confirm the provider is absent. - Review recent orders that used the provider and confirm their existing tracking links still work.
- Check custom code that expects the provider key before deploying the filter to production.
To restore the provider, remove the filter callback. Because this customization changes the provider array at runtime, no data migration is required.