コンテンツへスキップ
Jetpack

個別の製品

セキュリティ
VaultPress Backup Scan Akismet Anti-spam
パフォーマンス
サイト検索 Boost VideoPress
成長
Stats ソーシャル ニュースレター SEO Blaze CRM
管理
Manage モバイルアプリ

製品バンドル

Pro WordPressサイト向けのセキュリティ、パフォーマンス、成長支援ツールです。 完了 より高いサービス上限を備えたJetpackの全機能。
料金
概要 Jetpack AI がサイトにできること スキル エージェントに WordPress のスーパーパワーを ドキュメント AI エージェントの接続と設定 はじめに ChatGPT、Claude、コーディングエージェントを接続 比較 Jetpack と他の WordPress MCP コネクタの比較

エージェントを接続しよう。無料です。

ChatGPT や Claude を接続して、サイトの運営を任せましょう。有料プランは不要です。

ChatGPT 版を入手 (新しいタブで開きます) または Claude を使う (新しいタブで開きます)
サポート チームによるガイドとサポート ドキュメント Jetpack の各機能の使い方ガイド 機能リクエスト Request features and vote on ideas ブログ ニュース、製品の最新情報、使い方ガイド
概要
ログイン 始める
セキュリティ
VaultPress Backup Scan Akismet Anti-spam
パフォーマンス
サイト検索 Boost VideoPress
成長
Stats ソーシャル ニュースレター SEO Blaze CRM
管理
Manage モバイルアプリ

製品バンドル

Pro 完了
料金
概要 Jetpack AI がサイトにできること スキル エージェントに WordPress のスーパーパワーを ドキュメント AI エージェントの接続と設定 はじめに ChatGPT、Claude、コーディングエージェントを接続 比較 Jetpack と他の WordPress MCP コネクタの比較

エージェントを接続しよう。無料です。

ChatGPT や Claude を接続して、サイトの運営を任せましょう。有料プランは不要です。

ChatGPT 版を入手 (新しいタブで開きます) または Claude を使う (新しいタブで開きます)
サポート チームによるガイドとサポート ドキュメント Jetpack の各機能の使い方ガイド 機能リクエスト Request features and vote on ideas ブログ ニュース、製品の最新情報、使い方ガイド
概要 検索
ログイン 始める

ブログ / Jetpack 101

How to Allowlist IP Addresses in WordPress (Step-by-Step Guide)

Jen Swisher のアバター

Jen Swisher 12月 23, 2025 · 読了時間の目安: 7分


このページの内容

  1. When to allowlist IPs in WordPress
  2. Where to allowlist IPs in WordPress
  3. Method one: Allowlist IPs using a security plugin
  4. Method two: Allowlist IPs via .htaccess (Apache)
  5. Method three: Allowlist IPs via Nginx configuration
  6. Method four: Allowlist IPs via a server firewall
  7. IP allowlisting best practices 
  8. When to allowlist, and when not to
  9. Final checkpoint before you proceed
  10. Frequently asked questions

読了時間の目安: 7分

Allowlisting IP addresses is a precise way to control who can access specific areas of your site. Whether you’re restricting access to the login page, admin dashboard, or other sensitive content, IP allowlisting adds a strict access control layer that blocks unauthorized users outright.

This guide explains how to allowlist IP addresses in WordPress manually or via a plugin, outlines the different use cases for allowlisting, and covers potential missteps to avoid. 

Note: This assumes that you’re already comfortable with basic WordPress operations and file-level changes.

When to allowlist IPs in WordPress

By default, WordPress does not limit access to the login screen or admin area. Anyone with the URL can attempt to access it, which makes it a common attack vector. Brute force login attempts, DDoS traffic, and bot scans often target /wp-login.php and /wp-admin.

But allowlisting restricts access to known IPs only. This makes it nearly impossible for unauthorized users to interact with protected areas, even if they have valid credentials or botnets. 

