On this page 7 sections
Short answer: To secure WordPress: keep core, themes and plugins updated, delete unused ones, use unique admin usernames, strong passwords and 2FA, protect the login page, disable file editing in the dashboard, set correct file permissions, use a firewall, take off-site backups and run on secure hosting with HTTPS.
WordPress itself is reasonably secure. Most hacked WordPress sites are hacked through outdated plugins, weak passwords or nulled (pirated) themes. Here is the hardening I apply on client sites.
Updates and software
- Update WordPress core, plugins and themes regularly
- Enable automatic updates for minor security releases
- Delete (not just deactivate) unused plugins and themes
- Never install nulled plugins or themes. They often contain malware.
- Choose plugins that are actively maintained and widely used
Users and logins
- Don’t use “admin” as a username
- Strong unique passwords for every user
- Two-factor authentication for all admins
- Give users the lowest role they need
- Limit login attempts and add a custom login URL. I built Secure Custom Login and Professional Login for this.
Configuration
- Disable the dashboard file editor by adding to wp-config.php:
define( 'DISALLOW_FILE_EDIT', true );- Use unique security keys and salts in wp-config.php
- Change the default
wp_database prefix on new installs - Set file permissions: typically 644 for files, 755 for folders, stricter for wp-config.php
- Disable XML-RPC if you don’t use it
- Turn off directory listing
- Add security headers (HSTS, X-Content-Type-Options, frame protection)
Protection and recovery
- Use a web application firewall
- Run malware scans
- Daily off-site backups with tested restores
- Use HTTPS everywhere
- Monitor uptime and file changes
Comments and spam
If you don’t use comments, turn them off completely. Spam comments add risk and database bloat. My Disable & Delete Comments plugin does it in one click.
If your WordPress site is hacked
- Put the site in maintenance mode
- Change all passwords: hosting, database, WordPress users, FTP/SFTP
- Restore a clean backup, or reinstall core and plugins from official sources
- Remove unknown admin users and suspicious files
- Update everything and find the entry point
- Ask Google to review the site in Search Console if it was flagged
For broader advice beyond WordPress, see website security for small businesses.
Frequently asked questions
Is WordPress safe to use?
Yes, when it is updated, uses trusted plugins, strong logins and good hosting. Most problems come from neglect.
Do I need a WordPress security plugin?
It helps, especially for firewall, login protection and scanning. Hosting-level security can cover some of the same ground.
How do I know if my WordPress site is hacked?
Warning signs include unknown admin users, strange redirects, spam pages in Google, a Google “site may be hacked” warning, or a sudden traffic drop.
Can you secure my WordPress site?
Yes. I harden, clean and maintain WordPress sites. Get in touch.
