You can check all five passively in seconds with our zero-storage WordPress security checker — no account, no plugin, and nothing stored. Better still, closing all five takes under ten minutes at your web server or CDN edge (Nginx, Apache .htaccess, or Cloudflare WAF), removing attack surface before PHP even boots.
1. Block /xmlrpc.php at the edge or web server
xmlrpc.php was built in early WordPress to allow remote publishing clients and pingbacks. Its system.multicall method allows a single HTTP POST request to bundle hundreds of username-and-password attempts, turning basic login brute-force into an amplified CPU and database spike — even when wp-login.php is rate-limited.
Unless a client site explicitly relies on Jetpack or the legacy WordPress mobile app, block /xmlrpc.php before PHP executes:
- Nginx:
location = /xmlrpc.php { deny all; return 403; } - Apache
.htaccess: wrap<Files "xmlrpc.php"> Require all denied </Files> - Cloudflare WAF Custom Rule:
(http.request.uri.path eq "/xmlrpc.php")→ Block
Blocking at the web server or CDN saves server CPU during bot storms compared to letting WordPress boot and rejecting the call inside a PHP security plugin.
Check it now. The WordPress security checker passively checks WordPress version leaks, xmlrpc.php, REST user enumeration, debug.log exposure and OWASP headers with copy-paste Nginx, Apache, Cloudflare and functions.php fixes; the security headers checker reads a page’s HSTS, CSP, X-Content-Type-Options, frame protection, Referrer-Policy and Permissions-Policy. No account, and the address is not stored.
2. Restrict unauthenticated /wp-json/wp/v2/users enumeration
By default, WordPress exposes author accounts at /wp-json/wp/v2/users to anyone on the internet. Even when display names differ from login handles, the slug field frequently matches the real WordPress login username — handing credential-stuffing bots half of every admin login automatically.
A common mistake is disabling the entire WordPress REST API, which immediately breaks the Gutenberg block editor, Contact Form 7, WooCommerce Store API cart/checkout endpoints, and modern SEO plugins. Instead, restrict only unauthenticated requests to the users endpoints while keeping REST working normally for logged-in editors:
- Cloudflare WAF Custom Rule:
(starts_with(http.request.uri.path, "/wp-json/wp/v2/users") and not http.cookie contains "wordpress_logged_in_")→ Block - Lightweight
mu-pluginorfunctions.phpfilter: unset/wp/v2/usersand/wp/v2/users/(?P<id>[\d]+)insiderest_endpointswhenever!is_user_logged_in().
Verify after deploying by opening /wp-json/wp/v2/users in a private browser window (you should receive 401 or 403) and saving a draft post inside wp-admin to confirm the block editor still works cleanly.
3. Close /wp-content/debug.log permanently in production
During troubleshooting, developers frequently toggle define('WP_DEBUG', true) and define('WP_DEBUG_LOG', true) inside wp-config.php and forget to remove the generated /wp-content/debug.log file after fixing the bug. Because /wp-content/ is served directly as static files by Nginx and Apache, anyone requesting https://clientsite.com/wp-content/debug.log downloads full server filesystem paths, PHP warnings, plugin names, database queries, and occasionally API payloads in plain text.
- Set
define('WP_DEBUG_DISPLAY', false);and disableWP_DEBUG_LOGon production — or pass an absolute path outside the public webroot (define('WP_DEBUG_LOG', '/var/log/wp-site-debug.log');). - Delete any leftover
/wp-content/debug.logfile from the server. - Add a permanent server deny rule (
location ~* /wp-content/debug\.log$ { deny all; return 404; }in Nginx, or<FilesMatch "^debug\.log$"> Require all denied </FilesMatch>in.htaccess) so even a future debugging session can never leak logs publicly.
4. Hide exact WordPress version leaks (generator tag and /readme.html)
Hiding the WordPress version is not a substitute for timely patching, yet advertising an exact version string in <meta name="generator" content="WordPress ...">, /readme.html, and ?ver= asset URLs lets low-effort botnets immediately target unpatched installs during the window between CVE disclosure and your agency’s staging update cycle.
- Remove the HTML generator tag with
remove_action('wp_head', 'wp_generator');in a small must-use plugin. - Block
/readme.htmland/license.txtat Nginx, Apache, or Cloudflare WAF (returning404), since WordPress core updates routinely recreate those files if you only delete them from disk.
5. Ship core OWASP browser security headers
In our 2026 benchmark of 482 live European and North American websites, 58.5% shipped zero of the 5 core OWASP browser security headers. Adding four non-breaking baseline headers at Nginx, Apache, or Cloudflare protects visitors from MIME sniffing, clickjacking, and HTTPS downgrades without breaking WordPress themes or WooCommerce payment iframes:
Strict-Transport-Security: max-age=31536000; includeSubDomains(only once HTTPS and subdomains are confirmed working)X-Content-Type-Options: nosniffX-Frame-Options: SAMEORIGINReferrer-Policy: strict-origin-when-cross-origin
Audit existing headers and generate tailored server snippets anytime with the security headers checker, and verify email authentication with the DMARC, SPF & BIMI checker so WooCommerce order confirmations and password resets keep landing in Primary inboxes.
6. Pair edge/host hardening with external continuous monitoring
Hardening closes static exposures, but live WordPress and WooCommerce sites change every week as plugins update, certificates rotate, and editors publish pages. Separating responsibilities into three clean layers keeps agency maintenance margins healthy and prevents plugin bloat — see our full 2026 WordPress agency security and monitoring stack guide and Wordfence alternative comparison:
- Edge or host firewall: blocks malicious requests at Nginx, Cloudflare WAF, or your WordPress host before PHP runs.
- Updates & backups: handled by your managed host or lightweight update workflow with staging verification.
- External monitoring & security detection (Beamfar): watches every client site from two EU regions (Falkenstein (Germany) and Helsinki (Finland)) with zero PHP plugin overhead — confirming outages across regions, checking multi-step WooCommerce Store API cart/checkout flows, tracking DNS/TLS/redirect/accidental
noindexchanges, flagging WordPress and CISA KEV vulnerabilities plus 28 leaked frontend API key families, and sending automated white-label monthly client PDFs.
Questions
Does blocking /xmlrpc.php break WordPress updates or WooCommerce checkout?
No. Core/plugin updates, Gutenberg, and WooCommerce Store API use standard HTTPS and the modern REST API rather than XML-RPC. Only legacy XML-RPC clients (such as older WordPress mobile app flows or specific Jetpack features) rely on xmlrpc.php.
Why block /readme.html at the server level instead of just deleting the file?
Every WordPress core update extracts fresh core files into the webroot, bringing readme.html back automatically. A one-line Nginx, .htaccess, or Cloudflare WAF deny rule keeps it blocked permanently across updates.
What should I do if /wp-content/debug.log was publicly accessible?
Immediately block the path at your server/WAF, delete the log file from public storage, disable WP_DEBUG_LOG (or move it outside webroot), and inspect the last lines of the log for any leaked API tokens, database credentials, or session values that should be rotated.
Can I audit a client’s WordPress site before a care-plan sales call?
Yes. Run a zero-login check in our WordPress security checker, or generate a white-label 10-point Prospect Audit PDF inside Beamfar (Reports → Prospect website audit) covering uptime, TLS, DNS/DMARC, SEO indexability, OWASP headers, and leaked frontend API keys.
Sources
Read on . Standards and vendor pages change; confirm the current text before you rely on it.
- WordPress Developer Resources — Hardening WordPress (developer.wordpress.org)
- WordPress REST API Handbook — Authentication (developer.wordpress.org)
- OWASP Secure Headers Project (owasp.org)
- CISA Known Exploited Vulnerabilities Catalog (www.cisa.gov)
- WPVulnerability Database (www.wpvulnerability.com)