Skip to content
Sign in
User Location and IP icon

User Location and IP

Show visitor IP, country, city and flag, show content by country, redirect by country and hide WooCommerce products by location.

Not scanned yet WordPress plugin 300 installs

Install in

No install steps yet

Follow the steps on the source page.

User Location and IP is a free WordPress geolocation plugin. Show each visitor their own IP address, country, city, flag and more, show different content to visitors from different countries, redirect visitors by country, and hide WooCommerce products by location. It works with shortcodes, Gutenberg blocks and Elementor, and it is safe to use with page caching.

No account and no API key are needed. Install the plugin, paste a shortcode or add a block, and your visitor’s details appear.

Show visitor IP address and location

Display any of these details about the current visitor, anywhere on your site:

  • IP address: the visitor’s public IPv4 or IPv6 address, optionally masked for privacy (203.0.113.xxx).
  • Location: continent, country, country code, region or state, region code, city and ZIP / postal code.
  • Country flag: as an image with adjustable size and alignment, or as an emoji.
  • Coordinates: approximate latitude and longitude.
  • Time and money: the visitor’s timezone, their current local time and date, and their local currency code.
  • Network: the visitor’s internet service provider (ISP).
  • EU check: whether the visitor is in the European Union.
  • Device: browser (Chrome, Safari, Edge, Firefox, Opera, Samsung Internet and more) and operating system (Windows, macOS, iPhone, iPad, Android, ChromeOS, Linux).

Geo targeting: show or hide content by country

Show content only to visitors from chosen countries, continents, regions or cities, or hide it from them, with an optional “everyone else” version:

[useriploc_if country="US,CA"]Free shipping to the US and Canada![else]We ship worldwide.[/useriploc_if]

Rules can use country, continent, region, city and eu, each with a not_ version to exclude. The same rules are available in the Geo Content block and on any Elementor widget, section, column or container.

Country redirects

Send visitors from chosen countries, or everyone except those countries, from one page, a group of pages or the whole site to another page or website. Choose a 301, 302 or 307 redirect. Search engines and visitors whose country is unknown are never redirected, logged-in users can be skipped, rules that would loop are ignored, and adding ?useriploc_noredirect=1 to a URL lets you view it without being redirected.

WooCommerce geolocation

  • Hide products by country: hide any product from chosen countries, or show it only to them. Hidden products disappear from the shop, categories, search, related products, product blocks and the Store API, cannot be added to the cart and show “not found” on their own page.
  • Location on orders: every new order records the buyer’s IP address, country, region and city, from both the classic and block checkout. Shop managers see it in a “Visitor location” box and an optional Location column, with a note when the billing country doesn’t match the IP country.
  • Geo content on product pages: shortcodes work in product descriptions and short descriptions.
  • Compatible with High-Performance Order Storage (HPOS) and the block checkout.

Gutenberg blocks and Elementor widget

  • Visitor Info block: shows one visitor detail, with optional text before and after it and full typography and colour settings.
  • Geo Content block: shows the blocks inside it only to visitors from the places you choose.
  • Visitor field button: inserts a visitor detail anywhere inside a paragraph, straight from the text toolbar.
  • Elementor Visitor Info widget: the same details with Elementor’s styling controls.
  • Elementor geo visibility: show or hide any Elementor element by country, continent, region, city or EU from its Advanced tab. Rules are never applied inside the editor, so you can always see and edit every element.

Works with page caching (AJAX mode)

Page caching plugins save one copy of each page and show it to everyone, which would show one visitor’s IP or city to all visitors. User Location and IP gives you two safe options:

  • Server mode (default): details are added as the page is built, and those pages are automatically excluded from page caching (WP Rocket, W3 Total Cache, WP Super Cache, LiteSpeed Cache, Cloudflare APO and others).
  • AJAX mode: pages stay fully cacheable. Visitor details and geo content are filled in by a small script right after the page loads, with a single request.

Optional visitor log

Turn on the visitor log to record each page view with the visitor’s IP address, approximate location, page, referrer, browser and operating system. It is off by default, works with page caching, skips bots and site admins, limits how many entries one visitor can create, and deletes old entries automatically after the number of days you choose. See your top countries and pages, filter the log, export it to CSV or clear it. Suggested privacy-policy text and WordPress’s personal-data export and erase tools are included.

Privacy and security

  • Mask IP addresses everywhere with one setting, or per shortcode.
  • No cookies are set.
  • Proxy headers are only trusted from Cloudflare and from proxies on your own network, so visitors cannot fake their location by sending forged headers. Sites behind other CDNs can choose to trust them.
  • Search engine crawlers and bots are never looked up.
  • A site-wide limit on new lookups per minute protects your free quota from traffic floods.
  • Every value is sanitised and escaped before it is shown.

