Title: AA Block country with redirect
Author: AA Extensions
Published: <strong>November 8, 2014</strong>
Last modified: June 2, 2025

---

Search plugins

![](https://ps.w.org/aa-block-country-with-redirect/assets/banner-772x250.png?rev
=3304942)

![](https://ps.w.org/aa-block-country-with-redirect/assets/icon-128x128.png?rev=
1026953)

# AA Block country with redirect

 By [AA Extensions](https://profiles.wordpress.org/aaextensions/)

[Download](https://downloads.wordpress.org/plugin/aa-block-country-with-redirect.1.0.1.zip)

 * [Details](https://wordpress.org/plugins/aa-block-country-with-redirect/#description)
 * [Reviews](https://wordpress.org/plugins/aa-block-country-with-redirect/#reviews)
 * [Development](https://wordpress.org/plugins/aa-block-country-with-redirect/#developers)

 [Support](https://wordpress.org/support/plugin/aa-block-country-with-redirect/)

## Description

We know many times , people have to redirect their visitor to their respective pages
according to their country. In this plugin we keep this option. So that you can 
easily redirect your visitor to their respective country.

#### Features

 1.  **IP Detection:** Retrieves the visitor’s IP address using multiple server variables
     for reliability.
 2.  **Country Lookup via API:** Optionally uses `ip-api.com` to detect the visitor’s
     country based on IP.
 3.  **Per-Post/Page Country Blocking:** Enable or disable country blocking on individual
     posts, pages, or custom post types.
 4.  **Custom Blocked Countries:** Set blocked countries using comma-separated ISO 
     country codes (e.g., `US, IN, FR`).
 5.  **Global Country Blocking:** Define global blocking rules that apply across the
     entire site.
 6.  **Redirect Blocked Users:** Automatically redirect blocked visitors to a custom
     URL defined in plugin settings.
 7.  **Fallback Country Option:** Specify a fallback country code in case API lookup
     fails.
 8.  **Meta Box UI:** Adds a meta box to all public post types for easy control of 
     country blocking.
 9.  **Secure Meta Handling:** Uses WordPress nonces and capability checks to securely
     save meta data.
 10. **Lightweight Integration:** Executes only on the front-end using the `template_redirect`
     hook, keeping the admin side fast.

#### How to use it

 1. **Configure Global Settings:** Go to the plugin settings page and enable global
    country blocking. Set the list of blocked country codes and the redirect URL.
 2. **Choose IP Lookup Method:** Enable or disable IP lookup via `ip-api.com` based
    on your preference.
 3. **Block Countries Globally:** Visitors from blocked countries will be automatically
    redirected site-wide.
 4. **Set Per-Post Blocking:** Edit any post, page, or custom post type, and in the“
    AA Country Block Options” meta box, enable blocking and specify country codes to
    block for that content only.
 5. **Save Changes:** Update or publish your post/page to apply per-post blocking rules.
 6. **Test Blocking:** Use a VPN or proxy from a blocked country to verify the redirect
    works as expected.

#### Installation

 1. Download the plugin ZIP file from the source.
 2. Log in to your WordPress admin dashboard.
 3. Navigate to **Plugins > Add New**.
 4. Click **Upload Plugin** and select the downloaded ZIP file.
 5. Click **Install Now** and then **Activate** the plugin.
 6. Go to the plugin settings page to configure country blocking options.

#### Screenshots

Coming Soon ..

#### Changelog

 1. **Version 1.0.1** (2025-06-02)
 2.  a. Fixed IP detection logic to better handle proxy headers.
     b. Improved country code sanitization for per-post blocking.
     c. Added nonce verification to meta box save function for enhanced security.
     d. Optimized API request to `ip-api.com` with error handling improvements.
     e. Updated admin meta box UI for better usability.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“AA Block country with redirect” is open source software. The following people have
contributed to this plugin.

Contributors

 *   [ AA Extensions ](https://profiles.wordpress.org/aaextensions/)

[Translate “AA Block country with redirect” into your language.](https://translate.wordpress.org/projects/wp-plugins/aa-block-country-with-redirect)

### Interested in development?

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

## Meta

 *  Version **1.0.1**
 *  Last updated **1 year ago**
 *  Active installations **10+**
 *  WordPress version ** 5.2 or higher **
 *  Tested up to **6.8.5**
 * Tags
 * [aaextension](https://wordpress.org/plugins/tags/aaextension/)[aaextensions](https://wordpress.org/plugins/tags/aaextensions/)
   [block country](https://wordpress.org/plugins/tags/block-country/)[ip](https://wordpress.org/plugins/tags/ip/)
   [redirect](https://wordpress.org/plugins/tags/redirect/)
 *  [Advanced View](https://wordpress.org/plugins/aa-block-country-with-redirect/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/aa-block-country-with-redirect/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/aa-block-country-with-redirect/reviews/)

## Contributors

 *   [ AA Extensions ](https://profiles.wordpress.org/aaextensions/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/aa-block-country-with-redirect/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://aaextensions.com)