
Somewhere on the internet right now, there is a WordPress site running a file that its owner never wrote, never uploaded, and never noticed. It might be sending visitors to a pharmacy spam page only when Googlebot visits. It might be quietly creating a second administrator account every time the first one is deleted. It might be mining cryptocurrency on the server, slowing every page load while the owner blames their hosting provider. Security researchers at Sucuri and Wordfence have repeatedly reported that a large share of infected WordPress sites are compromised through outdated or abandoned plugins and themes, and that the most damaging infections are the ones designed to stay hidden.
If you run a site, manage one for a client, or inherited a WordPress install from a former developer, this is the problem you need to solve. Most owners only discover a backdoor after Google flags the domain, a host suspends the account, or a customer reports a strange redirect. By then the attacker has usually had weeks or months of access. The good news is that a backdoor is not mysterious. It leaves traces in predictable places, and you can check for them yourself with nothing more than a file manager, a database client, and a methodical checklist.
This guide walks through exactly how to check a WordPress site for a backdoor: what backdoors look like, where they hide, how fake plugins disguise themselves, and how to audit core files, the database, user accounts, and scheduled tasks. You will also get a worked example with real numbers, a comparison of audit approaches, and a clear decision framework for when to clean a site yourself and when to bring in help. Read the takeaways first, then work through the steps on a staging copy before touching production.
Key Takeaways
- A WordPress backdoor is code or an account that gives an attacker access after the original vulnerability has been patched, and it is often hidden inside legitimate-looking files.
- Fake plugins usually imitate popular names, sit in
wp-content/plugins/without a matching entry in your plugin list, and frequently hide their code inside a single PHP file with an obfuscated payload.- Core WordPress files can be checked against official checksums with WP-CLI in under a minute, and any mismatch in
wp-adminorwp-includesdeserves immediate attention.- Check the
wp_userstable, thewp_optionstable (especiallysiteurl,home, and autoloaded options), and scheduled cron events, because attackers rely on these to survive a cleanup.- Never audit a live site without a full backup. Take a snapshot first, and keep the infected copy for forensics rather than deleting it.
- Reinstalling from clean sources, rotating every credential, and hardening afterward is more reliable than manually surgery on a heavily compromised site.
What Is a WordPress Backdoor, Exactly?
A backdoor is any mechanism that lets someone regain access to a system after the original entry point has been closed. In WordPress, that usually means one of three things: a PHP file that accepts commands or uploads from anyone who knows a secret string, a rogue administrator account, or a modified legitimate file that quietly runs extra code. Attackers layer these on purpose, so that if you find and remove one, another still works.
Backdoors differ from the malware that defaces a page or redirects traffic. The redirect is what you notice. The backdoor is what lets the attacker come back and reinstall the redirect after you clean it. That is why a site can look fixed for a week and then get reinfected. If you only remove the visible symptom, you have not audited the site.
The common types you will encounter
- Webshells: small PHP files, often named something like
wp-tmp.php,class.cache.php, orindex2.php, that accept commands through a password-protected form. - Rogue admin accounts: users with administrator rights and plausible names such as
support,wpadmin2, or a near-duplicate of a real username with a trailing digit. - Modified core or theme files: legitimate files like
functions.phporwp-config.phpwith a small block of encoded code appended to the end or the top. - Database injections: serialized PHP stored in
wp_options, or a new option that the attacker's code reads on every page load. - Scheduled tasks: WP-Cron events that reinstall malicious files or recreate admin accounts on a timer.
How Fake Plugins Hide in Plain Sight
Fake plugins are the most common delivery method for WordPress backdoors. The pattern is consistent: an attacker publishes or repackages a plugin with a name close to a real one, or uploads a folder into wp-content/plugins/ through a compromised account. The plugin may even have a working feature so that nobody questions it. Underneath, a loader file decodes a payload and executes it.
The giveaways are subtle but learnable. Real plugins from the WordPress.org repository have readme files, changelogs, a clear author, and a version history. Fake ones often have a readme that was copied from a legitimate plugin and edited, or no readme at all. They frequently use function names that are long, random-looking strings, and they call functions such as eval(), base64_decode(), gzinflate(), or str_rot13() on data that never appears in a normal plugin.
Red flags in a plugin folder
- A plugin folder that does not appear in your WordPress admin under Plugins, meaning it is present on disk but not registered.
- A main PHP file with a header comment that claims to be a well-known plugin but lists an unfamiliar author URL.
- Single files with very long lines, dense strings of hexadecimal or base64 characters, or code that begins with
eval(followed by encoded text. - Files with timestamps that do not match your last plugin update or deployment.
- Extra files inside a legitimate plugin folder, such as an unexpected
.phpfile in alanguagesorassetsdirectory.
How to Check a WordPress Site for Backdoor Files Step by Step
This is the core workflow. Do it in order, and record what you find as you go. Work on a copy of the site if you can, and always start with a full backup of the current state, including the database, because you will want evidence if you need to contact your host or a security firm later.
Step 1: Create a forensic snapshot
- Export the full site directory via SFTP or your host's file manager into a folder named with today's date, for example
site-audit-2026-03-14. - Export the database with
wp db export audit-2026-03-14.sqlusing WP-CLI, or through phpMyAdmin. - Store this copy somewhere read-only. Do not clean anything yet.
Step 2: Verify WordPress core files against official checksums
WordPress publishes checksums for every core release. WP-CLI can compare your installed core against them in one command, which is the fastest reliable test you have.
- SSH into the server and move to the WordPress root directory.
- Run
wp core verify-checksums. - If the output reports "Success," core is clean. If it lists files such as
wp-includes/rest-api.phporwp-admin/includes/file.phpas modified, treat each one as a potential compromise. - Also run
wp core verify-checksums --locale=en_USif you use a specific language pack.
Note that the command does not flag extra files that do not belong to core. A webshell dropped into wp-includes/ will not appear in this report, which is why the next steps matter.
Step 3: Find files that should not exist
- List every PHP file modified in the last 90 days:
find . -name "*.php" -mtime -90. Compare the results to your last known deployment date. - Search for common obfuscation functions across the whole installation:
grep -rl "base64_decode\|eval(\|gzinflate\|str_rot13" .. Legitimate plugins sometimes use these, so review each hit rather than deleting automatically. - Check the
wp-content/uploads/directory for any.phpfile. Uploads should contain only media. A PHP file there is a strong indicator of compromise. - Check for PHP files inside
wp-content/that are not inplugins/,themes/, ormu-plugins/.
Step 4: Audit plugins and themes
- Compare the folders in
wp-content/plugins/against the list shown in your admin. Any folder not registered is suspicious. - For each installed plugin, run
wp plugin verify-checksums --all. WP-CLI checks WordPress.org-hosted plugins against published checksums, which will flag modified files. - Delete any plugin you do not recognize, but only after saving a copy from Step 1.
- Check
mu-plugins/, which loads automatically and does not appear in the normal plugin list. Attackers often use it for persistence.
Step 5: Inspect the database
- Query the users table:
SELECT ID, user_login, user_email, user_registered FROM wp_users ORDER BY user_registered DESC;. Look for accounts created around the time of suspicious activity. - Check which users have administrator capabilities:
wp user list --role=administrator. Confirm each one with the real owner. - Verify
siteurlandhomeinwp_options. A changed value can redirect logins or the entire site. - Look for unusually large autoloaded options:
SELECT option_name, LENGTH(option_value) FROM wp_options WHERE autoload='yes' ORDER BY LENGTH(option_value) DESC LIMIT 20;. Injected payloads often hide in large, serialized autoloaded rows with random option names.
Step 6: Review scheduled events
- List WP-Cron events with
wp cron event list. Any hook name you do not recognize deserves investigation. - Check the system crontab on the server with
crontab -lfor the web user and for root, in case the attacker has shell access.
Step 7: Check the server and access logs
- Search the web server access log for POST requests to PHP files in unusual locations:
grep "POST" access.log | grep -i "\.php". - Look for repeated requests to a single unfamiliar PHP filename, especially with query strings containing long encoded values.
- Note the IP addresses and user agents involved. These help with blocking and with reporting to your host.
Worked Example: Auditing a Small Business Site
Consider a regional acc
Cover image: Sad Cartoon versus Technology by Sean Loyless, licensed under BY 2.0 via Openverse.








