Skip to content
GPLWP Guides

How to secure a WordPress website

Security Time About 45 minutes, plus time to configure backups 6 steps Updated 1 Sep 2026

The short answer

You can secure a WordPress website without a plugin by updating WordPress, themes and plugins, removing unused software, limiting user permissions, enforcing HTTPS, protecting configuration files and keeping tested backups. A security plugin is useful when you also need a firewall, malware scans, login protection and activity logs.

The route
  1. 01Create and test a backup
  2. 02Update and remove software
  3. 03Reduce account access
  4. 04Enforce HTTPS and protect configuration
  5. 05Check server permissions and activity
  6. 06Use the fast security route

What you need

  • Administrator access to WordPress
  • Hosting control-panel, SFTP or SSH access
  • A separate location for storing backups
  • An HTTPS certificate on the domain

Create and test a backup

Make a complete backup of the database and WordPress files before changing security settings. The database contains posts, pages, comments and settings, while the files include the core installation, plugins, themes, uploads and configuration. You need both parts for a full restore.

Store the backup somewhere separate from the hosting account and check that you can restore it. If the site is already hacked, do not assume the newest backup is clean; use a known-good copy, then change WordPress, hosting, SFTP, database and email passwords.

Update and remove software

Update WordPress, every active plugin and the active theme from the Dashboard, then check the front end and important forms. WordPress recommends keeping core, plugins and themes up to date because old software is a common route for exploit attempts.

Delete plugins and themes you do not use rather than leaving them deactivated. Choose extensions that are actively maintained, and take a backup before major updates. If an update leaves the site showing a maintenance message or a blank page, use your host or SFTP access to restore the affected files and backup.

Reduce account access

Review Users and remove old accounts, unknown administrators and accounts belonging to former contractors. Give each person the lowest role they need: for example, use Editor for someone managing content rather than Administrator. WordPress roles control access to posts, settings, plugins, themes and users.

Use a long, unique password for every administrator and enable two-factor authentication through your hosting provider or a security plugin. Do not rely on hiding the login URL alone; it does not replace strong authentication, rate limits or monitoring.

Enforce HTTPS and protect configuration

Install an SSL certificate, make sure the WordPress and Site Address values use https://, and redirect HTTP traffic to HTTPS at the server or hosting level. Test the login page, forms, images and embedded content afterwards. WordPress documents additional configuration for forcing secure administration and logins.

Disable the built-in plugin and theme file editor by adding define( 'DISALLOW_FILE_EDIT', true ); to wp-config.php. Keep that file outside public access where your hosting setup supports it, restrict who can read it, and never publish debug logs where visitors can download them.

Check server permissions and activity

Ask your host to confirm that files and directories are not world-writable. WordPress commonly uses 644 for files and 755 for directories, with stricter access for wp-config.php, but the correct values depend on the server user and hosting setup. Do not apply 777 as a quick fix: incorrect permissions can expose the site or break updates.

Use hosting logs or a security tool to watch failed logins, unexpected administrator accounts, changed files and suspicious redirects. If you find malware, take a snapshot for investigation, restore clean files where possible, identify the entry point and rotate credentials after recovery. Restoring an infected backup without fixing the original weakness can bring the problem back.

Use the fast security route

The manual route is fine for a small site when you can keep updates, backups, access reviews and monitoring on a regular schedule. It becomes harder to maintain when the site has WooCommerce, several administrators, frequent changes or no one available to inspect logs.

For faster coverage, install and configure WPMU DEV Defender Pro. Its firewall, malware scanning, brute-force protection, hardening controls, two-factor authentication, activity monitoring and audit logs handle much of the work in one place. Still keep independent backups and review alerts; a plugin does not protect an abandoned WordPress installation or replace secure hosting.

The fast route

Let WPMU DEV Defender Pro do it

All-in-one firewall, malware scanning, login protection, hardening, and audit logs for sites needing broad security coverage.

Get WPMU DEV Defender Pro

Sources

  1. developer.wordpress.org /advanced-administration/security/backup/?utm_source=openai
  2. developer.wordpress.org /advanced-administration/security/?utm_source=openai
  3. wordpress.org /documentation/article/roles-and-capabilities/?utm_source=op…
  4. developer.wordpress.org /advanced-administration/security/https/?utm_source=openai
  5. developer.wordpress.org /advanced-administration/security/hardening/?utm_source=open…
  6. developer.wordpress.org /advanced-administration/server/file-permissions/?utm_source…
  7. wordpress.org /documentation/article/faq-my-site-was-hacked/?utm_source=op…

Questions

Can I secure WordPress without a security plugin?
Yes, you can secure WordPress without a security plugin by applying updates, removing unused software, limiting administrator access, enforcing HTTPS, protecting configuration files and maintaining tested backups. The drawback is ongoing manual work: WordPress itself does not provide one dashboard for firewall rules, malware scanning, login throttling and audit logs, so you must obtain and review those controls separately.
What is the most important WordPress security measure?
Keeping WordPress, plugins and themes updated is the most important routine measure because outdated software is a common target for exploit attempts. Use maintained extensions, remove anything you no longer need and back up before updates. Updates reduce known vulnerabilities, but they do not replace strong passwords, least-privilege user roles, HTTPS, backups or monitoring.
Should I change WordPress file permissions to 777?
No, you should not use 777 as a general WordPress security fix because it makes files or directories writable by everyone and can allow an attacker to modify or upload code. Permissions depend on your hosting model, but WordPress commonly uses 644 for files and 755 for directories, with tighter access for wp-config.php. Ask your host before changing them.
What should I do if my WordPress site has already been hacked?
If your WordPress site has already been hacked, preserve a copy for investigation, take the site offline if necessary, restore from a known-clean backup or replace compromised files, update every component and change all relevant passwords. Also regenerate WordPress security keys and find the vulnerable plugin, theme, account or hosting entry point; otherwise the attacker may regain access.
Does a WordPress security plugin replace backups?
No, a WordPress security plugin does not replace independent backups. Firewalls, scans and login protection can reduce risk and help detect attacks, but a failed update, hosting incident or persistent compromise may still require a restore. Keep database and file backups in a separate location, retain more than one restore point and periodically verify that restoration works.