ARTICLE - CDN, Security & Monitoring

WordPress Security Hardening: Accounts, Updates and Recovery

Hardening is not a stack of security plugins: reduce unnecessary access and write permissions, patch core and extensions, and prove that a clean backup can be restored. Review accounts, files, updates, and recovery without treating one permission mode or WAF as complete protection.

2026-11-26 16IDC Original 27 views
Advertisement

For self-hosted WordPress, hardening means reducing unnecessary access and write permissions, patching core and extensions, and proving that recovery works before an incident. A security plugin or WAF covers only part of request handling or detection; it does not replace host patches, account security, application updates, or restorable backups. This guide orders the checks and actions. WordPress's official hardening handbook frames security as reducing risk, not eliminating it.

Before making changes, confirm access to the host and site, a usable database and file backup, and either a staging environment or a maintenance window. Record the current WordPress, PHP, plugin, and theme versions. Test high-impact changes in staging first. If you already suspect a compromise, do not run cleanup commands that overwrite logs or file evidence; follow the incident procedure below.

Restrict Account and Application Access

  1. Remove unneeded accounts: Confirm each administrator's purpose and remove inactive accounts. Give content editors only the role they need; do not share administrator credentials.
  2. Strengthen authentication: Use unique strong passwords and available multifactor authentication for administrators. Set reasonable login limits and a recovery path so legitimate staff are not locked out indefinitely.
  3. Manage XML-RPC: Disable it only if the site does not depend on a client or integration that uses it. Check mobile apps, Jetpack, and other callers first. Changing the login URL may reduce some scan noise, but it does not replace authentication or rate limiting.
  4. Update and verify extensions: Install core, plugins, and themes from WordPress.org or a trusted publisher. Remove inactive extensions that are no longer needed. Test high-impact updates in staging and keep a backup suitable for rollback.

The WordPress hardening handbook advises using current software and avoiding plugins or themes from untrusted sources. Automatic-update availability and scope depend on WordPress settings, host policy, and extension configuration; do not assume every plugin updates itself.

Check Action and acceptance
Administrator accounts Remove inactive accounts; confirm distinct accounts and strong authentication
Core and extensions Inventory versions and sources; test updates and rollback in staging
Files and uploads Check the runtime user, write scope, and uploads execution rule
Backup and recovery Check database and file copies, then restore in isolation

File, Configuration, and Database Permissions

Set file permissions according to the host's runtime user, deployment method, and update process. Do not recursively apply one chmod value to every site. The WordPress hardening handbook gives directories at 0755 and files at 0644 as common examples, while noting that permissions must fit the server environment. Allow only necessary processes to write to necessary paths, and restrict access to wp-config.php.

If administrators do not need to edit PHP from the dashboard, disable the theme and plugin editor in wp-config.php; see WordPress's official file-editing guidance:

define( 'DISALLOW_FILE_EDIT', true );

Verify: the file editor is unavailable in the dashboard. If checking with WP-CLI, make sure it reads the active site's configuration. This constant does not fix existing malicious code or replace administrator account protection.

For a site on Nginx, the following rule can deny PHP execution in uploads. Test it in staging and place it before a general PHP execution rule; other web servers require their own configuration:

location ~* ^/wp-content/uploads/.*\.php$ {
    deny all;
}

Verify: nginx -t reports valid configuration; the PHP test path in staging is denied or cannot execute, and ordinary images remain accessible. Delete the temporary file immediately, then publish through the normal change process. Do not upload an executable test file to production.

Scope the database account to the database this site needs rather than granting server-wide access. WordPress installation, upgrades, or plugin changes may need schema privileges; removing CREATE, ALTER, or similar rights without testing can break an update. Have the host or database administrator document the runtime and migration account responsibilities, then test the update workflow in staging.

Backups, Updates, and Read-Only Checks

Store backups separately from production and restrict which accounts can access them. Confirm that they include the database and required site files, set a retention period that fits recovery objectives, and restore them periodically in an isolated environment. Check login, media, forms, and critical business functions. A “backup successful” status alone does not prove that recovery works.

If WP-CLI is installed, these read-only commands check core checksums and list plugins with available updates; see the core checksum and plugin list command references:

