Hardening

How to secure a WordPress site: the complete 7-layer method

How to secure a WordPress site: the 7-layer method

Securing a WordPress site does not mean installing a plugin and ticking every box in its settings. It means closing, in the right order, the doors that bots try every day: weak accounts, outdated plugins, files and URLs that give too much away, no backups and no monitoring. This guide gives you the complete method in seven layers, the order to tackle them in depending on your site, a 30-day plan and the exact settings to apply.

Looking for a list to tick off on an existing site instead? Our 40-point WordPress security checklist works as an audit. Here, the goal is to understand what each measure protects, so you can decide what to do first.

What actually threatens a WordPress site

Most hacked sites were not targeted personally. Bots crawl the internet non-stop, spot WordPress sites, try passwords and look for plugin versions with a published vulnerability. WordPress core is rarely the problem: most of the vulnerabilities published each year affect plugins and themes. Attacks fall into a few families, and each one is stopped at a specific place.

ThreatHow it arrivesLayer that stops itUrgency
Known plugin vulnerabilityBot looking for a vulnerable versionUpdates, alertsVery high
Stolen passwordBrute force, credential stuffing, phishingAccess and accountsVery high
Booby-trapped or abandoned pluginChange of ownership, no patchInventory, alertsHigh
Misconfigured serverEnd-of-life PHP, overly broad permissionsHostingHigh
Automated reconnaissanceAccount enumeration, XML-RPC, fingerprintsAttack surfaceMedium
Data lossHack, mistake, outageBackupsHigh

The seven layers of protection, in order

Each layer covers a risk the others cannot see. A very complete security plugin does not make up for a missing backup, and a perfect backup does not prevent a stolen password. The animation shows the recommended order: start with the foundation, then lock down access, before adding monitoring.

The seven security layers of a WordPress siteThe layers light up in the recommended order: hosting and server, access and accounts, updates and inventory, attack surface, monitoring, backups, response plan.1Hosting and serverSupported PHP, isolated accounts, SFTP2Access and accounts2FA, login limiting, moved login3Updates and inventoryEverything up to date, nothing unused4Attack surfaceXML-RPC, authors, fingerprints, headers5MonitoringKnown flaws, integrity, activity log6Backups3-2-1, restore already tested7Response planWho, what, which backupThe seven security layers of a WordPress siteThe layers light up in the recommended order: hosting and server, access and accounts, updates and inventory, attack surface, monitoring, backups, response plan.1Hosting and serverSupported PHP, isolated accounts, SFTP2Access and accounts2FA, login limiting, moved login3Updates and inventoryEverything up to date, nothing unused4Attack surfaceXML-RPC, authors, fingerprints, headers5MonitoringKnown flaws, integrity, activity log6Backups3-2-1, restore already tested7Response planWho, what, which backup

1. Hosting and server

Everything rests on the server. WordPress now recommends PHP 8.3 or later, with at least MySQL 8.0 or MariaDB 10.11. An end-of-life PHP version no longer receives security fixes (see end-of-life PHP versions). Also check that your host isolates accounts from each other, offers SFTP rather than FTP, a web application firewall and backups. Our WordPress hosting comparison covers these points plan by plan.

2. Access and accounts

This is the layer with the best return. A long, unique password per account, two-factor authentication for every administrator, login attempt limiting and a moved login page remove the vast majority of attacks on accounts. Apply least privilege too: an editor does not need the administrator role, and every contractor should have their own account, deleted when the job is done.

  • Delete the "admin" account if it exists, along with any unused account.
  • Revoke the application passwords you do not use (Users, Profile).
  • Protect access outside WordPress as well: your hosting control panel, SFTP, the database and the administrator's mailbox.

3. Updates and inventory

Keep WordPress on its latest version. Minor core updates install themselves; also turn on automatic updates for plugins you trust, and keep a staging site for the most sensitive ones (shop, page builder). Above all, shrink the inventory: every deactivated plugin still sitting on the server can still be attacked. Delete what you no longer use and replace plugins that are no longer maintained (the danger of abandoned plugins).

4. Attack surface

The less a bot learns about your site, the less it has to work with. Close what you do not use: XML-RPC and pingbacks, user enumeration through /?author=1 and the REST API, the file editor in the Dashboard. Fix file permissions, add HTTP security headers and remove the fingerprints that reveal WordPress, its plugins and their versions. Hiding these does not replace updates: it reduces automated targeting.

5. Monitoring

A hack discovered after three days costs far less than one discovered after three months. Watch four signals: published vulnerabilities affecting your plugins, the integrity of core files, administrator actions (new account, plugin installed) and Google's alerts in Search Console. Our guide on how to tell whether a WordPress site has been hacked details the manual checks.

6. Backups

A backup is only worth something if it is stored off the server and you have already restored it successfully once. Follow the 3-2-1 rule: three copies, two types of media, one copy off-site. Keep several weeks of history, because an infection is often discovered late and recent backups may already contain it.

