Title: AffLoc — Affiliate Link Localization
Author: AffLoc
Published: <strong>March 30, 2026</strong>
Last modified: March 30, 2026

---

Search plugins

![](https://ps.w.org/affloc/assets/banner-772x250.png?rev=3494521)

![](https://ps.w.org/affloc/assets/icon-256x256.png?rev=3494521)

# AffLoc — Affiliate Link Localization

 By [AffLoc](https://profiles.wordpress.org/affloc/)

[Download](https://downloads.wordpress.org/plugin/affloc.0.2.0.zip)

 * [Details](https://twd.wordpress.org/plugins/affloc/#description)
 * [Reviews](https://twd.wordpress.org/plugins/affloc/#reviews)
 *  [Installation](https://twd.wordpress.org/plugins/affloc/#installation)
 * [Development](https://twd.wordpress.org/plugins/affloc/#developers)

 [Support](https://wordpress.org/support/plugin/affloc/)

## Description

AffLoc is a lightweight, cache-friendly WordPress plugin designed to help you maximize
your affiliate revenue globally. It automatically detects your visitor’s country
via IP and swaps out your affiliate links to match their regional store (e.g., Amazon
US vs Amazon UK), ensuring you never lose a commission due to a “Not Available in
Your Country” error.

#### Features

 * **Automatic Geolocation:** Detects visitor country securely and accurately.
 * **Country-Specific Links:** Assign different URLs for the same offer based on
   the user’s country code.
 * **Cache-Friendly:** Uses a hybrid JavaScript approach so it works perfectly with
   caching plugins (WP Rocket, W3 Total Cache, etc.).
 * **Global Fallback:** Define a default link for countries without a specific mapping.
 * **Easy Shortcodes:** Simply use `[affloc_link slug="your-offer"]` and let the
   plugin handle the rest.

### External Services

This plugin relies on the following external services to function:
 1. **ipapi.co**–
Used to detect the visitor’s country securely over HTTPS by resolving their IP address.
Their privacy policy is available at [https://ipapi.co/privacy/](https://ipapi.co/privacy/).
No personal data other than the user’s IP address and proxy headers is transmitted.
2. **flagcdn.com** – Used to deliver fast and reliable SVG/PNG country flag icons
inside the WordPress Admin Dashboard.

## Screenshots

 * [[
 * The **AffLoc admin page** featuring the **Add New Mapping** form (Offer Slug,
   Country search, Affiliate text and URL fields) alongside the sidebar with **White-
   label Shortcode (Pro)**, **Shortcode Helper**, and **Import / Export Mappings**
   tools.
 * [[
 * The **Existing Mappings** table — all mappings grouped by slug/project, showing
   country flags, destination URLs, ready-to-copy shortcodes with a “Copy Shortcode”
   button, creation date, and Edit/Delete row actions.
 * [[
 * Inserting the shortcode into a page using the WordPress block editor (Gutenberg)—
   add a standard **Shortcode** block and paste `[affloc_link slug="your-slug" text
   ="Buy Now"]`.
 * [[
 * The rendered result on the front end — a geo-localised **“Buy Now”** affiliate
   link automatically swapped to the correct regional URL based on the visitor’s
   country.

## Installation

 1. Upload the plugin files to the `/wp-content/plugins/affloc` directory, or install
    the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress.
 3. Navigate to **AffLoc** in your WordPress admin menu.
 4. Add your first mapping (e.g., `slug: amazon`, `country: US`, `url: https://amazon.
    com/...`).
 5. Use the shortcode `[affloc_link slug="amazon" text="Buy Now"]` in your posts or
    pages.

## FAQ

### Does it work with caching plugins?

Yes! The substitution happens on the client side (in the browser), meaning your 
pages remain fully cacheable.

### Which IP geolocation service is used?

We use the free ipapi.co service with a secure HTTPS connection. The plugin also
caches the location in the user’s browser to minimize API calls and speed up link
swapping.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“AffLoc — Affiliate Link Localization” is open source software. The following people
have contributed to this plugin.

Contributors

 *   [ AffLoc ](https://profiles.wordpress.org/affloc/)

[Translate “AffLoc — Affiliate Link Localization” into your language.](https://translate.wordpress.org/projects/wp-plugins/affloc)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/affloc/), check out
the [SVN repository](https://plugins.svn.wordpress.org/affloc/), or subscribe to
the [development log](https://plugins.trac.wordpress.org/log/affloc/) by [RSS](https://plugins.trac.wordpress.org/log/affloc/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 0.2.0

 * Features: Added maximum mapping limit and Affiliate Text shortcode support.
 * Refactoring: Conformed strictly to WordPress Database APIs for SQL queries.

#### 0.1.5

 * Enhancements: Added copy-to-clipboard functionality for shortcodes.
 * Enhancements: Admin UI improvements including country flags, grouping, searching,
   date sorting, and row actions.
 * Security: Switched to secure HTTPS endpoints for IP geolocation.
 * Security: Added comprehensive IP validation including support for Cloudflare/
   Proxies.
 * Performance: Frontend scripts now only load on pages containing the shortcode.

#### 0.1.0

 * Initial Beta release.

## Meta

 *  Version **0.2.0**
 *  Last updated **6 days ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.0 or higher **
 *  Tested up to **6.9.4**
 *  Language
 * [English (US)](https://wordpress.org/plugins/affloc/)
 * Tags
 * [affiliate](https://twd.wordpress.org/plugins/tags/affiliate/)[geotargeting](https://twd.wordpress.org/plugins/tags/geotargeting/)
   [links](https://twd.wordpress.org/plugins/tags/links/)[localization](https://twd.wordpress.org/plugins/tags/localization/)
   [redirects](https://twd.wordpress.org/plugins/tags/redirects/)
 *  [Advanced View](https://twd.wordpress.org/plugins/affloc/advanced/)

## Ratings

No reviews have been submitted yet.

[Add my review](https://wordpress.org/support/plugin/affloc/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/affloc/reviews/)

## Contributors

 *   [ AffLoc ](https://profiles.wordpress.org/affloc/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/affloc/)