WordPress backdoor: how to find one your dashboard hides
A WordPress backdoor is built to survive a clean-up by staying off the one screen you'd use to look for it: your own dashboard. The Users, Plugins, scheduled-tasks and Posts screens all read through WordPress queries, and any plugin — malicious or not — can filter what those queries return before they reach the screen. That's not a flaw to patch; it's how WordPress is meant to work, and it's also exactly what a backdoor relies on. The fix isn't a better look at the dashboard. It's comparing what WordPress lists with what's actually in the database and on disk, and this guide walks through that comparison by hand, then shows how Relvato does it on a schedule.
What counts as a WordPress backdoor
A backdoor is any way back into the site that survives the clean-up you think you did. That's a wider list than most people expect: an administrator account nobody remembers creating, a plugin sitting in wp-content that was never installed through wp-admin, a scheduled task (WP-Cron) that fires on its own timer, a PHP file placed beside WordPress's own core files, or code stored as an ordinary database row that a small file reads and evaluates on every request.
None of these need to look alarming. A new administrator can have a plausible name. A scheduled task can have a name like wp_cache_cleanup. A planted file can sit in wp-includes next to thousands of files that genuinely belong there. The thing they share isn't how they look — it's that they're built to outlast a plugin removal, a password reset, or even a fresh WordPress install, because wp-content and the database aren't touched by any of those.
Why your dashboard can't be trusted to show you one
The Users, Plugins, scheduled tasks and Posts/Pages screens don't read the database directly. Each one runs a WordPress query, and a WordPress query is built to be filtered — any plugin, including one you didn't knowingly install, can change what comes back before the screen ever sees it. That's documented, ordinary WordPress behaviour, listed in the developer hook reference: the Users screen runs through pre_user_query and users_list_table_query_args, the Plugins screen through all_plugins, the scheduled-tasks list through the cron option itself via option_cron and pre_option_cron, and Posts and Pages through posts_where, pre_get_posts and posts_clauses. Underneath all of them sits query, which can rewrite any database query WordPress makes.
A few lines of PHP dropped into a must-use plugin — the wp-content/mu-plugins folder — can hook any of these. Code there runs before any ordinary plugin, on every request, and WordPress doesn't show must-use plugins on the Plugins screen's main list the way it shows regular ones. That combination — runs first, mostly invisible — is why a hidden filter usually lives in mu-plugins.
None of this means a filter is proof of a hack. MainWP's child plugin hides itself from the Plugins screen on purpose, so a client's site doesn't show a plugin they didn't choose to install. Multilingual plugins like WPML, and membership plugins, filter the posts query to show only content in the right language or the right tier. Cavalcade and Automattic's Cron Control replace WP-Cron entirely and filter the cron option as part of doing that. A filter on its own proves nothing either way. What tells you is where the code lives: a must-use plugin you never installed, a file loose in wp-content instead of inside a plugin folder, code sitting in uploads, or code evaluated from a string by something other than a plugin.
The one tool a filter can't touch
WP-CLI's wp db query command reads the database credentials from wp-config.php and sends the SQL straight to the mysql client without loading WordPress's plugins or themes, so no plugin filter can change what comes back. That makes it the baseline to compare everything else against.
wp user list, wp plugin list and wp cron event list are not that baseline. They load WordPress to run, which means the same filters that hide something from wp-admin can hide it from these commands too. They're still useful — for comparing against the dashboard — just not as the source of truth.
One detail trips people up before they've run a single command: WordPress's table prefix isn't always wp_. Check $table_prefix in wp-config.php before writing queries against wp_users, wp_options or wp_posts — the comparisons below assume the default, so swap in the site's real prefix if it's different.
grep "table_prefix" wp-config.php
Administrators: the database against the Users screen
Every administrator exists as a row in wp_users with a matching wp_capabilities entry in wp_usermeta. Read that directly, then open Users → filter by Administrator in wp-admin and compare the two lists by eye. Run wp user list --role=administrator as a second comparison — if it disagrees with the raw query, something is filtering one of them.
A name on the database list that isn't on the Users screen, or isn't on wp user list, is the single clearest sign of a hidden administrator — not a bug, not a caching quirk.
wp db query "SELECT u.ID, u.user_login, u.user_registered FROM wp_users u JOIN wp_usermeta m ON m.user_id = u.ID WHERE m.meta_key = 'wp_capabilities' AND m.meta_value LIKE '%administrator%'" # compare against: wp user list --role=administrator
Plugins: the disk against the Plugins screen
A plugin doesn't need wp-admin's install flow to run. Dropping a folder into wp-content/plugins by FTP or SFTP is enough, and a plugin in wp-content/mu-plugins runs without ever appearing as an install at all. List both folders and compare the names against the Plugins screen, including its Must-Use tab — anything on disk that isn't listed anywhere in wp-admin is exactly what the all_plugins filter is built to produce.
This catches both the plugin that was copied in instead of installed, and the plugin that's installed but hidden from the list. It doesn't tell you which lines of which file are doing the hiding — for that, see the grep further down.
ls wp-content/plugins wp-content/mu-plugins
Scheduled tasks and posts: what's stored, against what's listed
WP-Cron's schedule isn't a separate system table — it's a single serialized value in the cron option in wp_options. Read it directly and look at the hook names inside it, then compare them against wp cron event list. A hook that appears in the stored option but not in the command's output is being filtered out by option_cron or pre_option_cron before it reaches the list. A one-off task that fires and clears itself between the two reads drops out of the list the same way a filter would, so run the comparison twice before calling a task hidden.
Posts and pages work the same way. Read wp_posts directly for published posts and pages, then compare the IDs against what the Posts and Pages screens show. A gap usually means posts_where, pre_get_posts or posts_clauses is excluding certain IDs from the admin query — and it's worth remembering that a page hidden from you this way can still be served to search engines, so a site: search on your own domain can surface pages your own dashboard won't show you.
# Scheduled tasks as WordPress stores them
wp db query "SELECT option_value FROM wp_options WHERE option_name = 'cron'"
# compare the hook names against:
wp cron event list
# Posts and pages as WordPress stores them
wp db query "SELECT ID, post_type, post_status, post_date FROM wp_posts WHERE post_type IN ('post','page') AND post_status = 'publish' ORDER BY ID DESC LIMIT 50"Who's hooking these filters, and where this method runs out
Once a comparison turns up something extra, the next question is which file is responsible. Searching the codebase for the hook names themselves usually finds it.
Expect legitimate plugins to show up in that search too — judge each match by where it sits, not by the fact that it's there at all. A hook inside a plugin you recognise, doing something you can explain, is not the same finding as the same hook inside a file with a generic name in mu-plugins.
Three honest limits, so this method doesn't overclaim. A filter added only behind is_admin() only changes what wp-admin sees — it leaves wp db query alone either way, which is one more reason to trust that command over the dashboard. Code hooked into the query filter can rewrite reads WordPress itself makes, including ones a plugin runs internally, so even WordPress's own code isn't immune to it. And grep only finds code that's written out as PHP — code that's stored encoded and evaluated with eval at runtime won't show up in a text search at all, no matter how it's hooked.
grep -rn -E "pre_user_query|users_list_table_query_args|all_plugins|option_cron|pre_option_cron|posts_where" wp-content/mu-plugins wp-content/plugins wp-content/themes
Found one? Clean up, then look for the way in
Back up the site before changing anything — you'll want the evidence if you need to work out how the backdoor got there in the first place. Then delete the account, the scheduled task, the posts or pages, or the code you found, and confirm with the same comparison that it's actually gone from the database, not just from the screen.
After that, change every administrator's password and regenerate WordPress's security salts in wp-config.php, so any session the backdoor was using is forced out. None of this closes the hole that let it in — an outdated plugin is the usual answer — so finish with the full clean-up in our WordPress hacked checklist rather than stopping at the backdoor itself.
How Relvato does the same comparison, continuously
Relvato's Admin roster monitor reads every administrator straight from the database through the Relvato WordPress plugin, the same way wp db query does, not through the Users screen's own query. An administrator the Users screen doesn't show is a failed run, not a warning.
The File integrity monitor runs the rest of the comparisons on a schedule: a plugin hidden from the Plugins screen; WordPress's list of scheduled tasks against the cron option actually stored in the database, naming the code that hides any task a filter keeps off the list; and the posts and pages in the database against what WordPress's own posts query returns, naming any left out by ID, type, status and date. When it finds code hooked into these listing filters, it traces it to the file and line and asks you once to confirm it's yours — approving it is keyed to that code, so it stays quiet through later plugin updates.
Because plugins like WPML, membership plugins and Cron Control hide things this way on purpose, a hidden task or a hidden post comes back as a warning naming the responsible code, not a failure. Code evaluated by something other than a plugin, code in the uploads folder, or a PHP file in the WordPress root that WordPress doesn't ship fails the run outright.
Relvato's plugin reads the site from outside wp-admin, so a filter that malware adds only inside wp-admin (behind is_admin()) isn't active when Relvato looks. The administrator list is still read straight from the database either way, but a post or task hidden that way can be missed. And because code hooked into the query filter could change even the plugin's own database reads, that's one of the filters Relvato names for you to confirm.
What it reports is names, places and IDs: which administrator, which file, which hook, which post ID. Never file contents, never the code itself, never a post's title or body. It runs on the schedule you set, and it never deletes anything — the decision, and the clean-up in the guide above, stay yours.
Where a backdoor hides, and how to see past the dashboard
| Where a backdoor hides | What WordPress shows you | How to see what's there |
|---|---|---|
| An administrator account | Only the admins the Users screen's filtered query returns | wp db query against wp_users and wp_usermeta, or Relvato's admin roster monitor |
| A plugin | Only the plugins the all_plugins filter lets through | ls wp-content/plugins, compared against the Plugins screen |
| A must-use plugin or a loose PHP file in wp-content | Nothing — must-use plugins don't appear on the Plugins screen's main list | ls wp-content/mu-plugins, and a look at files outside any plugin folder |
| A scheduled task | Only what the hooks option_cron and pre_option_cron let through | wp db query on the cron option in wp_options, compared against wp cron event list |
| A post or page | Only the IDs posts_where or pre_get_posts let through | wp db query against wp_posts, compared against the Posts and Pages screens |
| Code stored in an option | Nothing — it's a database row, not a file | Reading wp_options directly for unusually large or encoded values |
Questions, answered
What is a WordPress backdoor?
A way back into the site that survives a clean-up: an administrator account, a plugin, a scheduled task, a file placed beside WordPress's own, or code in the database that a small file evaluates. What ties them together isn't how they look — it's that they're still there after you remove only the obvious traces.
Can an administrator account really be hidden from the Users screen?
Yes. The Users screen reads through a WordPress query that pre_user_query or users_list_table_query_args can filter. An account can exist in full in the database, and be set up as an administrator, without ever appearing on that screen.
Does reinstalling WordPress remove a backdoor?
No. A reinstall only overwrites the files WordPress ships. wp-content and the database stay exactly as they were — and that's where most backdoors live: in a plugin, a database row or a file WordPress doesn't ship in the first place.
Is a plugin that hides itself from the Plugins screen always malware?
No. MainWP's child plugin, and some white-label tools, do this on purpose for legitimate reasons. What matters is whether you can explain why the plugin is there, not that it hides.
How does Relvato find a backdoor hidden from the dashboard?
They compare what WordPress's own screens show with what the database and disk actually hold. Administrators are read straight from the database; plugins, scheduled tasks and posts are compared against what's really stored — all through the Relvato WordPress plugin, not through the same queries the Users or Plugins screens use.
Will Relvato flag WPML or Cavalcade as a backdoor?
Not permanently. The first time it finds one, a warning asks once and names the responsible plugin. Confirm it's expected and it stays quiet after that, even through plugin updates.