wp core verify-checksums
wp plugin list --update=available --fields=name,version,update_version

Verify: a successful core checksum check means the checked core files match their corresponding official checksums; it does not cover plugins, themes, the database, or server configuration. The plugin list identifies updates but does not prove that a plugin is secure. If output is unexpected, confirm the site path, version, and extension source before deciding whether to update or restore.

Isolate and Recover After a Breach

WordPress incident response timeline Isolate site Preserve evidence Rotate credentials Remove entry point Restore cleanly Verify and reopen Choose a recovery point before the intrusion; retain logs and snapshots first If the entry point is unknown or compromise returns, rebuilding is easier to control
Figure 1: WordPress incident response timeline (Source: isolate and preserve evidence before restoring from a clean state)

If a compromise is confirmed, follow this order. For customer data, payment systems, or an active incident, involve the host and qualified incident-response support.

  1. Isolate: Restrict public access with a maintenance page, access control, or network policy to stop ongoing activity. Do not immediately delete suspicious files.
  2. Preserve evidence: Save the database, file inventory, access logs, and host snapshots; record the likely incident window. Keep evidence copies isolated so the same credentials cannot overwrite them.
  3. Rotate credentials: From a trusted device, change administrator, host, database, SSH, CDN, and third-party keys stored by the site. Rotating WordPress salts invalidates existing login sessions.
  4. Find and remove the entry point: Check core checksums, recent file changes, plugin and theme provenance, scheduled tasks, and accounts. Do not delete one scanner-flagged file while leaving an unknown entry point in place.
  5. Restore or rebuild: Restore from a known-clean backup that predates the intrusion and has been verified. If the entry point or impact is unclear, consider rebuilding the environment and restoring only necessary data from trusted sources.
  6. Verify before reopening: Update components, review administrator accounts and file permissions, and confirm logs no longer show suspicious activity before restoring public access.

Scope and Limitations

  • DISALLOW_FILE_EDIT only disables the dashboard file editor; it does not disable administrator accounts, patch vulnerabilities, or remove malicious code.
  • The Nginx example applies only to a compatible Nginx configuration. Rule order, paths, and PHP handling affect the result. Test in staging rather than copying it to every host.
  • File permissions must fit the host user, deployment, and automatic-update process. A recursive change to fixed modes can break updates or expose writable paths.
  • Backups and WAFs do not replace timely updates and least privilege. Edge rules cover only requests that pass through that service; protection depends on configuration and origin access.
  • This guide covers a single self-hosted site. Multisite, managed WordPress, and regulated data environments require platform- and policy-specific controls.

Frequently Asked Questions

Is changing the WordPress administrator username a useful main control?

No, not as a primary control. Usernames can be exposed through public pages or other features, and a change only affects some fixed-dictionary scans. Prioritize unique passwords, 2FA, least-privilege roles, and login rate limits. Also review inactive or shared administrator accounts and confirm that account recovery works.

What WordPress file permissions should I check before using 0755?

Do not recursively set everything to 0755. WordPress documents 0755 for directories and 0644 for files as common examples, but actual permissions depend on the web user, deployment, and update process. A blanket change can break updates or widen write access. Check ownership and the runtime user, then test the change in staging.

Should I disable XML-RPC when a WordPress site does not use it?

Only after confirming that no client or integration depends on XML-RPC. Mobile clients, Jetpack, or other integrations may use it; check logs and the integration inventory first, then restrict it through a supported host or plugin setting. If it is required, pair it with 2FA and rate limiting instead of breaking a live workflow.

How do I troubleshoot a failed WP-CLI core checksum?

Check the site path first. Then confirm the core version, such as WordPress 7.1, and identify differing files. wp core verify-checksums checks only covered WordPress core files, not plugins, themes, the database, accounts, or the server; custom files can also differ. Preserve the output and compare it with a trusted backup, logs, and host-side checks. Do not use the checksum result alone to clean a suspected breach.

Related Providers

  • Wordfence: Check current scope and update policy when assessing application-layer login protection or file checks.
  • Cloudflare WAF: When handling proxied traffic before the origin, verify DNS proxying, origin access controls, and the scope of the selected rules.

References

Community & Resources

Original source: 16IDC Original ↗