WordPress security hardening checklist: 20 steps that matter
TL;DR: Most known WordPress vulnerabilities are in plugins and themes, not in WordPress itself, and stolen or guessed passwords are the other common way in. So start there: update everything, delete what you don't use, and put two-factor authentication and login limits on every admin account. Then lock down wp-config.php, file permissions and the server, keep backups somewhere else, and check for…
WordPress security hardening checklist: 20 steps to protect your site
1. Begin with a full backup of files and database. Test any changes in a staging environment first.
2. Keep WordPress, plugins and themes updated. Minor WordPress updates are automatic by default. Test major updates in staging before deployment.
3. Remove unused plugins and themes. Deactivate deactivated plugins, not just deactivate. Keep a single default theme as a fallback.
4. Install only from trusted sources. Use WordPress.org or plugin developer's site for paid plugins. Avoid nulled (pirated) plugins or themes.
5. Use strong passwords and two-factor authentication for all admin accounts. Obtain a unique password from a password manager and enable two-factor authentication.
6. Limit login attempts with a plugin or server/firewall rate-limiting.
7. Assign the lowest role necessary to each user. Remove inactive users and rename the "admin" account.
8. Disable the dashboard file editor in wp-config.php: define('DISALLOW_FILE_EDIT', true);
9. Use unique keys and salts in wp-config.php. Generate new keys and salts from the official generator and replace them. This will log out all users immediately.
10. Set correct file permissions. Directories should be 755, files 644. wp-config.php should be 640 or 440/400 if allowed by your host. No file should be 777. Ensure files belong to your hosting account rather than the web server, except where WordPress needs to write (usually wp-content/uploads).
11. Stop PHP execution in the uploads folder. Only media should be stored in wp-content/uploads. Prevent PHP execution there by adding rules to .htaccess (Apache) or server block (Nginx).
12. Disable debugging messages on live sites. Set WP_DEBUG to false and WP_DEBUG_DISPLAY to false. Write error logs outside the public web folder.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.