Below checklist can help getting started with WordPress Security. A step-by-step incremental approach.
Login Protection
- Ensure users set a strong and unique passwords
- Enforce two-factor authentication (2FA) for admins and editors
- Slow down or block repeated invalid login attempts
User Accounts
- Replace the default “admin” username to a different one
- Turn off public sign-ups unless you really need them
Plugins and Themes
- Continuously keep WordPress core updated
- Continuously keep plugins and themes updated
- Remove/Disable plugins and themes you do not use
- Install plugins/themes from trusted sources
- Avoid using nulled/modded plugins/themes
- Back up before making any changes/updates
Core WordPress Protection
- Enable HTTPS for the entire website
- Turn off file editing in the admin dashboard
- Keep
wp-config.phplocked down (files 600) - Rotate WordPress security keys after a breach or on a schedule
Backups
- Back up files and database automatically
- Store backups off-site
- Keep a minimum of two backup versions
- Test restoring from backup regularly
Server Setup
- Use a firewall (WAF) and a CDN
- Run the latest supported PHP version
- Stop PHP from running inside
wp-content/uploads - Set safe file permissions (folders 750, files 640)
- Turn off directory listing
Database Security
- Use a strong, unique database password
- Give the database user only the permissions it needs
- Remove test data from your live site
- Secure the database connection (localhost or TLS)
- Disable anonymous/test/default user accounts on database
Monitoring
- Get alerts when the site goes down
- Get alerts for plugin and theme vulnerabilities
- Review admin activity logs regularly
- Run malware scans and file integrity checks
- Check & Enable auto updates for plugins/themes/core
Forms and Uploads
- Add CAPTCHA to public forms
- Use an anti-spam plugin
- Check form inputs on the server side
- Limit file upload types
Privacy
- Publish a privacy policy
- Collect consent where required
Work Habits
- Do not edit directly on the live site; use a staging process
- Password-protect staging and do not index it
- Keep passwords and API keys out of code; use a vault or env file
If You Get Hacked
- Limit site access while you investigate
- Change all passwords and rotate keys
- Restore from a clean backup if needed
- Scan and remove malware
- Find and fix the root cause
- Update everything and watch for reinfection