Today I'm excited to announce the release of GeoX, a lightweight but powerful WordPress geolocation plugin that allows you to display content conditionally based on your visitors' geographic location.
I'm not totally new to coding my own solutions for WordPress, but this is one of the most useful so far. Whether you're looking to create region-specific promotions, localised messaging, or simply provide a more personalised experience for your visitors, GeoX makes it easy.
And the best part? It's completely free.
Why I Built GeoX
In today's global online marketplace, delivering the right content to people in the right location isn't just nice to have – it's becoming essential. Whether you run an online shop, a local business, or a content-rich blog, knowing where your visitors are coming from lets you create truly personalised experiences.
With the GeoX geolocation plugin, you can easily:
- Show shipping notices only to countries you deliver to
- Display region-specific promotions that actually matter to your visitors
- Present special event details to local audiences
- Customise messaging for different geographic markets
- Stay compliant with regional regulations by showing appropriate disclaimers
- Create location-aware pricing strategies
and a lot more.
You might think that such functionality would be complex to set up or would slow down your site… Not with GeoX. I've built it from the ground up to be both lightweight and incredibly easy to use. It is both simple to use and highly flexible, with seamless support for both the Gutenberg block editor and the Classic Editor.
But I'll be honest – there are other geolocation plugins available for WordPress. The problem is that some cost quite a bit while others are overly complex. Some are both.
And so I built my own.
Key Features
GeoX comes packed with features that put you in control of how location affects your content.
Smart Content Display Logic
The heart of GeoX is its ability to show or hide content based on precise location criteria:
- Country-based targeting: Show (or hide) content only to visitors from specific countries
- City-level precision: Target content to major cities around the world
- Continental grouping: Easily target entire continents with a single rule
Flexible Include/Exclude Rules
GeoX gives you both positive and negative targeting options:
- Include specific locations to show content ONLY to those visitors
- Exclude certain regions to hide content from those locations
- Combine both for laser-focused targeting
For example, you might want to show a promotion to all European visitors except those in Germany – simple to set up with just a few clicks.
Seamless Editor Integration
No matter how you build your WordPress pages, GeoX fits right in:
- Gutenberg support: The “GeoX Conditional Container” block makes visual editing a breeze, creating a wrap that allows you to insert any other block you have installed.
- Classic Editor compatibility: Full support for the Classic Editor with intuitive shortcodes for all the instances where Gutenberg is not in play (i.e. WooCommerce).
Cache-Friendly Implementation
Unlike many other geolocation plugins, GeoX works perfectly with your caching plugins:
- JavaScript-based implementation that doesn't break caching
- No need to disable your performance optimisations
- Millisecond response times that won't slow down your site
Reliable Google Maps API Integration
For accuracy, you can count on:
- Precise geolocation plugin using the trusted Google Maps API
- Smart fallback system when primary geolocation fails
- Efficient caching to minimise API calls and keep costs down