Shortcodes

Show a visitor detail with [useriploc type="..."]:

[useriploc type="ip"] IP address, e.g. `203.0.113.10`
[useriploc type="continent"] continent, e.g. `Oceania`
[useriploc type="country"] country name, e.g. `New Zealand`
[useriploc type="countrycode"] two-letter country code, e.g. `NZ`
[useriploc type="region"] region or state code, e.g. `AUK`
[useriploc type="regionname"] region or state name, e.g. `Auckland`
[useriploc type="city"] city, e.g. `Auckland`
[useriploc type="zip"] ZIP or postal code, e.g. `1010`
[useriploc type="lat"] latitude, e.g. `-36.8485`
[useriploc type="lon"] longitude, e.g. `174.7635`
[useriploc type="timezone"] timezone, e.g. `Pacific/Auckland`
[useriploc type="localtime"] visitor's local time, e.g. `4:02 pm`
[useriploc type="localdate"] visitor's local date, e.g. `November 28, 2026`
[useriploc type="currency"] currency code, e.g. `NZD`
[useriploc type="isp"] internet service provider, e.g. `Spark New Zealand`
[useriploc type="eu"] in the EU, `Yes` or `No`
[useriploc type="browser"] browser, e.g. `Chrome`
[useriploc type="os"] operating system, e.g. `Windows 10/11`
[useriploc type="flag" width="50px"] country flag image
[useriploc type="flagemoji"] country flag emoji, e.g. 🇳🇿

Optional attributes:

  • default="your city": text shown when a value is unknown, so sentences always read well.
  • mask="yes" or mask="no": mask the IP address (overrides the global setting).
  • format="H:i": PHP date format for localtime and localdate (defaults to your site’s format).
  • yes="EU visitor" no="Non-EU visitor": custom text for eu.
  • width, height and vertical_align: size and alignment of the flag image (defaults 50px, auto, baseline).

Show content by location with [useriploc_if]...[else]...[/useriploc_if]:

  • country="US,CA" / not_country="RU": country codes or names.
  • continent="europe" / not_continent="AS": continent names or codes (AF, AN, AS, EU, NA, OC, SA).
  • region="CA,Texas" / not_region="...": region or state codes or names.
  • city="London,Paris" / not_city="...": city names.
  • eu="yes" or eu="no": visitors inside or outside the European Union.

Values in one attribute mean “any of these”, and different attributes must all match. The [else] part is optional and is shown to everyone who doesn’t match.

Ready-to-use examples

Personal welcome message

Welcome, visitor from [useriploc type="city" default="your city"], [useriploc type="country"] [useriploc type="flag" width="20px" vertical_align="middle"]

“What is my IP address” box

Your IP address is [useriploc type="ip"]. Your internet provider is [useriploc type="isp"], and you appear to be in [useriploc type="regionname"], [useriploc type="country"].

Country-specific offer

[useriploc_if country="GB"]Free UK delivery on orders over £30.[else]International shipping available.[/useriploc_if]

EU cookie or VAT notice

[useriploc_if eu="yes"]Prices include VAT for EU customers.[/useriploc_if]

Support details for help desks

Please include: IP [useriploc type="ip"], browser [useriploc type="browser"], operating system [useriploc type="os"], local time [useriploc type="localtime"].

Event and webinar timezones

This webinar starts at 9:00 AM New York time. It's currently [useriploc type="localtime"] where you are ([useriploc type="timezone"]).

How it works

  1. The plugin finds the visitor’s real public IP address, including behind Cloudflare, load balancers and reverse proxies.
  2. It checks its cache. If this IP was looked up recently (24 hours by default), the saved result is used with no external request.
  3. Otherwise it asks the ipwho.is geolocation service over HTTPS, falling back to freeipapi.com automatically if needed.
  4. The result is saved and shared by every shortcode, block, rule and redirect on the page, so a page full of location features still makes only one lookup.

The IP address, browser and operating system are detected on your own server and never need an external service. Unlike a WordPress geolocation plugin that needs a downloaded database, there is nothing to install, update or store.

Who is it for?

  • Bloggers and publishers who want to greet readers by city or country.
  • Online stores that need country-specific offers, products, prices or shipping messages.
  • Businesses in several countries that redirect visitors to the right regional site or page.
  • VPN, hosting and security websites that show visitors their IP address and ISP.
  • Support teams who need a visitor’s IP, browser and operating system.
  • Developers who need simple, cached IP location lookups in a theme or custom plugin.

