How to Scan WordPress for Malware: Complete Guide 2025
Step-by-step guide to scanning your WordPress site for malware. Learn manual and automated scanning techniques to detect hidden threats and malicious code.
Regularly scanning your WordPress site for malware is essential for maintaining security. This comprehensive guide covers both manual inspection techniques and automated scanning solutions to keep your site clean.
Why Regular Malware Scanning is Essential
Malware can hide on your site for weeks or months before causing visible damage. By then, the infection may have:
- Stolen customer data and passwords
- Sent thousands of spam emails from your server
- Gotten your domain blacklisted by Google
- Infected visitor computers with drive-by downloads
- Cost you significant revenue from lost traffic
Regular scanning catches infections early, before they cause irreparable harm to your site and reputation.
Manual Malware Scanning Techniques
1. Check Recently Modified Files
Use FTP or SSH to list files modified in the last 7-30 days. Legitimate updates happen, but unexpected modifications to core files or random PHP files in uploads are red flags.
find /var/www/html -mtime -7 -type f -name "*.php"
2. Search for Common Malware Functions
Search your files for known malicious functions:
eval(base64_decode())- Obfuscated code executiongzinflate(str_rot13())- Compressed malicious codepreg_replace with /e modifier- Code execution via regexassert()with user input - Arbitrary code execution
3. Compare Against Clean WordPress
Download a fresh copy of your WordPress version and compare file checksums. Any differences in core files indicate tampering.
4. Review Database for Malware
Check wp_posts and wp_options tables for base64-encoded strings, suspicious JavaScript, or iframe injections. Pay special attention to widget content and post content.
5. Check .htaccess Files
Review all .htaccess files for malicious redirects or rewrite rules. Hackers often inject redirect code targeting mobile users or search engine referrals.
Automated Malware Scanning with WP Folder Shield
While manual scanning is useful, it's time-consuming and easy to miss hidden threats. WP Folder Shield's automated scanner provides comprehensive protection:
Full Site Scanning
Scan your entire WordPress installation including:
- All PHP files in wp-content, wp-includes, and wp-admin
- Theme and plugin files
- Upload directory (where malware often hides)
- Database content for injected scripts
Signature-Based Detection
WP Folder Shield maintains a database of 15,000+ malware signatures updated daily. This catches known malware variants including:
- FilesMan, WSO, c99, and other webshells
- Backdoors and PHP droppers
- SEO spam injection scripts
- Cryptominer code
Heuristic Analysis
Beyond signature matching, WP Folder Shield uses behavioral analysis to detect:
- Obfuscated code patterns
- Suspicious file permissions
- Hidden files and directories
- PHP files in non-PHP directories
Core File Integrity Verification
Every WordPress core file is verified against official checksums from WordPress.org. Any modifications are flagged immediately, catching even zero-day malware that modifies core files.
Scanning Best Practices
How Often to Scan
At minimum, scan weekly. High-traffic sites or e-commerce stores should scan daily. WP Folder Shield can schedule automatic scans at your preferred frequency.
What to Do When Malware is Found
- Don't panic - take a backup first
- Identify all infected files
- Remove or clean the malicious code
- Update all passwords
- Patch the vulnerability that allowed infection
- Request a review if blacklisted
Prevention is Better Than Cure
Combine regular scanning with preventive measures:
- Keep WordPress, themes, and plugins updated
- Use strong passwords and 2FA
- Block PHP execution in uploads folder
- Enable web application firewall
WP Folder Shield provides all these features in one comprehensive security solution. Start your malware scan today.
Written by Marcus Johnson
WP Folder Shield Team