Back

GeoX: My Powerful Geolocation Plugin for WordPress (FREE!)

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.

Ad from Trusted Partners
Luminar NeoLuminar Neo

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 geolocation plugin for WordPress

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:

  1. Add the “GeoX Conditional Container” block to your page
  2. Configure which locations to include or exclude in the block settings panel
  3. Add your content inside the container
  4. 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 name
  • geoX_country_code – Displays the visitor's country code
  • geoX_region – Displays the visitor's region or state
  • geoX_city – Displays the visitor's city
  • geoX_continent – Displays the visitor's continent name
  • geoX_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

  1. Download GeoX from GitHub
  2. Install and activate the plugin in your WordPress admin
  3. Navigate to Settings > GeoX to add your Google Maps API key
  4. 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!


Help Support this Blog

If you like this post then you can see more of my work and follow me on Instagram , Twitter , YouTube , TikTok , Mastodon , Linkedin and my Facebook Page .

If you find any of the content on this blog useful, or if you kindly decide to support my work and help me create more content for you, you can donate via PayPal . Donation can be as low as £1 or as high as you want, but know that no matter the value you are a wonderful human being and I can't thank you enough.
I also accept small donations on Ko-fi , where I also list some of my digital products. Every little helps!

Purchasing anything from my store goes a long way in supporting my work and allowing me to create more content for this blog and my platforms. Items start at £2.97 only. You will find prints, presets, books and my workshops on offer. Many thanks in advance!
You can also find more of my prints on Etsy .

If you want to receive regular updates and exclusive content, notices of occasional special offers, etc, then sign up for the newsletter. There's also a 10% discount coupon for you upon signing and regular offers that are only available to subscribers.

To find out more about my photo gear, I created a dedicated list on Amazon and Kit.co


Disclosure — Please know that some of the links in this blog are affiliate links and if you go through them to make a purchase I will earn a small commission. Always keep in mind that I link companies and their products because of their quality and not because of the commission I receive from your purchases.
The decision is yours, and whether or not you decide to buy something is completely up to you. Purchasing via these links will make no difference to the cost to you (if anything, you might even get a discount) but the commission I receive will help me pay a percentage of the costs for hosting and maintaining this blog. All discounts are also conveniently listed in a dedicated page.
Thank you!

fabienb
fabienb
https://fabienb.blog
Creative. Nomad. Digital Artist. (he/him) /// Creative Director, UX Lead, DesignOps Manager, Web/Graphic Designer, Photographer, YouTuber, DJ, Public Speaker, Content Creator, AI-enthusiast, Food-Blogger... /// Award-winning Designer and Photographer, 2023 Street Photographer of the Year, published and exhibited worldwide /// also known as Koan (DJ, Design)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.