For developers

  • PHP: useriploc_get( 'country' ), useriploc_get_data() and useriploc_matches_conditions( array( 'country' => 'US,CA' ) ).
  • REST API: GET /wp-json/useriploc/v1/visitor returns the visitor’s details as JSON.
  • CSS: optional body classes such as useriploc-country-us, useriploc-continent-eu and useriploc-eu.
  • JavaScript: a useriploc:loaded event fires in AJAX mode when visitor details have been filled in.
  • Filters for the location data, cache time, lookup services, trusted proxies, redirects, log entries and more.

Credits

This plugin was created by Sunny Bundel with the help of the team at Gronite.

External services

This plugin connects to third-party IP geolocation services to find the approximate location of a visitor’s IP address.

What is sent, and when: only the visitor’s IP address, when the plugin needs that visitor’s location and hasn’t looked it up recently (24 hours by default). That happens on pages that use a location shortcode, block or Elementor rule, and on any page when country redirects, country body classes, WooCommerce product rules, order location or the visitor log are switched on. Nothing else about the visitor is sent. Search engine crawlers and private or local IP addresses are never looked up.

  • ipwho.is (primary), provided by ipwhois.io
  • freeipapi.com (used only if ipwho.is is unavailable)
  • ipwhois.pro, provided by ipwhois.io (used only if you enter a paid API key in the settings)

The results are stored on your own site in WordPress transients for the cache time you choose.

Written by Joobi from the project's own listing. See the source page

Country Redirectgeolocationgeotargetingip addressvisitor location
28 Nov 2026
Version 3.0 released. Not scanned yet.

3.0 – 28 November 2026

  • NEW: Show or hide content by country, continent, region, city or EU with [useriploc_if], including an [else] part.
  • NEW: Country redirects with page rules, “everyone except” rules and 301, 302 or 307 redirects.
  • NEW: Gutenberg blocks: Visitor Info and Geo Content, plus a Visitor field button in the text toolbar.
  • NEW: Elementor Visitor Info widget and geo visibility for any Elementor element.
  • NEW: WooCommerce: hide products by country, visitor location on orders with a billing-country check, shortcodes in product descriptions. HPOS and block checkout compatible.
  • NEW: AJAX mode, so pages with visitor details can be cached.
  • NEW: Optional visitor log with stats, filters, CSV export, automatic cleanup and privacy tools.
  • NEW: Settings page with General, Redirects, Visitor log, WooCommerce and help tabs, a cache-clear button and a lookup tester.
  • NEW: Shortcode types zip, localtime, localdate, eu and flagemoji, and the default, mask, format, yes and no attributes.
  • NEW: Mask IP addresses everywhere or per shortcode.
  • NEW: Optional ipwhois.pro API key for higher limits.
  • NEW: Country and continent body classes, REST API endpoint and PHP helper functions.
  • NEW: Location data now comes over HTTPS from ipwho.is, with freeipapi.com as a backup. Both allow commercial use and need no API key.
  • NEW: Each visitor’s location is looked up once and cached (24 hours by default) instead of on every shortcode and page view.
  • SECURITY: Proxy headers are only trusted from Cloudflare and your own network, so visitors can’t fake their IP address. New “Proxy headers” setting for other CDNs.
  • SECURITY: Site-wide limit on new lookups per minute, and crawlers and bots are never looked up.
  • SECURITY: Visitor log limits per visitor and per IPv6 network, plus a site-wide cap.
  • FIX: A fatal error that broke the whole page when the shortcode was used without a valid type on PHP 8.
  • FIX: PHP 8.2+ deprecation notice. Compatible with PHP 7.4 to 8.5.
  • FIX: Edge, Opera, Samsung Internet and mobile browsers are now detected correctly.
  • FIX: The flag no longer shows the US flag when the country is unknown, and now has alt text.
  • FIX: Pages with visitor details are no longer cached and shown to other visitors.
  • Tested with WordPress 7.2.

2.0 – 29 August 2025

  • SECURITY: Fixed Cross-Site Scripting (XSS) vulnerabilities by adding proper output sanitization.
  • Improved input validation and data escaping for all user-facing outputs.
  • Enhanced security measures to prevent malicious code injection.

1.7 – 25 October 2023

  • Code was sanitized to ensure security.
  • The latest data was updated.
  • Updated to work with the latest WordPress version.

1.6 – 10 November 2022

  • Added support for the vertical-align CSS attribute to align the flag properly.
  • Updated to work with the latest WordPress version.
  • Fixed minor bugs.

1.5 – 16 August 2022

  • Added support for browser and operating system detection.
  • New shortcodes have been added.
  • Fixed minor bugs.

1.4

  • Updated to work with the latest version of WordPress.

1.3

  • Fixed a bug where the IP address of your server was displayed instead of the visitor’s IP.

1.2

  • Updated to work with the latest version of WordPress.

1.1

  • Fixed minor bugs.

1.0

  • Initial release
13 May 2020Listed on Joobi from WordPress.org.

Follow this listing's changes (Atom feed)