Here are some key use cases for IP allowlisting in WordPress:

  • Locking down the login page to office or home IPs only
  • Restricting admin dashboard access during site development
  • Controlling who can reach REST API endpoints or custom admin tools
  • Securing staging environments or hidden test pages

Where to allowlist IPs in WordPress

You can apply IP-based restrictions across multiple layers:

  • Web server configuration files: .htaccess (Apache) or nginx.conf (Nginx)
  • Security plugins: Tools that offer built-in firewall or access rules
  • Firewall-level solutions: Server-based or third-party firewalls
  • Functions.php or a custom plugin: Conditional logic in PHP (not recommended for critical restrictions)

Each method has trade-offs. File-level rules are fast and server-enforced, but harder to manage. Plugin-based methods are more user-friendly, but may be bypassed under some conditions.

Method one: Allowlist IPs using a security plugin

If you don’t have access to server configs or prefer a UI, there are plugins that offer IP allowlisting. Jetpack, for example, includes a built-in feature for managing IP allowlists, designed to work with its security and brute force protection tools.

Steps to allowlist IPs in Jetpack:

  1. Install Jetpack on your site.
  2. Navigate to Jetpack → Settings → Security.
  3. Scroll down to the section labeled “Always allowed IP addresses”.
  4. Toggle the feature On to activate IP allowlisting.
choosing "always allowed IP addresses" with Jetpack

How to format IP entries:

  • Enter each IP address in the text field.
  • Separate entries using commas, spaces, or line breaks.
  • To specify ranges, use CIDR notation (like 192.168.1.0/24) or dash-separated ranges, (like 192.168.1.10–192.168.1.100). 

Jetpack will always allow requests from these IPs, even if brute force protection or firewalls are active. This ensures that trusted users or systems won’t be blocked, even if their request patterns trigger other defenses.

Method two: Allowlist IPs via .htaccess (Apache)

If your server runs Apache, the .htaccess file lets you control access to specific files or directories.

Allowlist an IP for wp-login.php

This restricts access to the login page to specified IPs.

Steps:

  1. Open your .htaccess file, located in the root of your WordPress installation.
  2. Add the following code above the WordPress rules:
<Files wp-login.php>

    Order Deny,Allow

    Deny from all

    Allow from 123.456.789.000

    Allow from 234.567.890.123

</Files>
  • Replace the IPs with your own.
  • You can list multiple “Allow from” lines as needed.

Allowlist an IP for /wp-admin

To restrict the entire admin folder, use this code instead:

<Directory /path/to/your/site/wp-admin>

    Order Deny,Allow

    Deny from all

    Allow from 123.456.789.000

</Directory>

Important notes:

  • This can break AJAX calls and admin-ajax.php if not configured correctly.
  • To prevent this, also allow access to admin-ajax.php, using the code below. And, as always, test on a staging site prior to editing website code and make sure you have backups in place.
<Files admin-ajax.php>

    Order Allow,Deny

    Allow from all

    Satisfy any

</Files>

Method three: Allowlist IPs via Nginx configuration

If your site is hosted on Nginx, the configuration approach is similar, but with different syntax.

Restrict access to wp-login.php:

location = /wp-login.php {

    allow 123.456.789.000;

    allow 234.567.890.123;

    deny all;

}

Restrict access to wp-admin:

location /wp-admin {
    allow 123.456.789.000;
    deny all;
}

To reload Nginx after making changes, use the following:
sudo systemctl reload nginx

Avoid blocking access to admin-ajax.php under /wp-admin. You can add an exception like this:

location ~* /wp-admin/admin-ajax\.php$ {
    allow all;
}

Method four: Allowlist IPs via a server firewall

If you’re managing your own server, tools like UFW or CSF can enforce IP allowlisting at the OS level.

Example with UFW (Ubuntu):

sudo ufw allow from 123.456.789.000 to any port 80
sudo ufw allow from 123.456.789.000 to any port 443
sudo ufw deny from any to any port 80
sudo ufw deny from any to any port 443

