Title: Login IP &amp; Country Restriction
Author: Iulia Cazan
Published: <strong>4. november, 2014</strong>
Last modified: 9. oktober, 2026

---

Søg plugins

![](https://ps.w.org/login-ip-country-restriction/assets/banner-772x250.png?rev=
1073320)

![](https://ps.w.org/login-ip-country-restriction/assets/icon-128x128.gif?rev=2355666)

# Login IP & Country Restriction

 Af [Iulia Cazan](https://profiles.wordpress.org/iulia-cazan/)

[Download](https://downloads.wordpress.org/plugin/login-ip-country-restriction.6.8.3.zip)

 * [Detaljer](https://da.wordpress.org/plugins/login-ip-country-restriction/#description)
 * [Vurderinger](https://da.wordpress.org/plugins/login-ip-country-restriction/#reviews)
 *  [Installation](https://da.wordpress.org/plugins/login-ip-country-restriction/#installation)
 * [Udvikling](https://da.wordpress.org/plugins/login-ip-country-restriction/#developers)

 [Support](https://wordpress.org/support/plugin/login-ip-country-restriction/)

## Beskrivelse

**Login IP & Country Restriction** hooks into the WordPress authentication system
to give you complete control over who can even attempt to access your login page.
By default, all access is allowed until you configure specific rules to whitelist
or blacklist logins by explicit IP addresses or entire countries.

This plugin is highly effective at stopping massive botnet brute-force attempts 
before they strain your server resources.

### 🔒 Core Features (100% Free)

 * **IP Restriction:** Allow or block specific IP addresses (supports local loops
   like 127.0.0.1 and IPv6).
 * **Country Restriction:** Whitelist or blacklist entire countries from accessing
   the authentication filters.
 * **Independent Logic:** Run IP rules only, country rules only, or combine both
   together for maximum security.
 * **Smart Redirects:** Configure custom behavior to automatically redirect restricted
   traffic back to the front page.
 * **XML-RPC Protection:** Secure authentication methods beyond standard web forms.
 * **Data Portability:** Quickly export and import your security settings, and check
   status details for debugging.

### 💎 Take Your Security Further with Pro

**Login IP & Country Restriction Pro** adds:
 * Additional rule types * Redirect
restricted login (404 or 403 with a custom message) * Lockout duration and individual
user lockout * WooCommerce integration (automatically allow the countries of new
customers) * Bypass the IP and country restrictions for specific roles * Single 
IP login per user * Simulate an IP or country to test your rules

[Explore Login IP & Country Restriction Pro ](https://iuliacazan.ro/wordpress-extension/login-ip-country-restriction-pro/)

_Important Safety Note:_ Please ensure you always configure the plugin to allow 
your own IP address or country before locking down settings so you do not accidentally
lock yourself out!

### License

This program is distributed in the hope that it will be useful, but WITHOUT ANY 
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE.

## Skærmbilleder

[⌊Main configuration dashboard for login restriction rules and XML-RPC methods.⌉⌊
Main configuration dashboard for login restriction rules and XML-RPC methods.⌉[

Main configuration dashboard for login restriction rules and XML-RPC methods.

[⌊IP restriction interface showing easy management of allowed and blocked IPs.⌉⌊
IP restriction interface showing easy management of allowed and blocked IPs.⌉[

IP restriction interface showing easy management of allowed and blocked IPs.

[⌊Country restriction panel with simple multi-select dropdowns for whitelists and
blacklists.⌉⌊Country restriction panel with simple multi-select dropdowns for whitelists
and blacklists.⌉[

Country restriction panel with simple multi-select dropdowns for whitelists and 
blacklists.

[⌊Redirect settings to manage blocked visitors.⌉⌊Redirect settings to manage blocked
visitors.⌉[

Redirect settings to manage blocked visitors.

[⌊Tools layout for importing/exporting configurations and reviewing debug details.⌉⌊
Tools layout for importing/exporting configurations and reviewing debug details.⌉[

Tools layout for importing/exporting configurations and reviewing debug details.

## Installation

 1. Upload the `login-ip-country-restriction` folder to the `/wp-content/plugins/` 
    directory.
 2. Activate the plugin through the **Plugins** menu in WordPress.
 3. Navigate to the new settings panel to set up your allowed IPs and countries.

## FAQ

### Do I need a third-party API key for this plugin to work?

No. Out of the box the plugin uses the PHP GeoIP extension when it is available 
on the server, otherwise the free ipapi.co lookup. Optionally, you can add API keys
for the geolocated.io, ip2location.io or geoplugin.net services in the integration
settings. The lookup method that works for your server is remembered for a few hours.

### My site is behind Cloudflare, what should I do?

Enable the option to trust the Cloudflare visitor IP (HTTP_CF_CONNECTING_IP) in 
the IPs settings. Enable it only if the site is really behind Cloudflare, because
otherwise visitors could spoof that header. Sites that were already using the plugin
keep this enabled until the settings are saved.

### Can I block both an IP and a country at the same time?

Yes. Both types of restrictions work entirely independently of one another. You 
can restrict by country, whitelist a few specific external IPs, or use both methods
simultaneously.

### Help! I locked myself out. What do I do?

If you accidentally lock yourself out by misconfiguring your country or IP whitelist,
don’t panic. Simply log into your server via FTP or hosting File Manager, rename
the plugin folder from `login-ip-country-restriction` to `login-ip-country-restriction-
temp` to temporarily disable it, log back into WordPress, rename it back, and correct
your configuration.

## Anmeldelser

![](https://secure.gravatar.com/avatar/d298ee618edc144f7025ac87ddd5c57b35f23cf2370321087c0138f9fb21d449?
s=60&d=retro&r=g)

### 󠀁[Does what it needs to do](https://wordpress.org/support/topic/does-what-it-needs-to-de/)󠁿

 [polfre](https://profiles.wordpress.org/polfre/) 5. juli, 2026

Simple in use and does its job

![](https://secure.gravatar.com/avatar/b7ffc57891e893bf72fe02883fc8c691a26fe68ac74f8a3811b0bf233655d627?
s=60&d=retro&r=g)

### 󠀁[Great plugin – works wonderfully](https://wordpress.org/support/topic/great-plugin-works-wonderfully-2/)󠁿

 [dany84](https://profiles.wordpress.org/dany84/) 10. november, 2025

The plugin stopped all bot attempts to log in onto my website, and I am no longer
invaded by notifications of those failed attempts.

![](https://secure.gravatar.com/avatar/8cae88355d56606013b26a6b845fda86fdf8e8b0f699b35cd7e475be4c90ba1f?
s=60&d=retro&r=g)

### 󠀁[Great plugin](https://wordpress.org/support/topic/great-plugin-40900/)󠁿

 [laszlobartucz](https://profiles.wordpress.org/laszlobartucz/) 2. oktober, 2025

We use a hosting service that oesn't allow for easy country restrictions – this 
plugin is our saviour.

![](https://secure.gravatar.com/avatar/9d908288d23f4379a903465e16a0540e1f02c4a23c9d0303b05cef01039eda05?
s=60&d=retro&r=g)

### 󠀁[partially working](https://wordpress.org/support/topic/partially-working-12/)󠁿

 [blackossian](https://profiles.wordpress.org/blackossian/) 11. september, 2025

it seems it doesn't block South Africa

![](https://secure.gravatar.com/avatar/03137cce9470b164a98a6bcac85cc4e9993081e16b06046887f9c6f3a9fa6add?
s=60&d=retro&r=g)

### 󠀁[Not working anymore](https://wordpress.org/support/topic/not-working-anymore-265/)󠁿

 [eevan79](https://profiles.wordpress.org/eevan79/) 28. august, 2025

Edit: Rating changed because the add-on has been updated and now works. This plugin
uses the geoplugin.net service, which is no longer free, so the plugin no longer
works either. This is a message: "geoPlugin API is no longer available for free 
use. To continue access, please upgrade to a paid plan"

![](https://secure.gravatar.com/avatar/659912d850cba3761fc54496516974d273d4938557ac273fe576d6acc97162f9?
s=60&d=retro&r=g)

### 󠀁[Simple but highly effective](https://wordpress.org/support/topic/simple-but-highly-effective-4/)󠁿

 [mtido](https://profiles.wordpress.org/mtido/) 16. februar, 2025

I had an increase in incorrect login attempts, it started with a few and then quickly
escalated to over 600 per day. From another plugin came the hint with GEO blocking
by IP, then I came across this plugin and then had everything blocked except for
my own country. Finally only 1-2 per day. Thank you

 [ Læs alle 52 anmeldelser ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/)

## Bidragsydere & udviklere

“Login IP & Country Restriction” er open source-software. Følgende personer har 
bidraget til dette plugin.

Bidragsydere

 *   [ Iulia Cazan ](https://profiles.wordpress.org/iulia-cazan/)

“Login IP & Country Restriction” er blevet oversat til 1 sprog. Tak til [oversætterne](https://translate.wordpress.org/projects/wp-plugins/login-ip-country-restriction/contributors)
for deres bidrag.

[Oversæt “Login IP & Country Restriction” til dit eget sprog.](https://translate.wordpress.org/projects/wp-plugins/login-ip-country-restriction)

### Interesseret i udvikling?

[Gennemse koden](https://plugins.trac.wordpress.org/browser/login-ip-country-restriction/),
tjek [SVN repository](https://plugins.svn.wordpress.org/login-ip-country-restriction/),
eller abonner på [udviklerloggen](https://plugins.trac.wordpress.org/log/login-ip-country-restriction/)
via [RSS](https://plugins.trac.wordpress.org/log/login-ip-country-restriction/?limit=100&mode=stop_on_copy&format=rss).

## Ændringslog

#### 6.8.3

 * Tested up to 7.1
 * Security hardening: validate the detected IP, capability check on settings save
 * Added the opt-in option to trust the Cloudflare visitor IP header (existing installs
   keep the current behavior until settings are saved)
 * Fixed the multisite transients cleanup query
 * Fixed the registration redirect also applying to the login page
 * Pro: WooCommerce customers countries collection is compatible with HPOS order
   storage (the classic storage is still supported)
 * Pro: the lockout duration now locks the user out after a restricted login attempt(
   the country lookup cache is now fixed at 1 hour); saving the settings clears 
   the lockouts
 * Lower timeout and proper Accept header for IP lookups

See the full [changelog](https://da.wordpress.org/plugins/login-ip-country-restriction/changelog.txt?output_format=md)
for detailed information on changes made in the earlier versions.

## Meta

 *  Version **6.8.3**
 *  Senest opdateret **1 uge siden**
 *  Aktive installationer **8.000+**
 *  WordPress-version ** 5.1 eller højere **
 *  Testet op til **7.1.3**
 *  PHP-version ** 7.4 eller højere **
 *  Sprog
 * [English (US)](https://wordpress.org/plugins/login-ip-country-restriction/) og
   [Romanian](https://ro.wordpress.org/plugins/login-ip-country-restriction/).
 *  [Oversæt til dit sprog](https://translate.wordpress.org/projects/wp-plugins/login-ip-country-restriction)
 * Tags
 * [block country](https://da.wordpress.org/plugins/tags/block-country/)[block ip](https://da.wordpress.org/plugins/tags/block-ip/)
   [country restriction](https://da.wordpress.org/plugins/tags/country-restriction/)
   [login restriction](https://da.wordpress.org/plugins/tags/login-restriction/)
 *  [Avanceret visning](https://da.wordpress.org/plugins/login-ip-country-restriction/advanced/)

## Bedømmelser

 4.6 ud af 5 stjerner.

 *  [  43 5-stjernet anmeldelser     ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/?filter=5)
 *  [  3 4-stjernet anmeldelser     ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/?filter=4)
 *  [  3 3-stjernet anmeldelser     ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/?filter=3)
 *  [  2 2-stjernet anmeldelser     ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/?filter=2)
 *  [  1 1-stjernet anmeldelse     ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/?filter=1)

[Din anmeldelse](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/#new-post)

[Se alle anmeldelser](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/)

## Bidragsydere

 *   [ Iulia Cazan ](https://profiles.wordpress.org/iulia-cazan/)

## Support

Har du noget at sige? Har du brug for hjælp?

 [Vis supportforum](https://wordpress.org/support/plugin/login-ip-country-restriction/)

## Donér

Vil du gerne støtte udviklingen af dette plugin?

 [ Donér til dette plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JJA37EHZXWUTJ)