If your WordPress site has been hacked, act quickly but carefully. This guide explains how to recognise a compromise, clean it up, and stop it happening again.
Signs that a site has been hacked
- Visitors are redirected to other websites, often only on mobile or from Google.
- Google shows spam pages or a "This site may be hacked" warning.
- New administrator users, plugins or files that you did not add.
- Your hosting account suddenly sends spam, or your site becomes very slow.
Step 1: Secure your accounts
- Change your cPanel password from the client area.
- Change the password of every WordPress administrator, and delete any administrator you do not recognise.
- Change your FTP and database passwords, and update the database password in
wp-config.php. - In WP Toolkit, open your site and use Security to apply the recommended measures, including Change security keys, which logs out everyone.
Step 2: Clean the site
Our scanner already removes known malicious files automatically every night. To remove what remains:
- In WP Toolkit, run Check WordPress Integrity and reinstall the WordPress core files if any have been modified.
- Update every plugin and theme. Delete any that you do not use, any that are no longer maintained, and any "nulled" (pirated) copies.
- Reinstall plugins and themes from WordPress.org or the original developer, rather than keeping files that may have been changed.
- Look in
public_htmlandwp-content/uploadsfor PHP files with random names, and in Advanced › Cron Jobs for tasks you did not create.
Option: restore from a backup
If you know when the site was last clean, restoring from our backups is often the fastest route. We keep 14 days of daily backups: open a support ticket with the date to restore from. After a restore, still complete step 1 and update everything, or the same weakness will be used again. See Backups: how they work and how to restore.
Step 3: Prevent it from happening again
- Turn on automatic updates in WP Toolkit.
- Only install plugins and themes from trusted sources.
- Use strong, unique passwords and two-factor authentication for administrators.
- Read Keeping your website secure for more advice.
Search engine warnings
Once your site is clean, request a review in Google Search Console under Security & Manual Actions to remove any warning shown to visitors.
Not sure where to start? open a support ticket and tell us the address of the affected site. We can check our logs and scan results and tell you what we found.