Plugin Directory

Test out the new Plugin Directory and let us know what you think.

Open Currency Converter

Convert currencies within the text of a post or page.

The Options Screen

Once the plugin is activated two new administration screens will be present.

  • Open Currency - This appears under "Settings" and allows you to specify default settings for any currency conversion
  • Exchange Rates - Shown under the "Tools" menu, this displays the current exchange rates along with a list of all the valid exchange codes

Before using this plugin it is highly recommended that you review the Options screen and change any values, as appropriate. You will also need to sign up for and enter an App Key before conversions will work.

Using the Shortcode

The shortcode of '[convert]' has the following parameters that you may specify...

  • number - The number that you wish to convert from one currency to another. This is required
  • from - The currency code that you wish to convert from (see the admin options for a list of valid codes). If you do not specify this value then the default from the options screen will be used
  • to - The currency code that you wish to convert to (see the admin options for a list of valid codes). If you do not specify this value then the default from the options screen will be used.
  • dp - How many decimal places the output should be. This should be numeric or the word "match". The latter is the default and will mean that the output will match the number of decimal places that the number was.
  • template - See the later section, "Using Templates", for further information

Example of use are...

[convert number=49.99 from="gbp" to="usd"]

This would convert 49.99 from UK pounds to US dollars and output the result to 2 decimal places.

[convert number=50 from="usd" to="gbp"]

This would convert 50 from US dollars to UK pounds and output the result without any decimal places.

If the conversion can't be done then an appropriate error message will be output instead. If you wish to suppress these messages then you need to use a template (see the later section on this) - in this case no output will be generated in the case of an error.

Using Templates

The template option allows you to specify other information to be output along with the conversion result. None of the template will be output if any error occurs, including any error messages, allowing you to suppress any conversion text in the case of a problem.

The template text must include %result% where you wish the output to appear.

Here's an example...

The retail price is �49.99[convert number=50 from="gbp" to="usd" template=" (approx. $%result%)"].

Normally, this would print a result such as...

The retail price is �49.99 (approx. $79.11).

However, if an error occurs then it will print as...

The retail price is �49.99.

You may also include the template between opening and closing shortcode tags. For example...

The retail price is �49.99[convert number=50 from="gbp" to="usd"] (approx. $%result%)[/convert].

Using the Function Call

If you wish to perform a currency conversion within your theme, rather than within a post or page, then you can use a PHP function call. The function name is get_conversion and will return the result back.

  • All of the shortcode parameters are valid, except for the template which isn't required
  • The parameters are specified in any order and are separated with an ampersand
  • You should not add quotes around each parameter value, as you do with the shortcode

For example...

<?php echo get_conversion( 'number=49.99&from=gbp&to=usd' ); ?>

Global conversion variables

For the use of developers, 2 global variables have been added which, if assigned within your site code, will override the conversion codes.

The variables are global_convert_from and global_convert_to.

This is useful if, say, you have multiple versions of the site in different languages - you can then assign these global variables depending on which site is being viewed and all currency will be converted based upon these settings.

These will only override the options screen and not specific parameters specified with a shortcode or function call.


The Open Source Exchange Rates API is kindly provided by Joss Crowcroft.

Requires: 3.3 or higher
Compatible up to: 4.7.2
Last Updated: 3 months ago
Active Installs: 700+


4.3 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

100,2,2 100,1,1