Skip to content
GPLWP Guides

How to secure a WordPress website

Security Time About 45 minutes, plus time to test a backup 6 steps Updated 16 Sep 2026

SECURITY
The short answer

Secure WordPress by keeping core, themes and plugins updated, using HTTPS and strong unique passwords, limiting user access, maintaining tested off-site backups, and disabling risky file editing. A security plugin is not mandatory, but a firewall, malware scanner, 2FA and audit logs make ongoing protection easier.

The route
  1. 01Create and test a backup
  2. 02Update everything you use
  3. 03Lock down accounts and login
  4. 04Reduce file and server access
  5. 05Add monitoring and traffic protection
  6. 06Choose the fast route

What you need

  • Administrator access to WordPress
  • Access to your hosting control panel or SFTP
  • A separate location for backups
  • An HTTPS certificate installed by your host

Create and test a backup

Make a complete backup of the database and wp-content, including uploads, themes and plugins. Keep at least one copy outside the web server, such as in encrypted cloud storage or on a local device.

Do not assume a backup is usable because a plugin says it completed. Restore a copy on a staging site or separate installation before you rely on it. Backups left in a publicly reachable folder can expose database credentials and other sensitive data, so remove old server-side copies or protect their storage carefully.

Update everything you use

Open Dashboard → Updates and update WordPress, active plugins and themes. Delete plugins and themes you no longer use rather than leaving them installed. Turn on automatic updates where they are appropriate, but review major changes and check the site afterwards.

WordPress applies minor and security updates automatically on supported installations, but you still need a process for major core updates, plugins, themes and the hosting stack. Take a backup first, especially before updating a busy WooCommerce site or a site with custom code.

Lock down accounts and login

Give each person their own account, use the least permissive role they need, remove dormant users and avoid predictable usernames such as admin. Use a unique password of at least 20 characters, stored in a password manager, for every WordPress, hosting, SFTP and database account.

Enable two-factor authentication for administrators and editors. WordPress does not provide built-in 2FA in its standard documentation, so this normally requires a maintained plugin. HTTPS must cover the login and administration areas so passwords and session cookies are not sent in clear text.

Reduce file and server access

Use SFTP rather than unencrypted FTP where your host supports it. Ask your host to check file ownership and permissions instead of applying 777 broadly; world-writable files make it easier for an attacker to alter your site and incorrect changes can take the site offline.

Disable the WordPress dashboard’s theme and plugin file editor by adding define( 'DISALLOW_FILE_EDIT', true ); to wp-config.php. This limits one route to code execution after an administrator account is compromised, but it does not stop malicious uploads or protect the hosting account itself.

Add monitoring and traffic protection

For a small site, the manual controls above may be enough if you review updates, backups and user accounts regularly. For a shop, membership site or site that cannot be watched closely, add a firewall, malware scanner, login protection, 2FA, IP controls and audit logging.

Use automatic blocking carefully. Permanently blocking individual IP addresses is often unreliable because addresses can be shared, reassigned or rotated. A firewall can also cause false positives that break backups or normal admin requests, so test checkout, logins, forms and scheduled jobs after enabling stricter rules.

Choose the fast route

If you want one dashboard for the ongoing work, install and activate SecuPress Pro from the WordPress Plugins screen, then follow its setup wizard. Configure the firewall, malware scans, real-time alerts, 2FA, IP blocking, audit logs and database backup options, and review the first scan for warnings.

SecuPress Pro is a practical shortcut because it brings those controls together, but it does not replace strong hosting credentials, HTTPS, tested off-site backups or timely updates. Avoid running several security plugins with overlapping firewalls, login limits or scans, because their rules can conflict and make troubleshooting harder.

The fast route

Let SecuPress Pro do it

All-in-one WordPress security with firewall, malware scans, 2FA, IP blocking, and audit logs for comprehensive protection.

Get SecuPress Pro

Sources

  1. wordpress.org /support/topic/you-have-a-serious-security-problem-in-your-p…
  2. developer.wordpress.org /advanced-administration/security/hardening/?utm_source=open…
  3. developer.wordpress.org /advanced-administration/wordpress/edit-files/?utm_source=op…
  4. wordpress.org /support/topic/websites-getting-hacked/?utm_source=openai
  5. wordpress.org /support/topic/correct-setup-of-your-plugin-and-understandin…

Questions

Can I secure WordPress without a security plugin?
Yes, you can cover the essentials manually with updates, HTTPS, strong unique passwords, separate user accounts, tested off-site backups, careful permissions and disabled dashboard file editing. The drawback is ongoing work: WordPress does not provide standard built-in 2FA, malware monitoring or a full application firewall, so you must assemble and maintain those controls separately.
What should I do first if my WordPress site may be hacked?
Take the site offline or restrict access if possible, preserve logs and create a forensic backup before deleting files. Change WordPress, hosting, SFTP, database and email passwords from a clean device, then ask your host or a qualified incident responder to inspect the server. Do not simply reinstall WordPress while leaving a compromised administrator or hosting account active.
Should I block every suspicious IP address?
No, not usually. IP addresses may be shared, reassigned or changed frequently, so manual permanent blocks can block legitimate visitors without stopping the attack. Use rate limiting or automatic firewall rules first, and investigate persistent traffic using server logs. If one confirmed source repeatedly attacks the site, a targeted temporary block may be appropriate.
Where should WordPress backups be stored?
Keep at least one recent copy outside the web server and protect it with access controls or encryption. A backup stored only inside the site can be deleted by an attacker or exposed through a misconfigured folder. Test restoration regularly, because an untested archive may be incomplete, incompatible or impossible to use when the site is down.
Can a security plugin protect the whole hosting account?
No. A WordPress security plugin runs within, or alongside, the WordPress installation and cannot fully protect your hosting panel, database server, SFTP accounts or other sites on the same account. Use separate strong credentials, HTTPS, host-level firewall controls and least-privilege access as well as any WordPress firewall or scanner.