GeoX in Action: Real-World Use Cases
Let's look at how GeoX can benefit different types of website owners:
E-commerce Store Owners
Online shop owners use GeoX to:
- Display shipping rates and delivery times specific to each country
- Show localised payment options (like showing SEPA info only to EU visitors)
- Present region-specific promotions (“Free shipping in the UK this week!”)
- Hide products that can't be shipped to certain regions
Local Businesses
Local service providers leverage GeoX to:
- Show opening hours in the visitor's local time zone
- Display driving directions for nearby visitors
- Present special offers to customers in their service area
- Hide irrelevant information from visitors outside their region
Content Publishers
Publishers and bloggers use GeoX for:
- Displaying region-appropriate advertising
- Showing localised examples in their articles
- Presenting event notifications to relevant geographic audiences
- Customising language and cultural references
WooCommerce Integration
While GeoX works brilliantly on any WordPress site, it's a particularly powerful geolocation plugin when combined with WooCommerce:
- Create region-specific pricing strategies
- Display different product variants based on location
- Show appropriate tax and customs information
- Implement location-based discount codes
How to Use GeoX
Conditional Content Block (Gutenberg)
In the Gutenberg editor, simply add the “GeoX Conditional Container” block and configure the include/exclude settings in the sidebar:
- Add the “GeoX Conditional Container” block to your page
- Configure which locations to include or exclude in the block settings panel
- Add your content inside the container
- That's it! Your content will now only appear to visitors matching your location rules
Conditional Content Shortcodes
If you're using the Classic Editor or prefer shortcodes to write content inline, you can use the intuitive geoX
shortcode:
{geoX include="UK, Tokyo, EU" exclude="FR, Berlin"]
This content will only be visible to visitors from the UK, Tokyo, or Europe (excluding France and Berlin).
[/geoX}
Note that I use curly brackets here, but shortcodes are called with square brackets. Just needed to make sure you could see the code.
You can also use the shortcode with only exclude criteria:
{geoX exclude="US, CA"]
This content will be visible to everyone except visitors from the US and Canada.
[/geoX}
Location Information Shortcodes
GeoX also provides shortcodes to display information about the visitor's location:
geoX_country
– Displays the visitor's country namegeoX_country_code
– Displays the visitor's country codegeoX_region
– Displays the visitor's region or stategeoX_city
– Displays the visitor's citygeoX_continent
– Displays the visitor's continent namegeoX_continent_code
– Displays the visitor's continent code
For example:
Welcome, visitor from {geoX_city}, {geoX_country}!
Imagine greeting your visitors with “Welcome to our shop, here's what fellow customers from London are buying” These small touches create memorable experiences.
In the blog post about my tips for visiting Seoul, I used GeoX to create a paragraph that is only shown to people from the South Korean capital. I asked them to kindly inform me if the information was still valid so I could amend it and avoid misleading other visitors.
For Widget Areas
Want to use GeoX in your widget areas? Shortcodes in widgets are not enabled by default, but you can simply add this snippet to your site:
add_filter( 'widget_text', 'do_shortcode' );
You can add it via a code snippet plugin like FluentSnippets or WPCode, or in your child theme's functions.php
file.
Technical Implementation
Under the hood, GeoX uses the Google Maps Geolocation API to determine a visitor's location based on their IP address. This location information is temporarily cached in the browser to avoid repeated API calls, and a fallback service is included for when the primary API fails.
The content is initially hidden and only revealed after the geolocation check completes, ensuring a smooth user experience without content flashing or disappearing.
This approach ensures both accuracy and performance – you don't have to choose between the two.
Getting Started
- Download GeoX from GitHub
- Install and activate the plugin in your WordPress admin
- Navigate to Settings > GeoX to add your Google Maps API key
- Start using the GeoX block or shortcodes in your content
I'm happily releasing GeoX as a free plugin for the WordPress community. However, if you find it useful for your projects, please consider supporting future development with a small donation via PayPal or sponsoring the project on GitHub. Even £5 goes a long way toward maintaining and enhancing this tool, as well as helping develop future projects! Thanks a million!
Future Plans
This is just the beginning for GeoX. Based on user feedback and my own roadmap, here's what's planned for future releases of this geolocation plugin:
- Additional location parameters (timezone, language preferences, etc.)
- More advanced targeting options combining multiple criteria
- Built-in analytics dashboard to track performance of location-based content
- Enhanced styling options for conditional content blocks
- Integration with popular page builders beyond Gutenberg
This is why your donations are so important!
Final Thoughts: Location Intelligence for Everyone
The web is global, but experiences should feel local. GeoX brings the power of location intelligence to your WordPress site without the complexity or cost that typically comes with such functionality.
Whether you're looking to create more relevant content, improve user experience, or boost conversions with location-aware strategies, GeoX gives you the tools to make it happen – easily, quickly, and for free.
Have you already tried using a geolocation plugin on your WordPress site? What challenges did you face? Let me know in the comments below, and I'll be happy to suggest how GeoX might help solve them.
Please Contribute
GeoX is open source and available on GitHub. Contributions, bug reports, and feature requests are welcome!
I hope you find GeoX useful for your WordPress projects. If you have any questions or feedback, please don't hesitate to leave a comment below or reach out on GitHub.
Happy location-based content creation!