跳至主要內容
WordPress.org

Taiwan 正體中文

  • 佈景主題目錄
  • 外掛目錄
  • 最新消息
  • 技術支援
  • 關於我們
  • 團隊
  • 取得 WordPress
取得 WordPress
WordPress.org

Plugin Directory

Login IP & Country Restriction

  • 提交外掛
  • 我的最愛
  • 登入
  • 提交外掛
  • 我的最愛
  • 登入

Login IP & Country Restriction

由 Iulia Cazan 開發
下載
  • 詳細資料
  • 使用者評論
  • 安裝方式
  • 開發資訊
技術支援

外掛說明

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 →

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

安裝方式

  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.

使用者評論

Does what it needs to do

polfre 2026 年 7 月 5 日
Simple in use and does its job

Great plugin – works wonderfully

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.

Great plugin

laszlobartucz 2025 年 10 月 2 日
We use a hosting service that oesn't allow for easy country restrictions – this plugin is our saviour.

partially working

blackossian 2025 年 9 月 11 日
it seems it doesn't block South Africa

Not working anymore

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"

Simple but highly effective

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 則使用者評論

參與者及開發者

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

參與者
  • Iulia Cazan

〈Login IP & Country Restriction〉外掛目前已有 1 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Login IP & Country Restriction〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

變更記錄

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 for detailed information on changes made in the earlier versions.

中繼資料

  • 版本 6.8.3
  • 最後更新 5 天前
  • 啟用安裝數 8,000+
  • WordPress 版本需求 5.1 或更新版本
  • 已測試相容的 WordPress 版本 7.1.3
  • PHP 版本需求 7.4 或更新版本
  • 語言

    English (US) 及 Romanian.

    將這個外掛本地化為你的母語版本

  • 標籤:
    block countryblock ipcountry restrictionlogin restriction
  • 進階檢視

評分

4.6 星,滿分為 5 星
  • 43 個 5 星使用者評論 5 星 43
  • 3 個 4 星使用者評論 4 星 3
  • 3 個 3 星使用者評論 3 星 3
  • 2 個 2 星使用者評論 2 星 2
  • 1 個 1 星使用者評論 1 星 1

撰寫評分

查看全部使用者評論

參與者

  • Iulia Cazan

技術支援

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

檢視技術支援論壇

贊助

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

贊助這個外掛

  • 關於我們
  • 最新消息
  • 主機代管
  • 隱私權
  • 展示網站
  • 佈景主題目錄
  • 外掛目錄
  • 區塊版面配置目錄
  • Learn
  • 技術支援
  • 開發者資源
  • WordPress.tv ↗
  • 共同參與
  • 活動
  • 贊助基金會 ↗
  • Swag ↗
  • WordPress.com ↗
  • Matt ↗
  • bbPress ↗
  • BuddyPress ↗
WordPress.org

Taiwan 正體中文

The WordPress® trademark is the intellectual property of the WordPress Foundation.

  • 查看我們的 X (之前的 Twitter) 帳號
  • 造訪我們的 Bluesky 帳號
  • 造訪我們的 Mastodon 帳號
  • 造訪我們的 Threads 帳號
  • 造訪我們的 Facebook 粉絲專頁
  • Visit our Instagram account
  • Visit our LinkedIn account
  • 造訪我們的 TikTok 帳號
  • Visit our YouTube channel
  • 造訪我們的 Tumblr 帳號
程式碼,如詩