OPEN TO FULL-TIME ROLES (Available to start immediately. Remote preferred worldwide.)✦// STACK:✦WORDPRESS & WOOCOMMERCE✦REACT & NEXT.JS✦PHP✦TYPESCRIPT✦WEB PERFORMANCE✦API INTEGRATIONS & AUTOMATIONS✦ARTIFICIAL INTELLIGENCE✦// PROTOCOL: MCP · JSON-RPC 2.0✦// STATUS: PRODUCTION READY✦
HDRX
• 11 min read
SecurityWordPressWooCommerceHardeningAppSec

WordPress Hardening in the Age of Automated Exploitation: A Checklist That Works in Production

When bots and AI agents test new flaws within hours, WordPress security stops being "install a security plugin." A practical hardening checklist — server, wp-config, users, plugins, monitoring, and incident response.

Nearly every compromised WordPress site I’ve analyzed fell for an unglamorous reason: an outdated plugin, a reused password, a forgotten PHP version on the server. No sophisticated attack — just automation finding the weak link before the owner did.

And that automation got a lot faster. In 2026, critical flaws like PHP2Shell started being tested against the whole internet within hours of going public. For anyone running WordPress and WooCommerce in production, the question changes from “is my site interesting to an attacker?” to “is my site on the list a bot will sweep today?” — and the answer is always yes.

This is the checklist I use in practice, ordered from the lowest layer (server) to the highest (application and operations).

1. Server and Runtime: The Layer Nobody Looks At

Supported PHP, always. A flaw in the interpreter bypasses anything you do in WordPress. Check the real version in production and stay on a line still supported by the PHP project. On shared hosting, check the version selector for each site — it’s common for an old site to stay “stuck” on an old version.

An unprivileged web server user. The PHP process (www-data, nginx, or the PHP-FPM pool user) shouldn’t be able to write everywhere. Ideally only wp-content/uploads (and the cache folder, if needed) is writable.

Never execute PHP in the uploads folder. It’s the cheapest trick and one of the most effective: if someone manages to upload a disguised .php file, it won’t run.

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

On Apache, the equivalent is an .htaccess inside uploads denying .php files.

2. wp-config.php: Constants That Close Doors

A few lines in wp-config.php remove entire attack paths:

// Block editing themes and plugins from the dashboard (otherwise a compromised admin becomes RCE)
define( 'DISALLOW_FILE_EDIT', true );

// Optional, stricter: block installing/updating plugins from the dashboard.
// Use it when updates go through deployment (Git, CI) rather than wp-admin.
define( 'DISALLOW_FILE_MODS', true );

// Force HTTPS in the admin area
define( 'FORCE_SSL_ADMIN', true );

Also: generate unique salts and keys (WordPress.org provides a generator), keep wp-config.php out of public read reach, and never commit database credentials to Git.

An honest note: changing the wp_ table prefix isn’t a meaningful security measure. It doesn’t hurt, but it replaces nothing on this list.

3. Users and Authentication

Fewer administrators. Every administrator account is a door to RCE (via plugin upload, when allowed). Editors and authors don’t need administrator.

2FA for everyone with dashboard access. A password leaked from another site is the most common way into a dashboard.

Scoped, reviewed application passwords. WordPress “Application Passwords” are great for integrations, but they pile up. Review and revoke the ones no longer in use.

Close user enumeration. By default, /wp-json/wp/v2/users lists authors publicly, handing out login names for brute-force attacks. If the site doesn’t need that endpoint public:

add_filter( 'rest_endpoints', function ( $endpoints ) {
    if ( ! is_user_logged_in() ) {
        unset( $endpoints['/wp/v2/users'] );
        unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
    }
    return $endpoints;
} );

Limit login attempts and XML-RPC. If no integration uses xmlrpc.php (old apps, Jetpack in some setups), block it at the web server. If something does, rate-limit it.

4. Plugins and Themes: The Biggest Attack Surface

