WordPress Security

Common WordPress Security Weaknesses

Common WordPress weaknesses explained: outdated plugins, user enumeration, xmlrpc.php abuse, exposed backups and missing headers, with practical fixes for each.

WordPress core is actively maintained and receives security updates quickly. Most WordPress compromises do not come from exotic flaws in core, but from the way individual sites are built and run: plugins that were never updated, admin accounts protected by guessable passwords, backup files left in the web root, and default behaviour nobody thought to turn off. The good news is that these weaknesses are well understood and usually straightforward to fix. This article walks through the most common ones, how they are found from the outside, and what to do about each.

Outdated core, plugins and themes

The single most important WordPress security control is keeping software up to date. When a vulnerability in a popular plugin is disclosed, the fix and the technical details become public at roughly the same time. Sites that do not update are then exposed to anyone who reads the advisory.

From the outside, versions are often easy to identify. WordPress may reveal its version through the generator meta tag, RSS feeds, readme.html, or version query strings on CSS and JavaScript files (?ver=). Plugins and themes frequently expose their versions through readme.txt files in their directories.

How to fix it:

  • Enable automatic updates for minor core releases (the default) and consider them for plugins you trust.
  • Review and apply plugin and theme updates on a regular schedule, testing on staging first for complex sites.
  • With shell access, wp core update, wp plugin update --all and wp theme update --all in wp-cli make routine updates quick.
  • Remove version disclosure where practical, but treat this as noise reduction, not a fix. Hiding a version does not patch it.

Abandoned and unused plugins

A plugin that is no longer maintained will not receive fixes for newly discovered issues. Plugins that have been closed or removed from the official directory deserve particular attention, because closure can be related to an unresolved security problem.

Deactivated plugins are also a risk. Deactivation stops a plugin from running through WordPress, but its files stay on the server and some vulnerable files may still be directly reachable over HTTP.

How to fix it:

  • Delete, rather than deactivate, any plugin or theme you do not use, including default themes you have replaced.
  • For each remaining plugin, check when it was last updated and whether it is still listed and supported.
  • Replace abandoned plugins with maintained alternatives, or move the functionality into maintained code.
  • Keep the total number of plugins as low as the site’s needs allow.

Weak admin access and user enumeration

WordPress makes it fairly easy to discover usernames. Common enumeration techniques include:

  • Requesting /?author=1, which may redirect to /author/username/
  • Querying the REST API at /wp-json/wp/v2/users, which lists users who have published content
  • Different error messages on the login page for unknown users and wrong passwords
  • Author names in feeds, post metadata and oEmbed responses

Usernames are not secrets in themselves, but once they are known, attackers only need to guess the password. Combined with weak or reused passwords and no rate limiting, this makes credential attacks against wp-login.php practical.

How to fix it:

  • Require strong, unique passwords for every account with publishing or admin rights.
  • Enable multi-factor authentication for administrators and editors.
  • Limit login attempts or rate-limit authentication endpoints at the application, web server or WAF level.
  • Restrict the REST API users endpoint to authenticated requests if your site does not need it public, and block author-archive enumeration if author pages are not used.
  • Review user accounts periodically and remove ones that are no longer needed. Give each person the lowest role they need.

xmlrpc.php abuse

xmlrpc.php is a legacy remote-publishing interface. Many sites no longer need it, but it is enabled by default. It is a common target for two reasons:

  • Credential guessing: the system.multicall method can allow many login attempts in a single HTTP request, which can bypass protections that only count requests to wp-login.php.
  • Pingback abuse: the pingback feature can be used to make the site send requests to third-party systems, contributing to denial-of-service traffic or probing of other hosts.

How to fix it:

  • If nothing on your site uses XML-RPC (some mobile apps, older integrations and certain plugins do), block access to xmlrpc.php at the web server or WAF level.
  • If you need it, disable pingbacks and apply rate limiting and authentication protections to it as well.

