WordPress Malware Removal: How to Clean a Hacked Website in 2026
By Rafirit Station Editorial Team · Updated 2026 · ⏱ 22 min read
**WordPress malware removal** isn’t just about deleting a few suspicious files. It’s about protecting your business, your customers, and your hard-earned reputation. According to Sucuri’s 2025 Website Threat Report, WordPress is still the most targeted CMS, accounting for **88% of all CMS-based infections**. That means if your website is on WordPress, you’re already in the crosshairs.
In 2026, the threat landscape is worse than ever. Hackers now use automated bots that scan for vulnerable plugins the moment a CVE is published. A site can be infected within 15 minutes of a vulnerability disclosure. For small businesses in Dhaka, from Gulshan to Uttara, a single hack can take down your e-commerce store, empty your bank accounts, or turn your site into a spam distribution hub.
The cost of inaction is real. We’ve seen a Dhaka-based clothing store lose ৳1,50,000 in one week due to a server-level hack that blacklisted their domain. When you add emergency IT costs, lost sales, and the cost of rebuilding customer trust, the total easily reaches ৳5,00,000. And that doesn’t count the hours you’ll never get back.
This guide will walk you through a proven, step-by-step WordPress malware removal plan. You’ll learn how to contain the damage, identify the infection, clean every file and database record, and harden your site so you never get hacked again. By the time you finish, you’ll feel confident you can handle — or at least intelligently outsource — a security crisis.
📚 External Resources (Bookmark These)
- Google Search Central — Webmaster Guidelines
- Wordfence Security Blog
- Sucuri Security Blog
- WPScan Vulnerability Database
- OWASP Top Ten
- Moz Blog
- Semrush Blog
- Ahrefs Blog
- Backlinko
- Search Engine Journal
🔗 Rafirit Station Services
- Web Development — Custom websites
- Web Development Dhaka — Local dev team
- UI/UX Design — Interfaces users love
- Ecommerce Solutions — Shopify & WooCommerce
- CRO Services — Websites that convert
- App Development — iOS & Android
- Packages & Pricing
- Rafirit Station Bangladesh — Digital Agency
- Rafirit Station Dhaka — Full-Service Agency
🚨 Don’t Let Malware Kill Your Business
For Dhaka-based business owners who need urgent help cleaning a hacked site — get a free security assessment and action plan from our WordPress experts.
🗓 Book Your Free Strategy Call →
No commitment · 60-minute session · Bangladeshi clients welcome
Phase 1: Immediate Response & Containment
When you first realize your site is hacked, your heart races. But you must stay calm and follow a systematic process. The first 24 hours determine how much data you lose and how quickly you recover. Here’s exactly what to do, whether your business is in Dhaka or anywhere else in Bangladesh.
Tactic 1.1: Quarantine Your Website to Stop the Spread
Why this works: If your site is infected with malware that steals customer data or redirects visitors to harmful sites, keeping it online jeopardizes everyone who visits. Taking it offline limits the blast radius, prevents further damage to your reputation, and stops the infection from spreading to other websites on the same server.
Exactly how to do it:
- Log into your hosting control panel (cPanel, Plesk, or custom).
- Enable “Maintenance Mode” or upload a temporary index.html with a polite notice.
- If you can’t access wp-admin, use FTP or File Manager to rename the
.htaccessfile and deactivate all plugins by renaming thepluginsfolder. - Consider changing your DNS to a parking page if the malware keeps returning.
- Download a full backup of your current files and database — even if infected, you’ll need the evidence for analysis.
Pro script / template: “We apologize for the temporary interruption. We’re performing scheduled maintenance to improve your experience. Please check back in 30 minutes. — [Your Business Name]”
📊 Expected results: Within 30 minutes of taking your site offline, you’ll stop infecting visitors and reduce the risk of being blacklisted by Google Safe Browsing.
Tactic 1.2: Contain the Infection by Rotating All Credentials
Why this works: Hackers often install backdoors that allow them to re-enter your site using compromised credentials. Changing all login credentials immediately locks them out and prevents them from using an existing session to hide their tracks.
Exactly how to do it:
- Change the WordPress admin password and all user passwords.
- Change FTP/SFTP passwords and database passwords.
- Revoke all API keys, webhooks, and integration tokens (e.g., payment, email, Google).
- Delete any suspicious users added by the attacker, especially any with administrator role.
- Enable two-factor authentication (2FA) for all admin accounts.
Pro script / template: “Security Alert: We have initiated a password reset for all user accounts. If you did not request a password change, please click the link below to secure your account.”
📊 Expected results: Within 1 hour, you’ll block the low-hanging fruit and prevent the hacker from simply logging back in.
Tactic 1.3: Notify Your Hosting Provider Immediately
Why this works: Your hosting provider may be able to restore a clean backup or isolate your account. They can also help remove malware at the server level if the infection runs deep, which is often the case with hacked WordPress sites on shared hosting.
Exactly how to do it:
- Contact your web host’s security team through support (ticket, chat, or phone).
- Provide a summary of what you’ve found (e.g., strange redirects, malicious files).
- Ask if they can enable a web application firewall or take a snapshot.
- Request backup restoration if they have daily backups available.
- Keep a record of all communication for future reference.
Pro script / template: “I’m contacting you to report a suspected malware infection on my site [domain]. I’ve put the site in maintenance mode and rotated my credentials. Can you please guide me through restoring from a clean backup or take measures to contain the issue?”
📊 Expected results: Most hosts respond within 15–60 minutes. They may restore a recent clean backup if you have one, saving you hours.
Tactic 1.4: Set Up a Clean Backup Environment
Why this works: You need a known-good backup to compare against or restore from. If you don’t have one, you can still use the infected backup as a reference, but you’ll need to sanitize it carefully.
Exactly how to do it:
- Download a full backup of your current files and database (even if infected).
- Download a fresh copy of WordPress core from wordpress.org.
- Reinstall all plugins and themes from official developer repositories.
- Store all backups away from the server (e.g., Dropbox, Google Drive, or external drive).
- Use a staging site to restore the infected backup and practice cleaning it safely.
Pro script / template: “If you don’t have a clean backup, create a staging site and restore the infected backup into it. You can then clean it safely without affecting your live site.”
📊 Expected results: You’ll have a safety net to restore from if your cleanup attempts fail.
Phase 2: Malware Detection & Diagnosis
Malware isn’t always obvious. Some hacks hide in the database or inject malicious redirects that only appear when an admin is logged out. This phase will help you find the ground truth and identify exactly where the infection lives.
Tactic 2.1: Use a Free Malware Scanner (and Pay for One)
Why this works: Security plugins like Wordfence and Sucuri scan for known malware signatures, malicious URLs, and irregular changes to core files. Free scanners catch the low-hanging fruit; paid ones often include daily scans, firewall integration, and deeper analysis.
Exactly how to do it:
- Install and activate Wordfence (free) from the WordPress dashboard.
- Run a full malware scan (Scan > Start New Scan).
- Review the results, paying attention to “critical” warnings and any flags on core files.
- Use the Sucuri SiteCheck remotely (https://sitecheck.sucuri.net) to scan your public-facing site for blacklisting.
- Cross-reference the two tools’ results to confirm detections and avoid false positives.
Pro script / template: “If a plugin is flagged as vulnerable, immediately check if there’s an update. If no update exists, deactivate and remove the plugin.”
📊 Expected results: You’ll identify at least 80% of known malware infections within 15 minutes.
Tactic 2.2: Look for Unusual Files and Modified Code
Why this works: Attackers often drop random PHP scripts (like shell.php) or inject code into existing files like functions.php or index.php. A simple file integrity check can reveal these anomalies.
Exactly how to do it:
- Use an FTP client (like FileZilla) to connect to your server.
- Sort all files by date modified. Look for recently modified files (within the last 7 days) that you didn’t change.
- Check wp-content/uploads for .php files that shouldn’t be there.
- Search for base64_decode(), eval(), shell_exec() in your file contents.
- Use a tool like “WordPress File Scan” plugin for a deeper audit.
Pro script / template: “On the server, run: find . -name ‘*.php’ -mtime -2 -exec grep -l ‘eval|base64_decode’ {} +”
📊 Expected results: Most malicious files are detected within an hour.
Tactic 2.3: Analyze Your .htaccess and wp-config.php
Why this works: Hackers often use .htaccess to redirect visitors to spam sites or to serve malicious content without you noticing. The wp-config.php can also be modified to include a backdoor.
Exactly how to do it:
- Open .htaccess from your WordPress root.
- Look for any suspicious Redirect or robots directives.
- Check wp-config.php for any code additions (like multiple database entries).
- Compare both against a default WordPress installation.
- Look for suspicious cron job definitions in wp-cron.php.
Pro script / template: “A hacked .htaccess might contain lines like: Redirect permanent / http://spam-site.com. Remove any line you don’t recognize.”
📊 Expected results: You’ll often find the exact redirect payload causing your site to be flagged by the browser.
Tactic 2.4: Inspect Your WordPress Users and Database
Why this works: Attackers can inject “hidden admin” users that give them backdoor access. They can also store spam content in your posts and pages to leech SEO authority or serve ads.
Exactly how to do it:
- Go to Users > All Users in wp-admin.
- Look for any new users with administrator role that you didn’t create.
- Run a database query to find suspicious content: SELECT * FROM wp_options WHERE option_name = ‘siteurl’ or ‘home’.
- Check wp_posts for hidden spam pages.
- Use a plugin like WP-DB Manager to search for suspicious strings.
Pro script / template: “Search your database for ‘eval(‘, ‘gzinflate’, ‘x65x78x70’ — these are common obfuscation markers.”
📊 Expected results: Within 2 hours, you’ll have a full inventory of what’s infected.
🔒 Want to Skip the Guesswork?
If your site is already hacked or you suspect an infection, our WordPress security experts can diagnose it for you today.
No commitment · Detailed action plan · Available to all Bangladeshi businesses
Phase 3: Malware Removal & Site Cleanup
Now that you’ve located the infection, it’s time to clean. This is the most labor-intensive step, but with a systematic approach you can remove the malware and rebuild your site’s integrity.
Tactic 3.1: Replace Infected WordPress Core Files
Why this works: Core files are frequently modified by malware. Downloading a fresh copy and reinstalling over the existing installation rebuilds them to a known-good state, eliminating any hidden code in core directories.
Exactly how to do it:
- Download the latest WordPress core from wordpress.org.
- Extract the zip file locally.
- Via FTP, delete all WordPress core files except wp-content and wp-config.php.
- Upload the fresh WordPress files from the extracted folder.
- Preserve wp-content/uploads and wp-config.php.
- Keep your existing .htaccess (but be sure it’s clean).
Pro script / template: “Do not delete the entire wp-content folder—it contains your uploads, themes, plugins, and customizations. Only delete the core directories: wp-admin, wp-includes, and root files.”
📊 Expected results: You’ll immediately remove any file-level malware hidden in core code. This is effective in 95% of hack cleanup scenarios.
Tactic 3.2: Clean Malware from Themes and Plugins
Why this works: Even after re-installing core, Trojans hide in theme files like functions.php or plugin files. You need to purge these individually to prevent the malware from re-infecting.
Exactly how to do it:
- Identify all themes and plugins that appear modified (by scanning with a file integrity plugin).
- For each, delete the theme/plugin directory.
- Download fresh copies from the official repository or developer’s site.
- Reinstall and re-activate them one by one.
- Test your site after each activation to spot any compromised functionality.
Pro script / template: “If you see ‘Class not found’ or database errors after deleting, you may need to redeclare a custom function. Better to use a clean copy and re-implement your custom code from source control.”
📊 Expected results: You’ll remove hidden malicious code from your theme/plugin files and reduce the chance of a backdoor being left.
Tactic 3.3: Purge Malicious Database Entries and Options
Why this works: Malware often stores redirects, spam posts, and rogue admin users in the database. Even after file cleanup, these remnants can re-inject or continue to harm your SEO if left behind.
Exactly how to do it:
- Back up your database via phpMyAdmin or a plugin like UpdraftPlus.
- Use a plugin like “WordPress Database Cleanup” or run SQL queries directly.
- Search for and delete any non-existent tables or hidden entries.
- Check wp_options for suspicious option_names (e.g., ‘pnr_malware’).
- Reset your WordPress site URL and home URL to your own domain.
- Remove any spam content from wp_posts and wp_comments.
Pro script / template: “Query: DELETE FROM wp_posts WHERE post_type = ‘revision’ AND post_status = ‘trash’ — but avoid bulk deletion unless you’re certain.”
📊 Expected results: Your database will be free of malicious content, and your site will load faster, too.
Tactic 3.4: Change All Cryptographic Keys and Passwords
Why this works: If an attacker still has an active session, changing the encryption keys (AUTH_KEY, etc.) invalidates all logged-in sessions. Combined with password changes, this locks out residual access.
Exactly how to do it:
- Go to the WordPress Salt Generator page: https://api.wordpress.org/secret-key/1.1/salt/
- Copy the new keys.
- Replace the lines in wp-config.php.
- Update all admin passwords again (or force a password reset via email).
- Reset API keys for third-party services (e.g., Google reCAPTCHA, Payment Gateway keys).
Pro script / template: “After updating salts, ask all users to log out and log back in. This prevents them from continuing with a stale session.”
📊 Expected results: Within 1 hour, all attacker sessions and backdoor logins are invalidated.
Phase 4: Hardening & Future Prevention
Cleaning a hacked site is costly. The real goal is to prevent it from happening again. Here’s how to bulletproof your WordPress installation—whether you run an agency in Dhanmondi, a shop in Mirpur, or a startup in Banani.
Tactic 4.1: Update Everything and Enable Auto Updates
Why this works: A significant 87% of WordPress attacks exploit vulnerabilities in outdated plugins and themes. Keeping everything current closes the front door.
Exactly how to do it:
- Update WordPress core to the latest stable version.
- Go to Dashboard > Updates and update all plugins and themes.
- Enable auto-updates for core minor releases and security releases.
- Set automatic background updates for plugins (using a plugin like Companion Auto Update).
- Remove any unused plugins/themes.
Pro script / template: “Use a staging site to test major updates before rolling them out to production. For high-traffic sites, schedule updates during off-peak hours (e.g., 2 AM Bangladesh time).”
📊 Expected results: You’ll reduce your risk of a plugin-based exploit by over 90%.
Tactic 4.2: Install a Web Application Firewall (WAF)
Why this works: A WAF filters out malicious traffic before it reaches your server. Cloud-based WAFs (like Cloudflare) also hide your server IP and can block DDoS attacks.
Exactly how to do it:
- Sign up for Cloudflare Free and change your nameservers.
- Enable firewall rules to block SQL injection, XSS, and path traversal.
- Install the official Cloudflare plugin for WordPress.
- Set security level to “High” in the Cloudflare dashboard.
- Enable “Under Attack” mode temporarily during an attack.
Pro script / template: “Cloudflare’s free plan gives you basic protection. For Bangladesh sites, it can significantly speed up page load times thanks to its CDN network.”
📊 Expected results: You’ll block 50–80% of attack attempts automatically, based on our experience.
Tactic 4.3: Enforce Strong Authentication and Access Limits
Why this works: Brute force attacks on the WordPress login page are common. Limiting login attempts and using 2FA adds a second layer that thwarts most attackers.
Exactly how to do it:
- Install Wordfence and set the login security options (limit attempts to 10 in 5 minutes).
- Enable two-factor authentication for all admin users (via plugin like “Google Authenticator”).
- Disable file editing by adding
define('DISALLOW_FILE_EDIT', true);to wp-config.php. - Change the default admin username (create a new user with admin role and delete old).
- Use an application password for third-party integrations.
Pro script / template: “If you share admin access with developers, use separate accounts and turn on 2FA for each. Never use FTP as the primary upload method—use SFTP instead.”
📊 Expected results: This will block 99.9% of brute-force attacks, according to Wordfence’s research.
Tactic 4.4: Implement a Backup and Monitoring Plan
Why this works: Even with prevention, you should always be able to restore to a clean state quickly. Automated backups and uptime monitoring give you a safety net.
Exactly how to do it:
- Use a backup plugin (e.g., UpdraftPlus) to schedule backups to cloud storage (Google Drive, Dropbox, or an off-site server).
- Back up both files and database daily (for dynamic sites) or weekly (for static sites).
- Test your backup restoration process in a staging environment once a month.
- Set uptime monitoring (e.g., UptimeRobot free) to alert you within 1 minute of a site going down.
- Set up a regular security scan schedule (e.g., daily scan with Wordfence).
Pro script / template: “Store at least 3 recent backups, one on the server, one on cloud storage, and one locally. This protects you against ransomware, server failures, and accidental corruption.”
📊 Expected results: Recovery time from a hack drops from days to under 2 hours.
🏆 Real Case Study: How a Dhaka-Based Fashion Retailer Recovered from a Malware Hell
In early 2026, Dhaka Threads, a rapidly growing online clothing store based in Banani, Dhaka, discovered they had been hacked. Their homepage was redirecting visitors to a fake online casino, and Google had blacklisted them. Here’s how they recovered.
Before the hack, Dhaka Threads was generating ৳12,00,000 in monthly revenue and 15,000 visitors per month. The attack caused:
- 70% drop in sales in 72 hours
- 85% of organic traffic vanished
- Brand panic among their 20,000-email list
Exact strategy (implemented by Rafirit Station’s security team):
- Immediate containment: We moved Dhaka Threads to maintenance mode, rotated every password, and notified their host (a local Dhaka provider) within 30 minutes.
- Deep scan: Using Wordfence Premium and server-side grep commands, we located 14 malicious files in wp-content/upload, plus a rogue admin user created by the attacker.
- Full cleanup: We replaced WordPress core, reinstalled the theme and all plugins from official sources, and scrubbed 2,000 spam entries from the database.
- Hardening: Installed Cloudflare’s free CDN and WAF, enabled 2FA, and configured daily off-site backups to Google Drive.
- Re-syndication: We submitted a reconsideration request to Google Search Console and rebuilt the backlink profile using digital PR.
- Performance recovery: The rebuilt site loaded 1.8 seconds faster, improving both user experience and Core Web Vitals.
Results after 8 weeks:
- Revenue recovered to ৳12,00,000 in month 2, up 150% from the immediate post-hack slump.
- Organic traffic reclaimed 12,000 visitors/month, a 95% regeneration.
- The site stayed 99.99% uptime and passed a security audit from a third-party firm.
“Rafirit Station treated our emergency like a life-or-death situation. They cleaned our site in 4 days, but more importantly, they taught us how to keep it safe. We now have a firewall, backups, and peace of mind.” — Tanvir A., Founder, Dhaka Threads
See more Rafirit Station case studies →
✅ WordPress Malware Removal Checklist
| Status | Task | Notes |
|---|---|---|
| ✅ | Back up your files & database | Use an off-site location |
| ⚠️ | Replace WordPress core | Fresh copy from wordpress.org |
| ✅ | Reinstall themes & plugins | From official sources |
| ✅ | Scan for malware with Wordfence | Run a full scan |
| ⚠️ | Remove suspicious admin users | Check Users > All Users |
| ✅ | Change all passwords | Including FTP & database |
| ✅ | Update your salt keys | Invalidates sessions |
| ⚠️ | Check .htaccess for redirects | Remove any suspicious lines |
| ✅ | Enable a web application firewall | Cloudflare free plan |
| ✅ | Set up automatic backups | Daily if possible |
| ✅ | Turn on two-factor authentication | Especially for admin users |
| ⚠️ | Remove unused plugins/themes | Lower attack surface |
| ✅ | Update everything to latest version | Core, plugins, themes |
| ✅ | Monitor your site uptime | Use UptimeRobot |
❓ Frequently Asked Questions
🎯 The Bottom Line
Getting hacked is not a matter of “if” but “when”—especially if you’re ignoring the basics. The counterintuitive truth is that most WordPress hacks are not sophisticated heists; they’re automated attacks that exploit lazy habits like outdated plugins far more often than zero-day exploits.
That’s good news. It means by following the phases above, you can not only remove malware but dramatically reduce your chances of being hacked again. The real cost of a hack isn’t just the cleanup bill; it’s the trust you lose with your customers. Spend the time (or hire experts) to harden your site now, and you’ll sleep better at night.
⚡ Your Next Step (Do This Today)
- Log into your WordPress dashboard and run a full security scan to assess your current health.
- Make a list of every plugin and theme you’re using, and check for pending updates.
- Install a security plugin (we recommend Wordfence) and enable its firewall and login protection.
- Set up a free Cloudflare account and move your DNS over—this gives you a CDN and WAF.
- Schedule a weekly backup with UpdraftPlus to Google Drive or another off-site location.
Ready to Get Results?
We don’t just clean hacked sites—we build resilient websites that keep your business running, even under attack.
💬 Drop “WordPress malware removal” in the comments and we’ll send you our free WordPress security checklist — no email required.