WooCommerce: Force NZD & Hide Other Currencies
If you run a WooCommerce store and want to restrict all transactions to New Zealand Dollars (NZD) while hiding other currencies from your customers, this guide will help. By default, WooCommerce allows multiple currencies through plugins or custom setups, but sometimes you need to enforce a single currency for consistency in pricing, accounting, or payment processing.
This tutorial shows you how to force NZD as the only currency on your WooCommerce store and hide any other currencies that might be available. The solution involves adding simple code snippets to your theme or a custom plugin, ensuring your store always displays and processes payments in NZD.
Quick Fix: Force NZD & Hide Other Currencies
- Add a filter to force WooCommerce currency to NZD.
- Remove or disable any multi-currency switchers or plugins.
- Optionally, hide currency switcher UI elements if present.
add_filter( 'woocommerce_currency', 'force_woocommerce_currency_to_nzd' );
function force_woocommerce_currency_to_nzd() {
return 'NZD';
}
This snippet forces WooCommerce to always use NZD as the currency, regardless of user location or any other settings.
Why This Happens
WooCommerce allows currency to be set dynamically, especially when using multi-currency plugins or custom code. These setups can detect user location or preferences and switch currencies accordingly. However, if you want to standardize your store to a single currency (NZD), you need to override this behavior.
Without forcing NZD, customers might see prices in different currencies, which can cause confusion, pricing errors, or payment gateway mismatches. Also, some payment gateways require a consistent currency to function properly.
Step-by-step: Force NZD and Hide Other Currencies
- Backup your site. Before making changes, always backup your WordPress files and database.
- Access your theme’s functions.php or create a site-specific plugin. You can add the code snippet below to your child theme’s
functions.php
file or create a custom plugin to keep changes safe from theme updates. - Add the currency filter:
add_filter( 'woocommerce_currency', 'force_woocommerce_currency_to_nzd' );
function force_woocommerce_currency_to_nzd() {
return 'NZD';
}
- Disable multi-currency plugins or features. If you use plugins like WooCommerce Multi-Currency, Currency Switcher, or similar, deactivate or configure them to disable other currencies.
- Hide any currency switcher UI elements. If your theme or plugins add currency switchers, remove or hide them via CSS or plugin settings to avoid confusion.
- Test your store. Visit your site in incognito mode or different browsers to confirm prices always show in NZD and no other currencies appear.
Payment Gateways
Forcing NZD currency ensures compatibility with payment gateways that require a fixed currency. WooCommerce’s default gateways and popular ones like Stripe and WooPayments support NZD without issues.
If you use Stripe or WooPayments, confirm your Stripe account supports NZD payouts. WooPayments automatically detects the store currency, so forcing NZD avoids currency mismatch errors during checkout.
Works on
- Web servers: Apache, Nginx, LiteSpeed
- Hosting panels: cPanel, Plesk, and others
- WooCommerce versions 4.x and 5.x+
- Payment gateways: Stripe, WooPayments, PayPal (with NZD support)
- Compatible with most themes and child themes
FAQ
- Q: Will this code affect my multi-currency plugin?
- A: Yes. This code overrides WooCommerce’s currency setting globally. You should disable or configure your multi-currency plugin accordingly to avoid conflicts.
- Q: Can I force other currencies using the same method?
- A: Absolutely. Replace
'NZD'
with any valid WooCommerce currency code like'USD'
,'EUR'
, etc. - Q: What if I want to allow customers to see prices in other currencies but pay in NZD?
- This requires a more complex setup with multi-currency plugins that support separate display and payment currencies. The code above forces both display and payment currency to NZD.
- Q: Will this affect tax calculations?
- No. WooCommerce tax settings remain unchanged. However, ensure your tax rates are configured correctly for NZD pricing.
- Q: How do I remove currency switcher widgets from my site?
- Check your theme widgets or plugin settings. You can also hide switchers with CSS, for example:
.currency-switcher, .woocommerce-currency-switcher { display: none !important; }