Title: Login IP &amp; Country Restriction
Author: Iulia Cazan
Published: <strong>2014 年 11 月 4 日</strong>
Last modified: 2026 年 10 月 21 日

---

搜尋外掛

![](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

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

[下載](https://downloads.wordpress.org/plugin/login-ip-country-restriction.6.8.4.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/login-ip-country-restriction/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/login-ip-country-restriction/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/login-ip-country-restriction/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/login-ip-country-restriction/#developers)

 [技術支援](https://wordpress.org/support/plugin/login-ip-country-restriction/)

## 外掛說明

**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.

## 螢幕擷圖

[⌊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.

[⌊Integration settings and details.⌉⌊Integration settings and details.⌉[

Integration settings and details.

## 安裝方式

 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.

## 常見問題集

### 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.

## 使用者評論

![](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/) 2026 年 7 月 5 日

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/) 2025 年 11 月 10 日

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/) 2025 年 10 月 2 
日

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/) 2025 年 9 月 11 日

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/) 2025 年 8 月 28 日

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/) 2025 年 2 月 16 日

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

 [ 閱讀全部 52 則使用者評論 ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Login IP & Country Restriction〉的開發相關工作。

參與者

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

〈Login IP & Country Restriction〉外掛目前已有 1 個本地化語言版本。 感謝[全部譯者](https://translate.wordpress.org/projects/wp-plugins/login-ip-country-restriction/contributors)
為這個外掛做出的貢獻。

[將〈Login IP & Country Restriction〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/login-ip-country-restriction)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/login-ip-country-restriction/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/login-ip-country-restriction/)，
或透過 [RSS](https://plugins.trac.wordpress.org/log/login-ip-country-restriction/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/login-ip-country-restriction/)。

## 變更記錄

#### 6.8.4

 * Tested up to 7.2
 * Highlighted the currently active detection method in the intergation tab
 * Assets updates

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

## 中繼資料

 *  版本 **6.8.4**
 *  最後更新 **3 週前**
 *  啟用安裝數 **8,000+**
 *  WordPress 版本需求 ** 5.1 或更新版本 **
 *  已測試相容的 WordPress 版本 **7.2**
 *  PHP 版本需求 ** 7.4 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/login-ip-country-restriction/) 及
   [Romanian](https://ro.wordpress.org/plugins/login-ip-country-restriction/).
 *  [將這個外掛本地化為你的母語版本](https://translate.wordpress.org/projects/wp-plugins/login-ip-country-restriction)
 * 標籤:
 * [block country](https://tw.wordpress.org/plugins/tags/block-country/)[block ip](https://tw.wordpress.org/plugins/tags/block-ip/)
   [country restriction](https://tw.wordpress.org/plugins/tags/country-restriction/)
   [login restriction](https://tw.wordpress.org/plugins/tags/login-restriction/)
 *  [進階檢視](https://tw.wordpress.org/plugins/login-ip-country-restriction/advanced/)

## 評分

 4.6 星，滿分為 5 星

 *  [  43 個 5 星使用者評論     ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/?filter=5)
 *  [  3 個 4 星使用者評論     ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/?filter=4)
 *  [  3 個 3 星使用者評論     ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/?filter=3)
 *  [  2 個 2 星使用者評論     ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/?filter=2)
 *  [  1 個 1 星使用者評論     ](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/?filter=1)

[撰寫評分](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/login-ip-country-restriction/reviews/)

## 參與者

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

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/login-ip-country-restriction/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JJA37EHZXWUTJ)