Security guide
WordPress Enumeration & Hardening — a community guide
A defensive guide to WordPress structure, authorized enumeration, common misconfigurations, and practical hardening steps.
Alpesh Bhagwatkar
November 11, 2025

Introduction
WordPress is the most popular open-source CMS powering a huge portion of the web. That ubiquity makes it a rich subject for security research — but also a high-impact target when misconfigured or outdated. This guide covers enumeration techniques, what the WordPress file structure and key files look like, how to responsibly discover information during authorized testing, and how site owners can harden installations to reduce risk.
Reminder: Everything here is intended for defensive, educational, or authorized testing only. Do not test systems you do not own or do not have explicit permission to test.
WordPress at a glance — what a CMS is
A Content Management System (CMS) helps build websites without coding everything from scratch. Two complementary parts make up a CMS:
- Content Management Application (CMA): the admin interface used to add and manage content.
- Content Delivery Application (CDA): the backend that assembles content into a website.
Because the CMA and CDA interact with many moving parts (themes, plugins, uploads, external APIs), enumerating those parts during an authorized assessment helps reveal attack surface and misconfigurations.
Typical WordPress file layout
On many Linux stacks, WordPress files are served from a webroot such as /var/www/html. Here’s a typical top-level layout:
.
├── index.php
├── license.txt
├── readme.html
├── wp-activate.php
├── wp-admin/
├── wp-blog-header.php
├── wp-comments-post.php
├── wp-config.php
├── wp-content/
├── wp-includes/
├── wp-login.php
├── xmlrpc.php
└── ...other core files...
Key files and folders to look for:
- wp-config.php: critical database credentials, salts, table prefix, and debug flags. Keep this outside the web root when possible and restrict access.
- wp-content/: where plugins, themes, and uploads live. uploads/ often stores user-supplied files and is a common place to check file permissions and allowed file types.
- wp-admin/ and wp-login.php: admin entry points. Consider rate-limiting and MFA for these paths.
- xmlrpc.php: legacy XML-RPC interface; many deployments disable it if unused (the REST API supersedes it).
A dummy example of a wp-config.php file:
<?php
define( 'DB_NAME', 'wordpress_db' );
define( 'DB_USER', 'wp_user' );
define( 'DB_PASSWORD', 'dummy_password_123' );
define( 'DB_HOST', 'localhost' );
define( 'DB_CHARSET', 'utf8mb4' );
define( 'DB_COLLATE', '' );
define( 'AUTH_KEY', 'dummy-auth-key-replace-this-with-real-key' );
define( 'SECURE_AUTH_KEY', 'dummy-secure-auth-key-replace-this-with-real-key' );
define( 'LOGGED_IN_KEY', 'dummy-logged-in-key-replace-this-with-real-key' );
define( 'NONCE_KEY', 'dummy-nonce-key-replace-this-with-real-key' );
define( 'AUTH_SALT', 'dummy-auth-salt-replace-this-with-real-salt' );
define( 'SECURE_AUTH_SALT', 'dummy-secure-auth-salt-replace-this-with-real-salt' );
define( 'LOGGED_IN_SALT', 'dummy-logged-in-salt-replace-this-with-real-salt' );
define( 'NONCE_SALT', 'dummy-nonce-salt-replace-this-with-real-salt' );
$table_prefix = 'wp_';
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'DISALLOW_FILE_EDIT', true );
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
require_once ABSPATH . 'wp-settings.php';
WordPress roles — who can do what
Understanding roles helps prioritize which accounts to protect and which privilege escalations would be most damaging:
| Role | Description |
|---|---|
| Administrator | Full control: manages users, themes, plugins, and site settings. |
| Editor | Publish and manage posts for all users. |
| Author | Publish and manage own posts. |
| Contributor | Write and manage own posts, cannot publish. |
| Subscriber | Basic account for reading and profile updates. |
Defensive advice: Limit admin accounts, enforce unique usernames and strong authentication, and use the principle of least privilege.
Safe, responsible enumeration (what to do, and why)
During authorized security assessments, enumeration helps you map the attack surface so you can recommend mitigations. Below are commonly useful, non-destructive checks and what they reveal.
Version discovery
Look for innocuous indicators of WordPress and component versions:
- A meta name="generator" tag in HTML, if present.
- readme.html (older installs may expose the version).
- Version strings appended to static assets (JS/CSS); sometimes the version appears as a query parameter.
Why: Knowing versions helps determine whether publicly known vulnerabilities may apply and therefore whether patching is warranted.
Plugins & themes inventory
Identify the plugins and themes in use by inspecting resources loaded by the site (CSS/JS filenames, comments, and paths under wp-content/plugins/ or wp-content/themes/).
Why: Third-party plugins and themes are the most common source of vulnerabilities. Knowing which are present helps prioritize audits and updates.
User discovery (non-destructive)
Some endpoints and public pages can reveal usernames (author pages, published posts, or the REST API for sites configured to expose authors). Use this only in authorized settings.
Why: Valid usernames are often the first input for access control reviews and hardening guidance. If enumerated, recommend protections like rate limiting, MFA, and lockouts.
Tools
There are reputable tools used by defenders and auditors to scan and inventory WordPress sites. Use them only on systems you own or are authorized to test.
- WPScan: a WordPress vulnerability scanner useful for enumerating plugins/themes and known issues (requires an API key for vulnerability lookups).
- Nmap (NSE scripts): network-level discovery with WordPress-specific scripts for higher-level assessment.
- Manual inspection: viewing HTML source, headers, robots, and public endpoints.
Note: Tools may have options that perform intrusive or credentialed tests. For community guidance we emphasize inventory and configuration auditing, not automated offensive attacks.
Brute force & login hardening (defensive perspective)
Credential stuffing and password brute force remain common. Instead of demonstrating attack techniques, here’s how to mitigate them:
- Disable or restrict XML-RPC if not used; it has historically been leveraged for automated login attempts.
- Require strong passwords and enable multi-factor authentication (MFA) for privileged accounts.
- Rate-limit login attempts and implement account lockout policies with careful thresholds to avoid denial of service.
- Monitor and alert on repeated failed logins and unusual login locations.
- Consider adding a web application firewall (WAF) or managed protection service to block abusive traffic.
Common misconfigurations & high-risk features
These are items defenders should check and remediate:
- Editable theme/plugin editor enabled: WordPress ships with a file editor that lets admins edit PHP files from the dashboard. If an admin account is compromised, an attacker can use this to run arbitrary code. Mitigation: set define('DISALLOW_FILE_EDIT', true); in wp-config.php and limit update/install privileges.
- Outdated core/plugins/themes: patch promptly and remove abandoned plugins.
- World-writable upload directories or permissive file permissions: enforce minimal filesystem rights and validate uploaded content types.
- Secrets in the webroot: move config files out of web-accessible directories where possible, and rotate credentials if exposed.
Recommended hardening checklist
- Keep WordPress core, themes, and plugins updated. Remove unused packages.
- Enforce strong passwords and MFA on all privileged accounts.
- Disable the file editor and disallow direct file modifications via the dashboard.
- Restrict and harden wp-config.php (file permissions, move if possible).
- Disable XML-RPC if unused; restrict the REST API where appropriate.
- Harden file permissions on wp-content/uploads and disable directory listing.
- Use a WAF and enable HTTPS site-wide with HSTS.
- Implement centralized logging and alerting for logins, file changes, and admin actions.
- Back up regularly and test restores.
- Conduct periodic authorized scans and peer code review for custom themes/plugins.
