12 WordPress security gaps you can spot with a browser and curl
I have worked with WordPress for more than 10 years and over 200 projects. Almost every site that came to me had the same basic security gaps, and it did not matter who built it. Agencies ship bad code too, and some freelancers do better work than a whole studio. The logo on the invoice tells you nothing about the code.
In 2012 Robert Mueller, then director of the FBI, said there are only two types of companies: those that have been hacked and those that will be. WordPress sites have a third type: hacked months ago, and nobody has noticed yet 🙃
Problem: WordPress gets called insecure, but most of what bots use against it is visible to any visitor: an open login, public user names, plugin versions, old APIs, server versions, forgotten backup files. The same goes for slow pages, mail in spam and pages Google is told to skip.
Solution: Check the site the way a bot does, with a browser and a few curl and dig commands, and close each gap. Below are the 12 problems I see most often, what each one looks like from the outside and how to fix it. Most fixes take minutes.
1. The login page is open to the whole internet
On most WordPress sites /wp-login.php answers to anyone:
$ curl -s -o /dev/null -w "%{http_code}\n" https://example.com/wp-login.php
200
That is not a hole by itself, but it means bots can try passwords around the clock. On shared hosting thousands of login attempts a day also slow the site down for real visitors.
What helps: limit login attempts, add two-factor login for admins, and if only a few people ever log in, move the login address or allow it only from known IPs. I wrote about rate limiting the login, two-factor login without a plugin and changing the login URL.
2. User names are public
A bot that tries passwords needs a user name first, and WordPress gives it away in two requests. /?author=1 redirects to the author archive, and the REST API lists everyone who has published a post. Very often the slug is the same as the login:
$ curl -sI "https://example.com/?author=1" | grep -i location
Location: https://example.com/author/site-admin/
$ curl -s https://example.com/wp-json/wp/v2/users | jq '.[] | {id, slug}'
{
"id": 1,
"slug": "site-admin"
}
{
"id": 2,
"slug": "shop-manager"
}
What helps: redirect author archives on a single-author site, close the users endpoint for visitors who are not logged in, and use a display name that is different from the login. Details and code: prevent username enumeration and REST API hardening.
3. Plugin versions are easy to read
Every script and style a plugin loads usually carries its version, and the plugin’s readme.txt is public by default:
$ curl -s https://example.com/ | grep -o 'contact-form-7/[^"]*ver=[^"]*' | head -1 contact-form-7/includes/swv/js/index.js?ver=6.2.5 $ curl -s https://example.com/wp-content/plugins/contact-form-7/readme.txt | grep 'Stable tag' Stable tag: 6.2.5
Anyone can compare that number with a vulnerability database, and bots do it all day, looking for one old plugin version with a known hole.
What helps: update plugins (I keep minor updates automatic, see auto-updates for plugins and themes), delete plugins you do not use, and block readme.txt files. Hiding the version only slows bots down; updating is the real fix. More on this in auditing plugin and theme dependencies.
4. xmlrpc.php still answers
xmlrpc.php is an old remote API. Few sites need it today (Jetpack and some mobile apps do), but it is on by default. Its system.multicall method lets a bot try hundreds of passwords in one request, past most login limiters:
$ curl -s -d '<methodCall><methodName>system.listMethods</methodName></methodCall>' \
https://example.com/xmlrpc.php | grep -c '<string>'
78
$ curl -s -d '<methodCall><methodName>system.listMethods</methodName></methodCall>' \
https://example.com/xmlrpc.php | grep -o -E 'system.multicall|wp.getUsersBlogs'
system.multicall
wp.getUsersBlogs
What helps: if nothing on the site uses it, deny it in the server config. A filter in PHP is not enough, because pingbacks stay open:
<Files xmlrpc.php>
Require all denied
</Files>
More options in disable and secure xmlrpc.php.
5. The server tells everyone its versions
The response headers often show the exact PHP version, and the page source shows the WordPress version:
$ curl -sI https://example.com/ | grep -i -E 'server|x-powered-by' Server: Apache/2.4.69 (Debian) X-Powered-By: PHP/8.4.27 $ curl -s https://example.com/ | grep generator <meta name="generator" content="WordPress 7.1.4" />
I found the first one on my own site while writing this. PHP added the header to every page, because the host has expose_php on and it can only be switched off in the server’s php.ini:
$ curl -sI -A 'Mozilla/5.0' https://helloadmin.com/ | grep -i x-powered-by X-Powered-By: PHP/8.4.27
The fix was two lines in .htaccess, plus header_remove( 'X-Powered-By' ) on the send_headers hook as a backup:
<IfModule mod_headers.c>
Header always unset X-Powered-By
Header unset X-Powered-By
</IfModule>
While you are there, add HSTS, X-Content-Type-Options, X-Frame-Options and Referrer-Policy: security headers via .htaccess. A Content Security Policy is the next step, and it needs testing first: CSP for WordPress.
6. Real visitors see a slow site
PageSpeed Insights shows two kinds of numbers. The lab score at the bottom is one test run. The block on top, “Discover what your real users are experiencing”, comes from Chrome users who opened the site in the last 28 days (if the site has enough traffic). Those are the numbers Google uses. Good values: LCP under 2.5 s, INP under 200 ms, CLS under 0.1.
If the top block is red on mobile, visitors are leaving before the page loads, and no plugin will fix that alone. Start with the biggest element on the page (usually the hero image), then the scripts. My checklist: optimize LCP, CLS and INP in WordPress.
7. Heavy images and no browser cache
Open DevTools, Network tab, filter by Img and reload. I often see a 3 MB photo shown at 400 px wide, and PNG used for photos. Then check the headers of one image:
$ curl -sI https://example.com/wp-content/uploads/2024/05/hero.png | grep -i -E 'content-length|cache-control|expires' Content-Length: 3145728
No Cache-Control and no Expires means every returning visitor downloads the same 3 MB again.
What helps: resize on upload, serve WebP or AVIF, lazy-load images below the fold, and set long cache headers for static files. See WebP without a plugin and gzip and cache headers in .htaccess.
8. Every plugin loads its files on every page
Count the plugin files on a page that does not need them, for example a blog post:
$ curl -s https://example.com/blog/some-post/ | grep -o -E 'wp-content/plugins/[^/]+' | sort | uniq -c
4 wp-content/plugins/contact-form-7
2 wp-content/plugins/revslider
9 wp-content/plugins/woocommerce
A slider used only on the home page, a form used on Contact, the full WooCommerce cart scripts on a blog post. Each one is another request and more JavaScript for the phone to run.
What helps: load assets only where they are used, and defer the rest. Code for WooCommerce: disable WooCommerce scripts on non-shop pages. General approach: defer JavaScript and CSS.
9. Mail from the site goes to spam
Order emails, password resets and contact form messages are sent from your domain. Three DNS records tell Gmail and Outlook that the server is allowed to do that: SPF, DKIM and DMARC. Anyone can look them up. Since 2024 Gmail and Yahoo require them from bulk senders, and mail without them lands in spam more often for everyone else too. Here are mine:
$ dig +short TXT helloadmin.com | grep spf "v=spf1 +a +mx +ip4:… ~all" $ dig +short TXT default._domainkey.helloadmin.com | cut -c1-60 "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCA $ dig +short TXT _dmarc.helloadmin.com "v=DMARC1; p=none;"
All three exist, but my DMARC is at p=none, which only watches. The next step is p=quarantine once all my mail passes. If the site sends mail through PHP mail() on shared hosting, also send it through SMTP: SMTP without a plugin.
10. HTTPS that is only half done
The padlock is there, but http:// and www. still open the site without a redirect, some images load over http (the browser console shows “Mixed Content”), or the certificate expires next week and nobody gets the warning. This is how it should look:
$ echo | openssl s_client -connect helloadmin.com:443 -servername helloadmin.com 2>/dev/null \
| openssl x509 -noout -enddate
notAfter=Dec 19 07:42:38 2026 GMT
$ curl -sI http://helloadmin.com/ | grep -i -E '^HTTP/|^location'
HTTP/1.1 301 Moved Permanently
Location: https://helloadmin.com/
$ curl -sI https://www.helloadmin.com/ | grep -i -E '^HTTP/|^location'
HTTP/1.1 301 Moved Permanently
Location: https://helloadmin.com/
What helps: one 301 from every variant to https:// without www (or with it, just one), fixed URLs in the database, and a reminder for the expiry date even if renewal is automatic. See force HTTPS with a 301 and fix mixed content.
11. Google is told not to index the site
This one costs money quietly. A site goes live with the “Discourage search engines” box still ticked from staging, or a Disallow: / left in robots.txt, or every page has a canonical pointing to the staging domain. It takes a minute to check:
$ curl -s https://example.com/robots.txt User-agent: * Disallow: / $ curl -s https://example.com/ | grep -o -E '<meta name=.robots.[^>]*>|<link rel=.canonical.[^>]*>' <meta name='robots' content='noindex, nofollow' /> <link rel="canonical" href="https://staging.example.com/" />
What helps: fix the setting, submit the sitemap in Search Console and watch the Pages report for a few weeks. More: sitemaps and robots.txt without a plugin.
12. Backups and config copies left in public
From the outside I cannot see if a site has good backups. I can see if someone left one in the web root. These names are the first thing bots try, and a config copy gives away the database password:
$ for f in wp-config.php.bak backup.zip site.sql wp-content/debug.log; do
curl -s -o /dev/null -w "%{http_code} /$f\n" https://example.com/$f
done
200 /wp-config.php.bak
200 /backup.zip
404 /site.sql
200 /wp-content/debug.log
$ curl -s https://example.com/wp-config.php.bak
<?php
define( 'DB_NAME', 'shop' );
define( 'DB_USER', 'shop_user' );
define( 'DB_PASSWORD', 'S3cret-example-only' );
What helps: keep backups outside the web root or off the server, delete leftovers after a migration, turn off WP_DEBUG_LOG on production or move the log, and deny these file types in the server config. See protect wp-config.php via .htaccess, automated backups with a bash script and database backups with mysqldump.
The same checks on this site
Here is helloadmin.com with the same requests:
$ for p in '/?author=1' /wp-json/wp/v2/users /xmlrpc.php /wp-login.php /readme.html /wp-config.php.bak /.env /.git/config; do
curl -s -A 'Mozilla/5.0' -o /dev/null -w "%{http_code} $p\n" https://helloadmin.com$p
done
301 /?author=1
401 /wp-json/wp/v2/users
403 /xmlrpc.php
403 /wp-login.php
403 /readme.html
404 /wp-config.php.bak
403 /.env
403 /.git/config
The author redirect goes to the home page, the users list needs a login, xmlrpc.php and the login file are denied, the leftover files are not there. Two things I found on my own site while writing this: the PHP version in the headers (fixed the same day) and DMARC in monitoring mode (on my list). Nobody is done with this for good.
Check your own site
All of the above takes about 15 minutes with a browser and a terminal. Run the checks on your own site, or on a client’s site with their permission. Do not point vulnerability scanners like WPScan at sites you do not own and do not try passwords there: that counts as an attack, and hosts block the IPs that do it.
If you would rather have someone else look, send me the address through the form below. I’ll write back what I see, in plain English.