Using the [currency] shortcode you can convert one currency to another. The conversion is based on the rates published by the ECB (updated daily between 2.15 p.m. and 3.00 p.m. CET).
You can change from and to any of the supported currencies.
The [currency_legal] shortcode outputs a disclaimer text and a link to the ECB eurofxref page.
This plugin is based on a plugin by Xclamation.
Also see https://github.com/joostdekeijzer/wp_eurofxref
Shortcode usage & examples
This shortcode returns the string ‘* For informational purposes only. Exchange rates may vary. Based on ECB reference rates.’
The prepended ‘* ‘ (the same string as the [currency] append string) can be changed using the ‘prepend’ attribute.
[currency_legal prepend='Please note: ']
The legal string can also be retrieved in PHP
<?php echo EuroFxRef::legal_string( $prepend ) ?>
- $prepend (string) The string to prepend the legal text with, default ‘* ‘
(string) Legal text prepended with $prepend string.
from: currency code (default: EUR)
to: currency code (default: USD)
amount: number of “from” currency (default: 1)
iso: boolean (true or false, default false); use ISO currency
show_from: boolean (default true); show from amount in output
between: string (default ‘ / ’ which is displayed as
‘ / ‘ in the browser); string between from and to amounts
append: string (default ‘ ‘ which is displayed as ‘ ‘ in
the browser); string put after conversion. The * references the
disclaimer text, see [currency_legal] shortcode.
round: boolean(default true); Round numbers to whole units.
round_append: string (default ‘=’); replaces decimals
to_style: css formatting text (default
‘cursor:help;border-bottom:1px dotted gray;’); styling of “to”
Conversion from non-Euro to non-Euro is done through the Euro, so GBP to USD is calculated as GBP -> EUR -> USD.
Since v1.3, you can call the convertor staticly from PHP in your code.
<?php EuroFxRef::convert( $amount, $from, $to ); ?>
- $amount (float) The amount of currency you want to convert.
- $from (string) The currency code the amount is in, default EUR.
- $to (string) The currency code the amount must be converted to, default USD
(float) the converted value or 0 (zero) if any of the currency code’s are not available.
[currency amount="875" from="EUR" to="GBP"]
becomes “€ 875,= / £ 697.= *”
[currency amount="875" from="GBP" to="USD" iso=true between=" converts to " append="" round_append=""]
becomes “875 GBP converts to 1,418 USD”
[currency amount="875" from="GBP" to="USD" show_from=false round=false]
becomes “$ 1,130.15 *”
<?php $process_later = EuroFxRef::convert( 10, 'USD', 'GBP' ); ?>
will return the raw numeric (float) value without formatting:
Currently available currencies
USDUS Dollar ($)
JPYJapanese Yen (¥)
BGNBulgarian Lev (ЛВ.)
CZKCzech Republic Koruna (Kč)
DKKDanish Krone (kr)
GBPBritish Pound Sterling (£)
HUFHungarian Forint (Ft)
PLNPolish Zloty (zł)
RONNew Romanian Leu (RON)
SEKSwedish Krona (kr)
CHFSwiss Franc (CHF)
ISKIcelandic krona (kr)
NOKNorwegian Krone (kr)
HRKCroatian Kuna (kn)
RUBRussian Rouble (py6.)
TRYTurkish Lira (TL)
AUDAustralian Dollar ($)
BRLBrasilian Real (R$)
CADCanadian Dollar ($)
CNYChinese Yuan (元)
HKDHong Kong Dollar ($)
IDRIndonesian Rupiah (Rp)
ILSIsraeli New Sheqel (₪)
INRIndian Rupee (₹)
KRWSouth Korean Won (₩)
MXNMexican Peso ($)
MYRMalaysian Ringgit (RM)
NZDNew Zealand Dollar ($)
PHPPhilippine Peso (₱)
SGDSingapore Dollar ($)
THBThai Baht (฿)
ZARSouth African Rand (R)
LTL and LVL are not published any more at least since 1-jan-2020.
- Download the plugin
- Uncompress it with your preferred unzip application
- Copy the entire directory in your plugin directory of your WordPress blog (/wp-content/plugins)
- Activate the plugin
- Use the [currency] shortcode in you texts!
Where do the exchange rates come from?
The European Central Bank (ECB) daily publishes “foreign exchange reference rates” against more than 30 other currencies. These rates are used by this plugin.
The rates are published for informational purposes only and exchange rates may vary.
See https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/ for more information.
Contributors & Developers
“Euro FxRef Currency Converter” is open source software. The following people have contributed to this plugin.Contributors
Interested in development?
- ECB changed the currencies it publishes: ISK is published again but LTL and LVL were removed.
- Updated ECB url
- Updated all links to https
- Compatible with WordPress 5.3.2
- Updated PayPal donation link
- Compatible with WordPress 5.2.3
- ECB seems to block requests from user-agent WordPress/, changed the user-agent string
- Rewrite, so now you can call the convertor staticly from PHP
- Compatible with WordPress 3.9
- Compatible with WordPress 3.8
- bugfix where [currency_legal] default prepend “* ” would not be added
- updated plugin uri to new WordPress.org uri scheme
- all currency symbols should be correct now (some in unicode)
- added help text to edit pages
- first public version