The vast majority of exploited WordPress flaws are in plugins, not core. Three rules cover most of the risk:

  1. A lean inventory. Remove (don’t just deactivate) unused plugins and themes. Deactivated code is still on disk and, in some cases, still reachable.
  2. Provenance. “Nulled” plugins (pirated paid versions) are one of the most common ways in, with a backdoor pre-installed.
  3. An update policy with staging. Blind updates in production break stores; not updating leaves the door open. The middle ground is a staging environment, weekly updates, and an emergency window for critical flaws — hours, not weeks.

For WooCommerce, include payment, shipping, and integration plugins in the review: they touch sensitive data and usually get less attention than the theme.

5. The Edge: WAF, Rate Limiting, and Headers

A WAF (Cloudflare, Sucuri, or rules on your own server) doesn’t replace patching, but it buys time: it blocks obvious scans, ships emergency rules when a big flaw appears, and enables rate limiting on wp-login.php and xmlrpc.php.

Round it out with basic security headers (Strict-Transport-Security, X-Content-Type-Options: nosniff, Referrer-Policy) and, where feasible, a Content Security Policy — even starting in report-only mode.

6. Backups You’ve Actually Restored

A backup that’s never been restored is a hope, not a plan. The minimum:

  • Automatic backups of files and database, stored off the server (an attacker with server access deletes local backups).
  • Multiple retained versions — infections are sometimes discovered weeks later.
  • A periodic restore test in a separate environment.

7. Monitoring: Find Out in Hours, Not Months

Modern attackers don’t deface the home page; they install a quiet backdoor, inject SEO spam, or silently skim checkout data. To notice:

  • File integrity: compare core files against official checksums (wp core verify-checksums in WP-CLI) and alert on new PHP files in uploads.
  • Access and authentication logs, with alerts for failed-login spikes and admin access from unusual places.
  • External monitoring for uptime and unexpected content changes.

8. A Response Plan Before the Incident

When something happens, deciding under pressure is expensive. Write down: who has access to what, how to put the site in maintenance mode, where the clean backups are, how to rotate every credential (database, salts, admins, API keys), and whom to notify — including customers, if personal data is involved.

Summary Checklist

  • PHP on a supported version, verified in production
  • PHP execution blocked in uploads
  • DISALLOW_FILE_EDIT enabled (and DISALLOW_FILE_MODS, if your deployment allows it)
  • 2FA for all dashboard users; few administrators
  • User enumeration and XML-RPC closed or limited
  • Unused plugins and themes removed; nothing “nulled”
  • Staging + update policy with an emergency window
  • WAF and rate limiting at the edge
  • Off-server backups with tested restores
  • Integrity and log monitoring with alerts
  • A written incident response plan

Where a Pentest Fits

A checklist covers the known. An authorized penetration test shows what only appears when you look from the outside like an attacker: the custom plugin with an authorization flaw, the forgotten integration endpoint, the old backup reachable by URL. If you run WordPress or WooCommerce in production and want that outside view, it’s the kind of work I do in pentest and AppSec.

Frequently Asked Questions

Does a security plugin cover all of this?

No. Security plugins help with part of it (application firewall, scanner, login limits), but they run inside WordPress — they don’t protect against a PHP flaw, a misconfigured server, or a backup that won’t restore. They’re a layer, not the strategy.

Are automatic plugin updates safe?

For simple, well-maintained plugins, usually yes, and they reduce risk. For WooCommerce stores with payment integrations, prefer updating through staging on a short deadline — the point is not to leave a critical flaw open for weeks out of fear of breaking something.

Does hiding wp-admin or changing the login URL improve security?

It reduces bot noise, which helps with logs. But it doesn’t replace 2FA and strong passwords: it’s obscurity, not protection.

My site is small. Will anyone really attack it?

Yes, because the attack isn’t personal: bots sweep the entire internet looking for vulnerable versions. Small sites are often used to host phishing, SEO spam, or to attack other sites.

Questions or project ideas?

Reach out directly to discuss architecture, optimization, or AI agents.

Get in Touch →