WordPress Site Hacked? What to Do and How Malware Removal Works

A hacked WordPress site can cost you sales within hours. Visitors get redirected to strange pages, Google shows a warning, or your host takes the site offline. The good news is that most sites can be cleaned. The order of the steps matters, because a rushed cleanup often leaves a hidden way back in.
Signs your WordPress site has been hacked
- Visitors, often only on phones or only from Google, are sent to another website
- Google shows "This site may be hacked" or the browser shows a red warning page
- New pages in a language you do not use appear in Google results for your domain
- There are administrator accounts that nobody on your team created
- Your host reports malware, spam email or unusual server load
- Files or plugins appear that you did not install
One sign is enough to investigate. Some infections hide from logged in users, so check your site in a private window and on a phone as well.
The first hour: contain the damage
- Take a full backup of the site as it is now, including files and database. Label it as infected. You may need it to understand what happened.
- Put the site in maintenance mode or ask your host to restrict access if visitors are being redirected or asked for information.
- Change every password that touches the site: WordPress administrators, hosting panel, SFTP, database and the email accounts used for password resets.
- Contact your host. They may have server logs and older backups that you cannot see.
Avoid deleting files at random. It can break the site and still leave the real backdoor in place.
How to clean a hacked WordPress site
- Replace WordPress core files with fresh copies from WordPress.org.
- Reinstall every plugin and theme from its official source. Delete the ones you do not use. Never use pirated or "nulled" themes and plugins.
- Check the uploads folder for PHP files. It should normally hold media, so executable files there need a close look.
- Review the database for unknown administrator users, injected scripts, spam links and changed site addresses.
- Check server level files and scheduled tasks, including .htaccess, wp-config.php and cron jobs.
- Replace the security keys in wp-config.php so that every existing login session ends.
- Find the way in. It is often an outdated plugin, a weak or reused password, or an old install sitting in the same hosting account.
WordPress keeps a helpful official guide, FAQ: My site was hacked, if you want to follow the process yourself.
Restoring a backup is not always enough
A backup from before the infection can save a lot of time. The difficulty is knowing when the infection began, since attackers sometimes wait weeks before they do anything visible. If you restore a backup, still update everything, change all passwords and close the weakness that was used. Otherwise the same attack can work again.
How to remove Google warnings
Add your site to Google Search Console and open the Security Issues report. It describes what Google found and usually lists example pages. Once the whole site is clean, request a review from that report and explain what you fixed. Google's guide on requesting a review explains what to include. Request it only when you are confident the cleanup is complete.
How to stop it happening again
- Keep WordPress, plugins and themes updated
- Turn on two factor authentication for administrators
- Give each person their own account with only the access they need
- Keep automatic backups stored away from the web server, and test a restore
- Remove old test sites and unused installs
- Use a firewall and monitoring that alerts you to file changes
The official WordPress hardening guide goes into more detail. You can also read our cybersecurity essentials for businesses and our guide to keeping a website fast and secure.
When to get professional WordPress malware removal
Get help if the infection returns after cleaning, if your site takes payments or stores customer data, if Google still flags it, or if you cannot afford more downtime. If customer data may have been exposed, you may also have legal duties to report it, so speak to a qualified adviser.
NexaEagle offers hacked website recovery and security: we remove malicious code and spam pages, close the hole the attacker used, restore clean files where possible and help you request a Google review. To keep the site protected afterwards, see our website maintenance plans.
Is your site hacked right now? Book a free 30 minute call or email hello@nexaeagle.com with your website address and what you are seeing. Please do not send passwords by email.