This applies sitewide. Use with caution on shared hosting environments.

IP allowlisting best practices 

Keep an emergency access method

Always have an alternate way to regain access in case your IP changes. This could be:

  • SSH access to the server
  • SFTP access to remove .htaccess rules
  • A secondary admin IP allowlisted in advance

Don’t rely solely on IP allowlisting

IP addresses can be dynamic, shared, or spoofed. Allowlisting is effective, but not foolproof. 

Jetpack Security offers a powerful, all-in-one solution for protecting WordPress sites. It brings together real-time backups, malware scanning, a web application firewall, brute force protection, downtime monitoring, an activity log, and more — all designed to protect your site from threats and help you recover if something does go wrong. 

Because Jetpack includes so many key security tools, it’s an excellent complement to other protective measures you may already have in place. Together with strong passwords, regular updates, and IP allowlisting, Jetpack helps you create a layered security strategy that’s both comprehensive and easy to manage. 

Document every change

Track which IPs were added, when, and why. This prevents confusion when multiple admins or teams manage access controls.

When to allowlist, and when not to

Allowlisting IP addresses makes sense when your team works from fixed locations or when you’re securing a staging environment. It’s less ideal for teams that work remotely on dynamic networks or rotate VPNs often.

If you rely on mobile devices, travel, or flexible IP environments, allowlisting can cause more friction than benefit. In those cases, look to token-based access, time-based controls, or password-protected directories instead.

Final checkpoint before you proceed

Before deploying IP allowlisting, confirm that:

  • You have your current IP address on hand.
  • You’ve tested rules on a staging site.
  • You have a backup access method in case of misconfiguration.
  • You’ve logged which team members have static or dynamic IPs.

Access control is only effective when it doesn’t interfere with legitimate work. Implement with caution, audit frequently, and keep access paths predictable and minimal.

Frequently asked questions

What is the difference between allowlisting and whitelisting an IP address?

Allowlisting and whitelisting refer to the exact same process. Whitelisting is the older term that people used for many years. It means creating a list of approved users or IP addresses that are permitted to access your website.

The tech industry has started using the word allowlist instead because it is clearer and more inclusive language. Both terms mean you are blocking everyone else by default and only letting in the specific people on your list. You might see these words used interchangeably in plugin settings or server documentation.

How do I find my own IP address to add it to the allowlist?

Finding your IP address is very simple. You can open a new tab in your web browser and search for “what is my IP” on Google. The search results will show a string of numbers at the very top of the page.

This is your public IP address. If you see a long string of letters and numbers combined, that is likely an IPv6 address. Most hosting companies and security plugins accept both the shorter IPv4 format and the longer IPv6 format. You should copy this number exactly as it appears.

What happens if my IP address changes after I set up an allowlist?

If your internet service provider changes your IP address, you will get locked out of your own website. This happens because your new IP is not on the list of approved visitors. You will likely see a 403 Forbidden error message when you try to log in.

To fix this, you need to access your website files using an FTP client or the file manager in your hosting account. You must open the .htaccess file and manually update the code with your new IP address. If you travel often or have a dynamic IP, using a plugin for security is safer than hard-coding rules into your server files.

Can I allowlist an entire range of IP addresses instead of just one?

Yes, you can allow a whole group of addresses. This is helpful for offices or schools where many computers share a network. You do this using something called CIDR notation. It looks like a normal IP address but ends with a slash and a number, such as /24.

For example, using 192.168.1.0/24 covers every address from 192.168.1.0 to 192.168.1.255. You should be careful with this method. If you make the range too wide, you might accidentally let in attackers who are on the same network provider as you.

Will allowlisting IP addresses stop all hackers from attacking my site?

Allowlisting is a strong security measure, but it does not stop everything. It is great for stopping brute force attacks where bots try to guess your password. It works because the bots cannot even see your login page to try a password.

