# Add a Custom Currency

> Adds a currency that WooCommerce does not list, such as a local or loyalty currency, so you can select it in the general settings.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, currency, settings
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-add-custom-currency/

## Code

```php
$wpide_custom_currency = array(
    'code'   => 'XYZ',            // Three-letter code.
    'name'   => 'Example Credits', // Name shown in settings.
    'symbol' => 'Cr',             // Symbol shown with prices.
);

add_filter( 'woocommerce_currencies', function ( $currencies ) use ( $wpide_custom_currency ) {
    $currencies[ $wpide_custom_currency['code'] ] = $wpide_custom_currency['name'];

    return $currencies;
} );

add_filter( 'woocommerce_currency_symbol', function ( $symbol, $currency ) use ( $wpide_custom_currency ) {
    return $currency === $wpide_custom_currency['code'] ? $wpide_custom_currency['symbol'] : $symbol;
}, 10, 2 );
```

## Notes

After activating, choose the new currency in WooCommerce > Settings > General. Payment gateways may not support custom currencies.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Add a Custom Currency" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