Exposed backups, config files and repositories

Some of the most serious findings in WordPress assessments involve files that should never be publicly accessible. Typical examples:

Exposed item Why it matters
wp-config.php.bak, wp-config.php~, wp-config.old, .save copies Editors and manual edits create copies that the web server returns as plain text, revealing database credentials and secret keys
Database dumps (.sql, .sql.gz) and site archives (.zip, .tar.gz) Can contain the entire database, including user tables and personal data
.git/ directory May allow the full source code and its history to be downloaded, sometimes including credentials committed in the past
wp-content/debug.log Debug logs may expose file paths, plugin errors, queries and occasionally sensitive data
.env files and installer or test scripts Often contain secrets or provide unintended functionality

How to fix it:

  • Store backups outside the web root or in separate storage, never in a publicly served directory.
  • Delete stray copies of configuration files after editing.
  • Deploy without the .git directory, or block access to dotfiles and dot-directories at the web server.
  • In production, set WP_DEBUG to false, or if you need logging, set WP_DEBUG_DISPLAY to false and write the log outside the web root.
  • If any credentials were exposed, rotate them: database password, the authentication keys and salts in wp-config.php, and any API keys.

Directory listing

When a directory has no index file and listing is enabled on the web server, anyone can browse its contents. In WordPress this most often affects wp-content/uploads/ and plugin directories, revealing uploaded documents, backups created by plugins, and exact plugin file structures.

How to fix it: disable directory indexes in the web server configuration (for example Options -Indexes on Apache or autoindex off on nginx) and confirm the change with a browser request.

File permissions and in-dashboard file editing

Overly permissive file permissions let a compromised plugin or another account on shared hosting modify files it should not touch. The built-in theme and plugin editor means that anyone who gains an admin session can also change PHP code directly from the dashboard.

How to fix it:

  • Use conservative permissions, commonly 644 for files and 755 for directories, with wp-config.php more restrictive where your hosting allows it. Avoid 777 anywhere.
  • Add define('DISALLOW_FILE_EDIT', true); to wp-config.php to disable the dashboard code editor.
  • Block PHP execution in wp-content/uploads/, where only media files should live.

Missing HTTP security headers and TLS weaknesses

WordPress does not set most security headers by default. Missing headers rarely cause a compromise on their own, but they remove useful layers of defence.

  • Strict-Transport-Security enforces HTTPS after the first visit.
  • Content-Security-Policy limits where scripts and other resources can load from, reducing the impact of cross-site scripting.
  • X-Content-Type-Options: nosniff prevents MIME-type sniffing.
  • X-Frame-Options or the CSP frame-ancestors directive helps prevent clickjacking.
  • Referrer-Policy and Permissions-Policy limit information leakage and browser feature access.

On the TLS side, check that only current protocol versions are enabled, certificates are valid and renewed automatically, and all HTTP traffic redirects to HTTPS.

Admin area exposure

By default, /wp-admin/ and wp-login.php are reachable from anywhere. For many sites that is unnecessary.

How to fix it: where your team works from known locations, restrict the admin area by IP address or place it behind a VPN or access proxy. Otherwise, rely on strong passwords, multi-factor authentication and rate limiting. Renaming the login URL can reduce automated noise but should not be your main control.

Checking your own site

Most of the weaknesses above can be identified externally, without access to the server, which is also how attackers find them. A structured review covers core and component versions, known plugin and theme vulnerabilities, exposed files, enumeration endpoints, headers and TLS. Our WordPress Security Assessment does exactly this for sites you are authorised to have tested, and the findings can feed into a wider External Vulnerability Assessment if the site shares infrastructure with other systems.

A reminder: only test WordPress sites you own or have written permission to assess. Probing someone else’s site, even with good intentions, may be illegal.

If you would like an independent look at your WordPress site and a prioritised list of fixes, you can request an assessment quote and we will agree a scope that fits your setup.