7. Incident response plan

Write it before you need it, on a single page: who to notify, where the credentials are, how to put the site in maintenance mode, which backup to restore, how to change every password and the keys in wp-config.php. When the day comes, follow the step-by-step cleanup procedure.

Where to start depending on your site

Every layer matters, but the order depends on what you stand to lose and who works on the site.

Type of sitePrioritiesInitial timeWatch out for
Blog or brochure siteAccess, automatic updates, off-site backup1 to 2 hoursPlugins installed "to try out" and then forgotten
Business websiteAccess, inventory, monitoring, response planHalf a dayContractor accounts that were never deleted
WooCommerce storeMandatory 2FA, staging, frequent backupsOne dayPayment plugins and customer data
Agency, several sitesCentral inventory, alerts, shared procedureVariesA single forgotten site becomes the way in

The 30-day plan

There is no need to do everything in one evening. This schedule deals first with what bots exploit most.

  • Day 1 (one hour): update core, plugins and theme; delete unused plugins and themes; change administrator passwords; run a full backup and copy it off the server.
  • Week 1: two-factor authentication for administrators, login limiting, moved login page, XML-RPC closed, roles reviewed.
  • Week 2: supported PHP version, HTTPS enforced with HSTS, security headers, file editor disabled, permissions checked.
  • Week 3: automatic off-site backups, restore test on a copy, automatic updates for trusted plugins.
  • Week 4: monitoring (known vulnerabilities, integrity, activity log, Search Console) and a written response plan.
  • Then, every month: review accounts and plugins, read the alerts, check a backup.

Settings to add to wp-config.php

These constants go above the line "That's all, stop editing!". Make a copy of the file before editing it; our article on wp-config.php security settings explains them one by one.

// No theme and plugin editor in the Dashboard
define( 'DISALLOW_FILE_EDIT', true );

// Admin area and login over HTTPS only
define( 'FORCE_SSL_ADMIN', true );

// Automatic core updates: minor releases (default value)
define( 'WP_AUTO_UPDATE_CORE', 'minor' );

// Never show PHP errors to visitors
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_DISPLAY', false );

Only add DISALLOW_FILE_MODS if you update by another route (WP-CLI, deployment): this constant also blocks updates from the Dashboard.

What a security plugin does, and what it does not

No plugin covers all seven layers. Firewalls and scanners such as Wordfence or Sucuri filter requests and look for malicious code; a backup plugin copies your data; your host runs the server. WP Feint works on layers 2, 4 and 5: reducing what bots can see and what they can try, then letting you know.

  • Free version: moved login page, XML-RPC and pingbacks blocked, WordPress traces and plugin comments removed, plugin folder hidden, bot traps that count scanners.
  • WP Feint Pro: two-factor authentication, login limiting, author list hidden, renamed file URLs, security headers, alerts on vulnerable and closed plugins, core integrity check, administrator activity log, email alerts, and the update status of all your sites in the member area.
  • What it does not do: it is not a web application firewall, an antivirus or a backup tool. Pair it with those; our WordPress security plugin comparison shows the combinations that do not overlap.

Frequently asked questions

Is a security plugin enough to secure WordPress?

No. It handles some of the layers (access, attack surface, filtering or monitoring depending on the tool). Updates, off-site backups, hosting and account management remain your job.

What is the most effective step if I only have one hour?

Update everything, delete what you no longer use, change the administrator passwords and copy a backup off the server. Add two-factor authentication as soon as you can.

Should I change the wp-login.php URL?

Yes, as an extra measure: it removes the noise from bots aiming at the default URL. It does not replace a strong password or two-factor authentication.

Does hiding WordPress hurt SEO?

No, as long as it does not touch your content or the public URLs of your pages. Search engines index your pages, not the signature of the software that builds them.

How often should I check a site's security?

Alerts as they come in, a quick review of accounts and plugins every month, and a full audit with a checklist once a year or after a redesign.

Key takeaways

  • WordPress security comes down to seven layers: hosting, access, updates, attack surface, monitoring, backups, response.
  • Start with accounts and updates: those are the doors bots try first.
  • A deactivated plugin can still be attacked: delete what you no longer use.
  • A backup counts only if it is off the server and has been restored at least once.
  • No plugin does everything: combine a smaller attack surface, a firewall or scanner, backups and alerts.

Close the doors bots try first

The free plugin Feint Security moves the login page, blocks XML-RPC and hides WordPress. Pro adds two-factor authentication, login limiting, vulnerability alerts and the integrity check, from €59 per year excl. VAT.

Sources

  • WordPress Developer: Hardening WordPress (external link, opens in a new tab)
  • WordPress Developer: Brute Force Attacks (external link, opens in a new tab)
  • WordPress.org: requirements (external link, opens in a new tab)
  • WordPress Developer: wp-config.php (external link, opens in a new tab)