However, it does not fix weak passwords or outdated plugins. Hackers can still find other ways to break in if you have vulnerable software installed. You should think of IP allowlisting as one layer of protection. You still need to keep your themes & plugins updated to stay safe, and install a reliable security plugin like Jetpack Security.

いいね 読み込み中…
Jen Swisher のアバター

Written by

Jen Swisher

Jen is a Customer Experience Specialist for Jetpack. She has been working with WordPress and Jetpack for over a decade. Before starting at Automattic, Jen helped small businesses, local non-profits, and Fortune 50 companies create engaging web experiences for their customers. She is passionate about teaching others how to create on the web without fear.

サイトは私たちが守ります。
あなたはビジネスに集中できます。

Jetpack Security は、リアル‑タイムバックアップ、Web アプリケーションファイアウォール、マルウェアスキャン、スパム対策など、使いやすく包括的な WordPress サイトセキュリティを提供します。

サイトを保護する

Questions about this post? Ask in the support forum

シェア


Keep reading.

More from Jetpack 101, newest first.

すべての投稿を見る

Jetpack 101 3月 31, 2026

WordPress Image SEO: 12 Techniques to Rank Higher & Load Faster

Are images helping or hurt…

Jen Swisher のアバター Jen Swisher 読了時間の目安: 14分

Jetpack 101 3月 26, 2026

WordPress Site Redirecting to Spam? Here’s How to Fix a Hacked Site

Uncover hidden malware, re…

Jen Swisher のアバター Jen Swisher 読了時間の目安: 12分

Jetpack 101 3月 24, 2026

WordPress Form with File Upload: How to Create One in 3 Steps

How to create a secure fil…

Jen Swisher のアバター Jen Swisher 読了時間の目安: 5分

AI ファーストで WordPress サイトを運営しよう。

Free to start, and AI agents are free to connect. Money back within 14 days on yearly plans.

始める Jetpack を無料で入手

WordPress プラグイン

  • Akismet アンチスパム↗ (新しいタブで開きます)
  • Jetpack↗ (新しいタブで開きます)
  • Jetpack ブースト↗ (新しいタブで開きます)
  • Jetpack CRM↗ (新しいタブで開きます)
  • Jetpack プロテクト↗ (新しいタブで開きます)
  • Jetpack 検索↗ (新しいタブで開きます)
  • Jetpack ソーシャル↗ (新しいタブで開きます)
  • Jetpack VideoPress↗ (新しいタブで開きます)
  • VaultPress バックアップ↗ (新しいタブで開きます)
  • WP Super Cache↗ (新しいタブで開きます)
  • ダウンロード

AI

  • Jetpack AI
  • スキル
  • WordPress MCP

パートナー

  • パートナープログラム
  • おすすめのホスティング事業者
  • ホスティング事業者向け
  • 代理店向け
  • アフィリエイト向け

開発者

  • ドキュメント↗ (新しいタブで開きます)
  • ベータプログラム
  • GitHub の Jetpack↗ (新しいタブで開きます)

ヘルプ

  • ナレッジベース
  • フォーラム↗ (新しいタブで開きます)
  • レビューとお客様の声
  • お問い合わせ
  • Jetpack について
  • プレス
言語を選択 日本語
  • English
  • Deutsch
  • Español
  • Français
  • 日本語

© 2026 Automattic Inc. 無断転載を禁じます。

  • 利用規約↗ (新しいタブで開きます)
  • プライバシーポリシー↗ (新しいタブで開きます)
  • GDPR

によって心を込めて制作されています。

App Storeからダウンロード Google Playで入手
コメントを読み込み中…
  • リブログ
  • 定期購入 開始日
    Jetpack
    53,354人の購読者に加わりましょう

    WordPress.com のアカウントをお持ちですか ? 今すぐログインしてください。

  • Jetpack
    短縮リンクをコピーReader で投稿を表示
    購読管理登録ログイン
    このコンテンツを報告
    このバーを折りたたむ
%d