WPCS - WordPress Currency Switcher Professional

Show prices in multiple currencies in WordPress without WooCommerce

To show prices in multiple currencies in WordPress without WooCommerce, a page needs two things: a currency switcher for the visitor, and prices the plugin is allowed to convert. WPCS – WordPress Currency Switcher provides both for posts, pages, custom post types and widgets on any WordPress site. The second part is where most setups go wrong: the plugin does not search your pages for amounts. It converts only the prices you print with its shortcode. Set that up once, and every price on the site follows the visitor's currency.

How WPCS converts a price

You write each amount once, in your base currency, inside the [wpcs_price] shortcode, for example [wpcs_price value=100]. When WordPress builds the page, the plugin multiplies the amount by the exchange rate of the visitor's currency and prints it with that currency's symbol, decimals and separators. The visitor's choice is remembered, so every price on every page appears in the same currency until they pick another one.

Everything else on the page stays as it is. A price typed as plain text ("from $100"), a price field of your theme or a pricing-table widget of a page builder is not touched. Installing the plugin or adding the switcher does not change any amount by itself. If a number must switch currency, it has to be printed by [wpcs_price], or by the plugin's PHP functions in a template.

For the same reason WPCS does not change WooCommerce product prices, the cart or the checkout, even when WooCommerce runs on the same site. Shops need the sister plugin FOX – WooCommerce Currency Switcher; the difference is explained in WordPress Currency Switcher vs WooCommerce Currency Switcher.

Step 1: add currencies and exchange rates

Install and activate WPCS (it is on wordpress.org), then open Settings → Currency Switcher in the WordPress admin. On the Currencies tab:

  1. Add currencies with Add currency or the Currency Wizard. Use the ISO 4217 code as the currency name: EUR, GBP, ZAR, not "Euro" or "Pound". Rate services look currencies up by this code, so an invented code gets no rate. The FAQ on adding a new currency explains each field of the row.
  2. Select the radio button of your base currency. Its rate is 1, and every amount you put into [wpcs_price] is read as an amount in this currency. Decide on it before you write prices: changing the base currency later does not rewrite the numbers already in your shortcodes.
  3. Get the rates. On the Options tab, choose a Currency aggregator. Yahoo and the European Central Bank work without a key; Currencyapi, Open exchange rates, Currencylayer and Fixer need one in Aggregator API key. Back on Currencies, press Update all rates or type the rates by hand. A newly added row starts with rate 0, and a currency with rate 0 shows every price as 0.00.
  4. Choose how often rates refresh in Rate auto update on the Options tab, then press Save options. If rates do not refresh, read why the rate auto update is not working.

Each currency row also sets the symbol position, cents, decimals and number format, so the same price can read € 1.250,00 in euros and $1,250.00 in dollars.

Step 2: show the currency switcher

Visitors need a way to pick a currency. Use one or more of these:

  • The [wpcs] shortcode anywhere in the content. Attributes such as show_flags=0, width='300px' and txt_type='desc' adjust it; see the [wpcs] shortcode reference. The look of the drop-down is set in Drop-down view on the Options tab, and designs made on the Designer tab are shown with [wpcs sd=1], where 1 is the design ID.
  • The WordPress Currency Switcher widget in a sidebar or footer widget area.
  • The side switcher: on the Side switcher tab, set Show fixed switcher to Yes. It sticks to the edge of the screen on every page; Show on the pages and Hide on the pages limit it to certain page IDs.
  • The header. In a classic theme, add <?php echo do_shortcode('[wpcs]'); ?> to header.php of a child theme. In a block theme, add a Shortcode block with [wpcs] to the header template part in the Site Editor. For a menu, see how to add the currency switcher to the menu.

When a visitor picks a currency, the page reloads with ?currency=EUR in the address (or without it, if No GET data in link is set to Yes), and the plugin remembers the choice for the following pages.

Step 3: print every price with [wpcs_price]

Replace each amount that should switch currency with the shortcode. It works inside a sentence, so the rest of the text stays yours:

Consultations start at [wpcs_price value=49] per hour.

The value is a plain number in the base currency, with a dot for decimals: 1250 or 1250.50. No currency symbol, no thousands separator: value="1,250" is read as 1.

Where the price isHow to insert the shortcode
Block editorType it in a Paragraph block, or use a Shortcode block
Classic editorType it in the text
ElementorText Editor widget or Shortcode widget
WPBakeryText Block element
Widget areasShortcode block or Text widget
Theme template (PHP)echo do_shortcode('[wpcs_price value="49"]');

Fields made for plain text, such as headings, button labels, cells of some table plugins and price fields of builder widgets, often print the shortcode as text. Use one of the places above for the price instead.

Prices stored in custom fields

If the amount is saved in a custom field, let the shortcode read it: [wpcs_price meta_value=price] takes the field price of the current post, and [wpcs_price meta_value=price post_id=42] takes it from post 42. Simple ACF fields are stored under their field name, so the field name works as meta_value. The field must contain a plain number. In a template:

<?php
// Child theme template file, inside the loop.
// Prints the custom field "price" of the current post in the visitor's currency.
echo do_shortcode('[wpcs_price meta_value="price"]');

// Or an amount you already have in a variable, in the base currency.
$amount = 1250;
echo do_shortcode('[wpcs_price value="' . floatval($amount) . '"]');

Fixed amounts and several currencies side by side

  • Your own price per currency instead of a converted one: [wpcs_price type="fixed" value="USD:49,EUR:45,GBP:39"]. List every currency of the site; a currency missing from the list shows the word none.
  • One currency regardless of the switcher: [wpcs_price value=100 fix_currency=EUR]. Put two or three of them next to each other to show the same price in several currencies at once. Do not combine this with I am using cache plugin on my site: that option redraws all prices in the visitor's currency after the page loads.

Step 4: test on a blank page

Create a draft page with only these two lines and preview it:

[wpcs]
[wpcs_price value=100]

Pick each currency in the switcher. The amount must change by the rate of that currency. Repeat the test in a private browser window, where you are not logged in, because page caches usually skip administrators. Then read the result:

  • The amount changes here but not on your real pages: those prices are not printed by [wpcs_price], or the field they are in does not run shortcodes.
  • It shows 0.00 in a currency: that currency's rate is 0 or empty.
  • The shortcode appears as text: the place where you typed it does not process shortcodes.
  • It works only after a reload, or only for you: the site uses a page cache. Set I am using cache plugin on my site to Yes on the Options tab and clear the cache.

Each of these cases is covered step by step in currency switcher not converting prices.

Optional: welcome currency, GeoIP and price extras

  • Welcome currency on the Options tab sets the currency a visitor sees on the first visit. Your base currency can stay INR while new visitors see USD.
  • The GeoIP rules tab picks the first currency by the visitor's country. Setup and limits are in how to set the currency by visitor country.
  • Show price info icon adds an icon next to each price that lists the amount in all other currencies on hover.
  • [wpcs_converter] adds a currency converter and [wpcs_rates] a table of current rates.
  • On a multilingual site, the currency can follow the language: switch currency with the language change.

Checklist

  • Every currency uses an ISO 4217 code, the base currency is selected, and no rate is 0 or empty.
  • A switcher is visible: [wpcs], the widget or the side switcher.
  • Every amount that should switch is printed by [wpcs_price] with a plain number in the base currency.
  • The test page converts [wpcs_price value=100] in a private window.
  • With a page cache plugin: I am using cache plugin on my site is Yes and the cache is cleared.

If the test page converts and your real prices still do not, open a topic on the WPCS support forum with a link to the page and the exact shortcode you used.