For the bigger picture, our Complete Guide to WordPress How pulls everything together.
The WordPress admin dashboard is the highest-value target on any WordPress site. Every piece of content, every plugin, every setting, every user account is accessible from/wp-admin/ — and attackers know it. The login page at /wp-login.php is hit by automated brute-force scripts on virtually every publicly accessible WordPress installation, constantly probing for weak passwords and default usernames. To secure WordPress admin access effectively is to close these known attack vectors methodically, in layers, so that no single measure’s failure creates a breach. I have hardened WordPress admin access on sites across many different hosting environments, and the approach that works is not complex — it is consistent. The measures in this guide to secure WordPress admin deployments are largely free, most take under ten minutes to implement, and together they transform the admin panel from an accessible target into a significantly hardened entry point that automated attacks cannot breach and manual attacks are not worth attempting.
Change the Default Admin Credentials and Login URL
The single most important step to secure WordPress admin access is eliminating the default attack surface. WordPress installs with a default admin account named “admin” — every brute-force script knows this and tries it first. A username of “admin” combined with any password reduces the attack to a single-variable guessing problem. Changing the username to something not guessable is the first fundamental change to secure WordPress admin effectively.- Log in to the WordPress admin panel
- Go to Users → Add New User. Create a new user account with a non-guessable username — your name, a phrase, anything that is not “admin” or “administrator.” Set the role to Administrator and set a strong, unique password using the password generator.
- Log out and log back in as the new administrator account
- Go to Users → All Users, find the original “admin” account, and delete it. When prompted to reassign its content, select the new administrator account to ensure no content is lost
- Change the login URL from the default
/wp-login.php: install the WPS Hide Login plugin (free; WordPress Plugin Directory). Navigate to Settings → WPS Hide Login and set a custom login URL — something non-guessable like/my-site-panelor a random string. Save Changes. - Test the new login URL immediately by opening a new incognito browser tab and navigating to it. Confirm it loads the WordPress login form. Confirm that navigating to
/wp-login.phpnow returns a 404 error. - Record the new login URL somewhere secure — if it is forgotten and you are logged out, recovery requires FTP access to deactivate the plugin
/wp-login.php in their attack sequence. These tools simply move on when the default URL returns a 404 — they do not attempt to discover the custom URL. This does not mean the custom login URL makes the site invulnerable, but it eliminates the automated attack category that accounts for the vast majority of login-targeted traffic on WordPress sites. Combine it with a strong unique admin password to secure WordPress admin login against both automated and targeted manual attacks.
Two-Factor Authentication — The Most Impactful Single Measure to Secure WordPress Admin
Two-factor authentication (2FA) on all admin accounts is the highest-impact single measure available to secure WordPress admin access. Even if an attacker obtains the correct username and password — through a data breach, a phishing attack, or an exhaustive brute-force on a weak password — 2FA makes those credentials insufficient. The second factor (a time-based one-time password from an authenticator app) is required to complete the login, and it cannot be obtained without physical access to the admin’s device.| 2FA Method | Security Level | Convenience | Implementation |
|---|---|---|---|
| TOTP authenticator app (Google Authenticator, Authy) | Very high | Good — app generates codes offline | Two Factor plugin or WP 2FA plugin |
| Email code | Medium — depends on email account security | Good — no additional app needed | Two Factor plugin (email provider option) |
| SMS code | Medium — vulnerable to SIM swap attacks | Good — no app needed | Requires paid SMS API integration |
| Hardware security key (YubiKey) | Highest — phishing resistant | Lower — requires physical key | Two Factor plugin (FIDO U2F option) |
IP Restrictions and Access Control to Secure WordPress Admin
Restricting access to/wp-admin/ and /wp-login.php to specific IP addresses is the most aggressive measure available to secure WordPress admin access — it makes the admin panel completely inaccessible from any IP not on the whitelist, regardless of whether the correct credentials are known. This measure is highly effective on sites where all administrators work from predictable, static IP addresses (office networks, dedicated static residential IPs), and impractical on sites where administrators frequently work from different locations or dynamic IPs.
The .htaccess implementation on Apache servers adds these rules above the WordPress default block in the .htaccess file in the WordPress root:
# Secure WordPress Admin — IP restriction
<Files wp-login.php>
Order deny,allow
Deny from all
Allow from YOUR.IP.ADDRESS.HERE
</Files>
<IfModule mod_rewrite.c>
RewriteRule ^wp-admin/$ - [L]
RewriteCond %{REMOTE_ADDR} !^YOUR.IP.ADDRESS.HERE$
RewriteRule ^wp-admin/ - [F,L]
</IfModule>
Replace YOUR.IP.ADDRESS.HERE with your actual static IP address. Multiple IP addresses can be added with additional Allow from lines. After saving the .htaccess file, test the restriction by visiting /wp-admin/ from your whitelisted IP (should load) and from a mobile network or VPN (should return 403 Forbidden). This configuration to secure WordPress admin through IP restriction is one of the most effective available — no credentials, no matter how strong, can bypass a 403 response from the web server level. The trade-off is operational inflexibility: working from a new location requires either updating the whitelist via FTP or using a VPN to connect from a known IP first.
Login Rate Limiting to Protect Against Brute Force
Even with a custom login URL, 2FA, and strong passwords in place, a login rate-limiting configuration adds a further barrier that protects against future attack methods. Rate limiting blocks an IP address after a configurable number of failed login attempts, preventing any systematic credential guessing regardless of how sophisticated the guessing algorithm is — you simply cannot try 10,000 passwords per second if you are blocked after 5 attempts. This is foundational to secure WordPress admin access against brute-force at any scale. Limit Login Attempts Reloaded (free; 2+ million active installations; WordPress Plugin Directory) provides rate limiting with sensible defaults: four allowed retries, 20-minute lockout after the first lockout, 24-hour lockout after three consecutive lockouts. Install the plugin, navigate to Settings → Limit Login Attempts, and verify the default values or adjust them — five retries before a 30-minute lockout is the standard recommendation to secure WordPress admin against brute-force while not excessively inconveniencing legitimate users who occasionally mistype their password. Cloudflare’s rate limiting (available on the free plan’s basic rules or more granularly on paid plans) provides network-level rate limiting that blocks requests before they reach the WordPress server. This is more effective than a plugin-based approach because it stops the traffic at the network edge — the server’s resources are not consumed processing blocked requests. If Cloudflare is in front of the site, configure a rate limiting rule for POST requests to/wp-login.php and the custom login URL — limiting to 5 POST requests per minute per IP is restrictive enough to stop brute-force while allowing normal login flow to proceed. Cloudflare-level rate limiting and plugin-level rate limiting together provide defense in depth for how to secure WordPress admin against persistent login attacks.
User Role Auditing and Privilege Minimisation
The Administrator role in WordPress provides complete access to every setting, plugin, theme, and user account. Every user who holds the Administrator role is a potential attack vector — if any admin account is compromised, the attacker has full site control. Auditing user roles and ensuring the principle of least privilege is applied — giving each user only the access they need for their specific function — meaningfully reduces the blast radius of any single account compromise and is an important but often overlooked part of how to secure WordPress admin properly. Regular user role audit actions to secure WordPress admin user access:- Review all users with Administrator role: Go to Users → All Users → filter by Administrator. Remove Administrator role from any user who does not actively need full site access — give them Editor role instead if they only need to create and manage content
- Remove inactive accounts: Identify accounts for users who no longer work with the site — former contractors, previous developers, old client contacts. Delete these accounts immediately. Each inactive account is a potential attack vector with no active monitoring
- Audit application passwords: WordPress 5.6+ allows application passwords for API access. Go to Users → Your Profile → Application Passwords and review all active application passwords. Revoke any that are no longer in use
- Review editor and author accounts: Confirm every non-admin account is associated with a known, currently active user. Accounts with no associated real person should be deleted
- Change all passwords after any security event: After a suspected compromise, plugin-detected malware, or any event indicating potential unauthorized access — force password resets for all admin accounts. The security key rotation in wp-config.php invalidates all existing sessions simultaneously





