How to show different content by country on WordPress
Show WordPress visitors from each country their own text or banner: with a geotargeting plugin, with theme code, or with a rule you can measure.
WordPress doesn't change a page for each visitor's country by itself. You can add a geotargeting plugin, write theme code that looks up each visitor's location, or add a tool that changes the page in the visitor's browser from a rule. This guide compares the three, then walks through the third step by step.
What you'll build
A headline that reads differently for visitors from the United Kingdom. Everyone else sees your page exactly as it is today. The same steps work for a banner, a delivery note or any other text on the page.
Option 1: a geotargeting plugin
Several WordPress plugins show content by location. Two you'll come across:
- If-So wraps content in conditions you place with shortcodes. Its own site lists a free tier of 250 location lookups a month, with paid plans above that.
- Geo Targetly's Geo Content plugin connects WordPress to a paid Geo Targetly account.
Both work, and a plugin is the natural choice if you live in the WordPress editor. Two things to check before you choose one:
- Page caching. A plugin that decides on the server can clash with caching plugins: the first visitor's version gets cached and shown to everyone. Look for the plugin's caching mode, and test it with your cache on.
- Measuring. Check whether it can tell you if the new content helped, or whether you'll need to work that out yourself.
Option 2: theme code
PHP can't know where a visitor is on its own. You'd call a location service from your theme, and most free ones don't allow commercial use. You'd also hit the caching problem above. Unless you're a developer who enjoys this, skip it.
Option 3: a GeoEngage rule
GeoEngage looks up each visitor's country from their IP address and changes the page in their browser. Your server sends the same page to everyone, so your caching plugin keeps working.
Step 1: Add the tag
Follow Install GeoEngage on WordPress. The quickest way is the free WPCode plugin: paste the tag into its header box once. If you use a caching or optimization plugin, add the tag to its exclusion lists too (Caching and optimization plugins), or the page can change after it appears.
Step 2: Choose who sees the change
Create a rule. Under When visitor matches, add Country Code equals United Kingdom (GB).
Step 3: Change the headline
Under Then perform this action, choose Replace Text. Use Pick an element on your site to click your headline instead of writing a CSS selector, then type the new words: Fast, tracked delivery across the UK.
Replace Text keeps your theme's styling; only the words change. To add a line instead, such as a delivery note under the price, use Insert HTML (Actions).
Step 4: Publish and check it
Choose Save & Publish. To see the change yourself, open your site in a private window through a VPN set to the United Kingdom. To see why a rule did or didn't run, add data-debug="true" to the tag and read the browser console (Debugging).
Try this rule in the GeoEngage rule builder, no account needed.
Check that it helped
Turn on A/B Testing in the rule's Advanced Settings, with one version against nothing: some visitors from the UK see the new headline, the rest see the old one, and GeoEngage compares how many in each group reach your goal (A/B tests).
On WooCommerce, the order confirmation page has order-received in its address, so a Page visit goal with URL contains order-received counts orders without any code (Goals and conversions).
Common questions
Does it work with Elementor, Divi or the block editor?
Yes. Rules change the finished page in the visitor's browser, whatever built it, and Pick an element on your site works on any page you can open.
Will the first page view flicker?
With the tag in <head> and excluded from optimizers, the elements a rule changes stay hidden until the change is made. A visitor's very first page view is the exception: the widget learns which elements to hide from their earlier page views (Content flickers).
Will Google see the UK headline?
Google mostly crawls from US addresses, so it sees your default page. Keep the words you want to rank for in the page itself, and use rules for the messages that change by country.
Can it show different prices?
No. A rule changes what visitors read, not what they pay. If you need prices per country, that's your shop plugin's job.