How to restrict WordPress administrator access through IP address
Apr 20, 2025 am 07:09 AMDo you want to limit access to WordPress admin zones for security reasons?
If you have a small team, a good solution is to limit access to only IP addresses used by team members.
In this article, we will show you how to restrict WordPress administrator access through an IP address.
Why restrict WordPress administrator access through IP addresses?
If you are running a WordPress website, you need to take the security of your website seriously. While WordPress core software is very secure, there are more you can do to protect yourself from hackers.
Hackers can shut down your website and damage your income and reputation. They can steal data, even distribute malware to your website visitors, and blacklist your domain by Google and others.
A wise way to stop hackers is to protect your WordPress admin area from unauthorized access.
If only you or a few trusted users need access to the administrative area, a good way is to restrict access to wp-admin to your team's IP address.
Each team member will connect to your website using a specific IP address for each location. If you block access to all other IP addresses, even if the hacker discovers your username and password, they will not be able to access your website.
Instead, they will see the error message: "Forbidden". You do not have access to this resource. ”
Let's see how to restrict WordPress administrator access through IP addresses.
How to limit WordPress administrator access through IP address
The first thing you need to do is list the IP addresses that everyone needs to log into the WordPress website. If someone works in multiple locations, you will need to collect the IP address for each location.
They can learn about their IP addresses by visiting websites such as SupportAlly.
After you have created your list, you will need to edit the files on the website. You must use the FTP client or hosting provider's file manager application. If you haven't used FTP before, you may want to check out our guide on how to upload files to WordPress using FTP.
You will need to use the software to navigate to your website's /wp-admin/ folder. Once you get there, you should look for that .htaccess file. This is a hidden file, so if you can't see it, you may need to enable the "Show hidden files" option in your software.
.htaccess If the file does not exist in that folder, you should create a new file and save it with the name in the folder /wp-admin/.
Warning : Do not edit your root .htaccess file, or you will not be able to access the front end of your website! Make sure you are editing /wp-admin/.htaccess.
You should first download a copy of the file to your computer as a backup. Once you have done this you will need to edit the .htaccess and paste the following code:
AuthUserFile /dev/nullAuthGroupFile /dev/nullAuthName "WordPress Admin Access Control"AuthType Basic<limit get>order deny,allowdeny from all# whitelist Syed's IP addressallow from xx.xx.xx.xxx# whitelist David's IP addressallow from xx.xx.xx.xxx# whitelist Amanda's IP addressallow from xx.xx.xx.xxx# whitelist Muhammad's IP addressallow from xx.xx.xx.xxx# whitelist Work IP addressallow from xx.xx.xx.xxx</limit>
Continue editing the file to match the names of your own team members, and paste the IP address you collected earlier to replace the location where it appears xx.xx.xx.xxx.xxx.
After saving the file, only these IP addresses can access the WordPress administrator.
Remember that if your IP address changes or you try to access your website from a new location, you will be locked out of the WordPress admin area. You need to add the new IP address to the file /wp-admin/.htaccess .
We hope this tutorial helps you understand how to limit access to WordPress administrators with IP addresses. You may also want to learn how to get a free SSL certificate for your website, or check out our list of must-have plugins to grow your website.
The above is the detailed content of How to restrict WordPress administrator access through IP address. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

?In today's increasingly popular digital asset trading, it is particularly important to understand how to safely and effectively withdraw your digital assets. As a world-renowned digital asset trading platform, ok exchange provides convenient currency withdrawal services. This tutorial will analyze in detail the steps of withdrawing coins on the ok exchange, things to note, and some common questions and answers to help users complete asset transfer smoothly and ensure asset security. Whether you are using ok exchange for withdrawals for the first time or want to further understand the withdrawal process, this article will provide you with clear and practical guidance.

The latest version of Digital Currency Exchange 2025 is a world-leading digital asset trading application, committed to providing users with secure, stable and convenient trading services for mainstream digital currencies such as Bitcoin and Ethereum. Its simple and intuitive operation interface and powerful functional modules make it easy for both novices and senior traders to get started.

The latest version of Binance is v2.102.5, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.

The latest version of Binance is v2.102.5, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.

As July 2025 approaches, the crypto market is hotly discussing which tokens may bring high returns. Are names like Pi, PEPE and FloppyPepe really worth the risky investment? Potential cryptocurrencies worth paying attention to in July 2025: virtual fire or real gold? As mid-2025, the heat of discussions on high-yield crypto assets continues to heat up. Bitcoin trends and "altcoin season" expectations have attracted investors' attention. Do tokens like PiNetwork, PEPE and FloppyPepe have the potential to bring considerable investment returns? Let's analyze its prospects one by one. Altcoin Market: Can July get what it wants? Against the backdrop of Bitcoin’s expected record of historical highs, the “altcoin season” seems to be brewing. Back

The latest version of Binance is 2.101.8, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.

The latest version of Binance is 2.101.8, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.

Polkadot is causing heated discussion on the stage of DeFi and cross-chain integration! Let’s analyze its underlying technical structure, ecological construction progress, and the core driving force that helps DOT move towards its $5 price target. Polkadot, DeFi and Cross-chain: Observation from New York, Polkadot is setting off a new wave of craze in the DeFi and cross-chain fields. The crypto market is changing, but DOT is gradually emerging. Next we will explore the factors behind its rise. Interoperability: Polkadot's core competitiveness Polkadot's most significant advantage is its ability to connect and connect with different blockchains. You can compare it to being a universal world of blockchain
