🚨 The 5 Most Critical Steps
1. Enable 2FA: Blocks 99.9% of brute force attacks, even if passwords are compromised.
2. Limit login attempts: Block IPs after 3-5 failed attempts. Stops automated attacks instantly.
3. Use strong, unique passwords: 16+ characters via a password manager. Never reuse passwords.
4. Keep everything updated: 29% of hacks exploit outdated plugins. Enable auto-updates.
5. Change the default admin username: Delete the "admin" account; it's the first username bots try.
Why wp-admin Is the #1 Target
WordPress powers 43% of all websites, making /wp-admin the most targeted login page on the internet. Attackers know the exact URL, the default username ("admin"), and have databases of billions of leaked passwords to try.
of WordPress hacks are brute force login attacks
exploit vulnerable or outdated plugins
target outdated WordPress core versions
exploit weak hosting, themes, or file permissions
Change the Default Login URL
Every WordPress site uses /wp-login.php and /wp-admin/ by default. Changing this eliminates 90%+ of automated bot attacks that blindly target these URLs.
Using WPS Hide Login (Recommended)
- Install and activate WPS Hide Login (200K+ installs, free)
- Go to Settings → WPS Hide Login
- Change the login URL to something unique (e.g.,
/my-secret-login) - Set the redirection URL (where
/wp-adminredirects to; use a 404 page) - Bookmark your new login URL: you won't be able to access the old one
⚠️ Important: This is security through obscurity, it stops bots but not targeted attacks. Always combine with 2FA and login limiting. If you use a caching plugin, clear the cache after changing the URL.
Enforce Strong Passwords
| Password Type | Length | Crack Time | Verdict |
|---|---|---|---|
| password123 | 11 chars | < 1 second | ❌ Instant crack |
| MyDog$Name2024 | 14 chars | ~3 hours | ❌ Dictionary attack |
| Tr0ub4dor&3 | 11 chars | ~3 days | ⚠️ Predictable substitutions |
| correct-horse-battery-staple | 28 chars | ~550 years | ✅ Good passphrase |
| kX9#mP2$vL7@nQ4&jR8 | 20 chars | ~3 billion years | ✅ Generated password |
Password Policy Best Practices
- Use a password manager (1Password, Bitwarden), generate unique 20+ char passwords for every account
- Require all admin/editor users to use password managers (enforce via policy)
- Never share passwords via email, Slack, or text; use the password manager's sharing feature
- Check passwords against breach databases (Have I Been Pwned), compromised passwords are tried first
- WordPress generates strong passwords by default, don't let users override with weak ones
Enable Two-Factor Authentication (2FA)
2FA is the single most effective security measure you can implement. Even if an attacker gets your password, they can't log in without the second factor. Google reports that TOTP-based 2FA blocks 99.9% of automated attacks.
| Plugin | Price | Methods | Best For |
|---|---|---|---|
| WP 2FA | Free / $29/yr | TOTP, Email, Backup codes | Best overall, clean UI, role-based enforcement |
| Two-Factor (core team) | Free | TOTP, Email, FIDO U2F | Lightweight, built by WordPress contributors |
| Wordfence Login Security | Free | TOTP, reCAPTCHA | If already using Wordfence firewall |
| miniOrange 2FA | Free / $59/yr | TOTP, SMS, Push, Security Q | Most 2FA methods, enterprise features |
Recommendation: Use TOTP (time-based one-time passwords) with an app like Google Authenticator, Authy, or 1Password. Avoid SMS-based 2FA; it's vulnerable to SIM swapping attacks. Always generate and securely store backup codes in case you lose your authenticator device.
Limit Login Attempts
By default, WordPress allows unlimited login attempts, an attacker can try millions of passwords without being blocked. Login limiting is essential.
Recommended Settings
- Lock out after 3-5 failed attempts
- First lockout: 20 minutes
- Subsequent lockouts: 24 hours
- Permanent block after 3 lockouts
- Whitelist your own IP address
- Log all failed login attempts
Best Plugins
- Limit Login Attempts Reloaded (2M+ installs, free)
- Wordfence (includes brute force protection)
- Login LockDown (lightweight, simple)
- Cloudflare WAF (blocks at CDN level, best performance)
Pro tip: Combine with Cloudflare's free plan for the most effective protection. Cloudflare's Bot Fight Mode and WAF rules block most brute force traffic before it even reaches your server, reducing server load and eliminating 95%+ of login attacks.
Lock Down User Roles & Permissions
| Role | Can Do | Cannot Do | Assign To |
|---|---|---|---|
| Administrator | Everything, full control | N/A (unrestricted) | Only site owner (1-2 people max) |
| Editor | Manage all content, moderate comments | Install plugins, change themes, manage users | Content managers, senior writers |
| Author | Write & publish own posts | Edit others' posts, manage settings | Regular blog writers |
| Contributor | Write drafts (cannot publish) | Publish, upload media, edit others | Guest writers, freelancers |
| Subscriber | View content, manage own profile | Create or edit any content | Registered users, commenters |
Principle of Least Privilege
- Give each user the minimum role needed for their job, never make everyone an Administrator
- Audit user accounts quarterly; remove inactive accounts and downgrade unnecessary admin access
- Use the User Role Editor plugin to create custom roles if default WordPress roles don't fit
- Require 2FA for all Administrator and Editor accounts (enforced, not optional)
- Set an auto-logout timeout (15-30 minutes) for admin sessions
Harden File Permissions
| File/Directory | Recommended | Never Use | Why |
|---|---|---|---|
| All directories | 755 | 777 | Owner can write; others can only read/traverse |
| All files | 644 | 666 or 777 | Owner can write; others can only read |
| wp-config.php | 600 or 640 | 644+ | Contains database credentials; most sensitive file |
| .htaccess | 644 | 777 | Controls server behavior, critical for security rules |
| wp-content/uploads/ | 755 | 777 | Must be writable for media uploads but not world-writable |
Fix Permissions via SSH
# Set directory permissions to 755
find /path/to/wordpress/ -type d -exec chmod 755 {} \;
# Set file permissions to 644
find /path/to/wordpress/ -type f -exec chmod 644 {} \;
# Lock down wp-config.php
chmod 600 /path/to/wordpress/wp-config.php
# Lock down .htaccess
chmod 644 /path/to/wordpress/.htaccesswp-config.php Security Tweaks
Add these lines to your wp-config.php file for significant security improvements:
// Disable file editing from wp-admin (prevents code injection via admin panel)
define('DISALLOW_FILE_EDIT', true);
// Disable plugin/theme installation from admin (require SFTP)
define('DISALLOW_FILE_MODS', true);
// Force SSL for admin panel
define('FORCE_SSL_ADMIN', true);
// Limit post revisions (reduces database bloat)
define('WP_POST_REVISIONS', 5);
// Set auto-save interval (seconds)
define('AUTOSAVE_INTERVAL', 300);
// Disable WordPress debug mode in production
define('WP_DEBUG', false);
define('WP_DEBUG_LOG', false);
define('WP_DEBUG_DISPLAY', false);
// Block external HTTP requests (whitelist specific hosts if needed)
// define('WP_HTTP_BLOCK_EXTERNAL', true);
// define('WP_ACCESSIBLE_HOSTS', 'api.wordpress.org,downloads.wordpress.org');
// Move wp-content directory (optional, advanced)
// define('WP_CONTENT_DIR', dirname(__FILE__) . '/app');
// define('WP_CONTENT_URL', 'https://example.com/app');Disable Unnecessary Features
Disable: XML-RPC
Risk: Enables brute force amplification (hundreds of password attempts in one request) and DDoS via pingbacks.
Add to .htaccess:
<Files xmlrpc.php>
Require all denied
</Files>Disable: REST API User Enumeration
Risk: Exposes usernames via /wp-json/wp/v2/users, attackers use these for targeted brute force.
Add to functions.php:
add_filter('rest_endpoints', function($endpoints) {
unset($endpoints['/wp/v2/users']);
return $endpoints;
});Disable: WordPress Version Number
Risk: Tells attackers your exact WordPress version, helping them target known vulnerabilities.
Add to functions.php:
remove_action('wp_head', 'wp_generator');Disable: File Editor (Appearance → Editor)
Risk: Allows anyone with admin access to inject PHP code directly into theme/plugin files.
Add to wp-config.php:
define('DISALLOW_FILE_EDIT', true);Best Security Plugins Compared
| Plugin | Price | Firewall | Malware Scan | 2FA | Best For |
|---|---|---|---|---|---|
| Wordfence | Free / $119/yr | ✅ App-level | ✅ | ✅ | Best free option, comprehensive protection |
| Sucuri | $199/yr | ✅ Cloud WAF | ✅ | ❌ | Best cloud firewall, blocks before reaching server |
| Solid Security (iThemes) | Free / $99/yr | ✅ Basic | ✅ (Pro) | ✅ | Lightweight, low server impact |
| All-In-One WP Security | Free | ✅ Basic | ⚠️ Limited | ✅ | Beginners, visual security grading system |
| MalCare | $99/yr | ✅ Cloud | ✅ Cloud-based | ❌ | Cloud-based scanning (no server impact) |
Activity Monitoring & Alerts
You can't protect what you can't see. Activity logging records every admin action (login attempts, plugin changes, user modifications, and content edits ) so you can detect compromises early.
What to Monitor
- Failed login attempts (threshold: 3+ per IP)
- Successful logins from new IPs or locations
- User role changes (especially to Administrator)
- Plugin/theme installations and updates
- File modifications in core WordPress files
- Database changes to options table
Activity Log Plugins
- WP Activity Log
Most comprehensive logging, tracks 500+ events, real-time alerts, user session management
- Simple History
Lightweight, free, logs logins, content changes, plugin updates in a simple timeline
- Stream
Developer-friendly logging with filtering, export, and integrations (Slack, email)
WordPress Admin Security Checklist
Frequently Asked Questions
Is it safe to use 'admin' as a WordPress username?
Does changing the wp-admin URL actually improve security?
Which WordPress security plugin is best?
How often are WordPress sites hacked?
Should I disable XML-RPC?
What file permissions should WordPress use?
Need Hosting with Built-In WordPress Security?
Managed WordPress hosts include server-level firewalls, malware scanning, and automatic updates, so you can focus on your content instead of security.
Find Secure Hosting
