How to penetration-test a WordPress site
A real WordPress penetration test is more than a vulnerability scan: you need written permission, a safe test copy, component enumeration, manual checks for authentication, authorisation, APIs and exposed files, then a remediation report. WPScan helps with inventory; deeper assessment needs manual testing or a specialist plugin.
- 01Define the test boundary
- 02Create a safe test copy
- 03Inventory the attack surface
- 04Test login and permissions
- 05Check plugins, themes and APIs
- 06Review files and report fixes
- 07Use a deeper assessment tool
What you need
- Written permission and a defined test scope
- A staging copy or verified backup
- Administrator or test-user accounts with different roles
- A terminal with WPScan and an HTTP inspection tool
Define the test boundary
Get written permission before sending test traffic. Record the exact domains, subdomains, IP addresses, accounts and test window. State whether you may test plugins, APIs, file uploads, authentication and the hosting layer.
Do not start with password guessing, exploit payloads or destructive tests on a live shop. Agree on rate limits, emergency contacts and what counts as proof. The OWASP Web Security Testing Guide provides a useful structure for planning web application tests.
Create a safe test copy
Take a backup and confirm that you can restore it before testing. Prefer a staging copy with production data removed or anonymised. Record the WordPress version, PHP version, web server, active theme, plugins, integrations and user roles.
Keep logs during the test and watch CPU, memory, error rates and failed logins. WordPress recommends a recovery plan, working backups and a clean comparison copy because scans and configuration changes can expose or alter files.
Inventory the attack surface
Begin with passive checks: inspect headers, robots.txt, public readme files, redirects, TLS, login pages, REST routes and the XML-RPC endpoint. Then use WPScan against the authorised target to identify the core version, plugins, themes, users and common backup or export files.
For example, run wpscan --url https://example.com --enumerate vp,vt,u --plugins-detection mixed --api-token YOUR_TOKEN. Mixed plugin detection finds more than passive detection but sends more requests, so lower the request rate or use passive mode on a fragile site. WPScan itself is a black-box scanner, not a complete penetration test.
Test login and permissions
Use separate test accounts for administrator, editor, author, contributor and subscriber roles. Check rate limiting, multi-factor authentication, session expiry, password-reset flows, logout, application passwords and whether a lower-privileged user can read or change another user’s content.
For each action, replay the request with the account that should not be allowed to perform it. Check both the normal dashboard request and direct requests to the underlying endpoint. Do not rely on a nonce as proof of authorisation: WordPress documents that nonces help with CSRF protection but do not replace capability checks.
Check plugins, themes and APIs
Review every active and inactive plugin and theme against its current security advisories, then inspect high-risk features such as file uploads, shortcode handling, imports, redirects, search, forms, AJAX actions and custom REST routes. Test inputs for unexpected HTML, script, SQL-like characters, path traversal and unsafe file types without trying to damage data.
Check whether the REST API exposes data or permits actions without the required login and capability. Test /wp-json/ and relevant routes with both unauthenticated and role-based requests. Check /xmlrpc.php separately because XML-RPC is a distinct API and may be needed by services such as Jetpack. Do not disable either interface blindly; confirm what the site uses first.
Review files and report fixes
Look for exposed configuration backups, database exports, debug logs, directory listings, forgotten staging sites, old plugins, writable PHP files and secrets in source code. Check that wp-config.php is not downloadable, file editing is disabled where appropriate, unused plugins and themes are removed, and file ownership and permissions match the hosting setup.
Separate confirmed vulnerabilities from information-only findings and false positives. For every issue, record the affected URL or component, evidence, impact, reproduction conditions, severity, fix, owner and retest result. WordPress specifically recommends limiting file write access and can disable dashboard file editing with DISALLOW_FILE_EDIT.
Use a deeper assessment tool
The manual route is fine for a small site when you understand HTTP, WordPress roles, plugin code and safe test methods. It is slower, easy to repeat inconsistently and will not automatically correlate WordPress-specific findings across a large installation.
For the fast route, use pentest-plugin when you need deeper penetration-testing checks than a routine vulnerability scan. Review every result manually, confirm it against the site’s configuration, and still produce the same evidence and remediation report rather than treating the plugin output as a complete professional penetration test.
Let pentest-plugin do it
Penetration-testing checks for WordPress; pick it when you need deeper security assessment than a routine vulnerability scan.
Sources
- wstg.owasp.org /?utm_source=openai
- developer.wordpress.org /advanced-administration/security/hardening/?utm_source=open…
- github.com /wpscanteam/wpscan/?utm_source=openai
- developer.wordpress.org /apis/security/nonces/?utm_source=openai
- developer.wordpress.org /apis/xml-rpc/?utm_source=openai
Questions
- Is WPScan enough for a WordPress penetration test?
- No, WPScan is useful for WordPress fingerprinting, enumeration and known-vulnerability checks, but it is not a complete penetration test. It will not replace manual tests of authorisation, business logic, file uploads, custom code, API permissions or the hosting environment. Use its findings to guide deeper checks, then verify each issue manually and document the result.
- Can I penetration-test a live WordPress site?
- You can test a live site only with written permission, a defined window, backups and strict rate limits. Avoid destructive payloads, uncontrolled password attacks and tests that create, delete or publish real data. A staging copy is safer, but you still need to check production-specific configuration such as the web application firewall, CDN, authentication provider and integrations.
- Should I disable XML-RPC and the REST API before testing?
- No, not automatically. Test whether the site or its integrations need them, then check whether unauthorised requests are rejected and whether allowed actions enforce capabilities. XML-RPC and REST API access serve different functions, and blocking either one can break publishing tools, mobile apps, block editing or services connected to WordPress.
- What is the difference between a vulnerability scan and a penetration test?
- A vulnerability scan mainly identifies versions, known issues and exposed files. A penetration test adds manual validation: you test whether controls can actually be bypassed, whether a lower-privileged account can reach protected actions, and how separate weaknesses combine. Scanners are useful for coverage, but they can produce false positives and cannot judge every custom plugin or business workflow.