Back to blog
    Header image for the article "Malware Scanning in WordPress: Tools and Process"
    Security06/06/20267 min

    Malware Scanning in WordPress: Tools and Process

    Want to know how your own site is doing?

    Learn how to detect and remove malicious code from WordPress before Google blacklists your site. Discover essential tools and a step-by-step cleanup guide.

    Author: Kodulehehaldus

    What is website malware?

    Website malware = malicious code that:

    • Redirects visitors to other sites
    • Steals data (card details, passwords)
    • Injects SEO spam (Viagra, Casino links)
    • Uses the server for crypto mining
    • Sends spam emails

    How does malware get in?

    The most common ways in are a weak password, an outdated plugin, an outdated WordPress core and poor hosting.

    Signs of infection

    Visual

    • Strange ads appearing
    • Users complaining "the page redirected me somewhere"
    • Different content on mobile vs desktop
    • Homepage has been defaced

    Technical

    • Search Console warning
    • Antivirus blocks visitors
    • Hosting provider sent an email ("incident notice")
    • Sudden spike in server load
    • File changes without your permission

    SEO

    • Brand search displays "this site may be hacked"
    • Traffic dropped sharply
    • Strange pages indexed (/casino-online.html)

    Scanning tools

    Web scanners (quick)

    WordPress plugins

    • Wordfence – most popular, free + premium
    • Sucuri Security – professional, free
    • iThemes Security – comprehensive
    • MalCare – cloud scanning
    • WPScan (Jetpack) – official vulnerability database

    Server-side

    • ImunifyAV – often found in cPanel
    • Maldet (Linux Malware Detect) – server level
    • ClamAV – open-source

    The scanning process

    1. Initial scan

    # Wordfence
    wp wfconfig set 'highSensitivity' true
    wp wf scan

    2. File comparison

    Original WP files vs server files:

    wp core verify-checksums
    wp plugin verify-checksums --all

    Any mismatches are suspicious.

    3. Database check

    Search for:

    • wp_options table – strange siteurl changes
    • wp_users – unknown administrators
    • wp_posts – hidden posts (post_status = 'draft' with spam)

    4. .htaccess check

    Hackers often add redirects:

    RewriteCond %{HTTP_USER_AGENT} (google|bing) [NC]
    RewriteRule ^.*$ http://evil.com [R,L]

    5. Wp-config.php check

    Look for:

    • Eval calls
    • Base64 encoded code
    • Strange define lines

    Common hiding places

    In files

    • /wp-content/uploads/ – .php files in image folders
    • /wp-content/cache/ – hidden among cache files
    • wp-includes/ – deep within the core
    • favicon_*.ico.php – disguised files

    In code

    • Base64 encoding: eval(base64_decode("..."))
    • Obfuscation: long variable names, hex codes
    • Backdoors: <?php @system($_GET['cmd']); ?>

    Removal process

    See the detailed guide: Website hacked – what to do.

    In short:

    1. Backup the current state (as evidence)
    2. Activate maintenance mode
    3. Run a full scan
    4. Remove malicious files
    5. Replace WP core with clean files
    6. Clean the database
    7. Change ALL passwords
    8. Activate 2FA (guide)
    9. Add a WAF
    10. Resubmit to Google

    After cleaning

    Search Console

    • Security Issues → "Request a review"
    • Usually takes 1–3 days
    • Include a description of what you did in the request

    Monitoring

    30 days of supervision:

    • Daily scanning
    • File integrity monitoring
    • Login attempt logs
    • Server load monitoring

    Prevention

    1. Regular maintenance – see WordPress updates
    2. Strong passwords + password manager
    3. 2FA for all admins
    4. Plugins only from official repositories
    5. Off-site backups
    6. Quality hosting
    7. WAF (Cloudflare, Sucuri)

    Costs

    ServicePrice
    DIY cleaning£0 (but risky)
    Plugin (Wordfence Premium)$119/year
    Sucuri firewall + cleanup$200/year
    Professional one-time cleanup£300–£1500
    Long-term management + monitoring£50–£300/month

    Summary

    Malware scanning should occur daily and automatically. Waiting just one day can lead to SEO consequences lasting months. Our management packages include daily scanning and immediate response. Request a quote.

    Sources

    Join the newsletter

    Once a month, practical tips on making your website faster, more secure and easier to find on Google and in AI search.

    By subscribing you receive our newsletter. You can unsubscribe at any time from the end of every e-mail. Privacy policy

    Author

    Kodulehehaldus.com (Innov8it OÜ) – an Estonian web agency that builds, maintains and optimises websites.

    Related articles