What to do if your website is hacked
Hacked website on Plesk hosting: isolate it, keep the evidence, change your credentials, clean or restore it, then bring it back online and meet your obligations.
On this page
This guide sets out the order of actions when a website hosted on Plesk has been compromised: limit the damage, keep traces, take back control of your credentials, clean up, then bring the site back online without leaving the door open.
Recognize a hack
The most common signs are:
- modified pages, or redirects to other sites;
- a browser or Google warning that the site is dangerous;
- administrator accounts or files you did not create;
- search results showing content unrelated to your site;
- email sent without your knowledge, or a report from your hosting provider.
A message claiming your site has been hacked does not prove it: some blackmail relies on a fake threat. Look for concrete signs before acting.
What you need
- Access to your Plesk interface and your client area.
- A clean computer, or one checked with an up-to-date antivirus.
- Somewhere to write down what you find.
Step 1: write down what you see
Record when you discovered the problem, the affected addresses and recent changes to the site. Take screenshots and keep any messages you received. This will help support, a security provider and any complaint you file.
Step 2: alert support
Open a request from your client area and describe what you observed. On shared hosting, the incident may affect more than your site. Also ask what support can take care of and whether it holds an earlier backup.
Step 3: take the site offline
- Open Websites & Domains.
- In the drop-down menu to the right of the website name, choose the Suspended status.
Visitors then see a 503 Service Temporarily Unavailable page, which protects them during the cleanup. Mail stays available, and your files remain accessible over FTP and in File Manager. Avoid the Disabled status, which also cuts off mail.
Step 4: check your computer
Run a full scan with an up-to-date antivirus before changing your passwords. If your computer is infected, spyware could capture the new ones. Do the same on the computers of everyone who manages the site.
Step 5: change all credentials
Use long, unique passwords generated by a password manager.
| Access | Where to change it |
|---|---|
| HostMyServers client area | From your client area |
| Plesk account | Click your name at the top of the screen, then Edit Profile |
| FTP and SSH | Websites & Domains, then Web Hosting Access |
| Additional FTP accounts | Websites & Domains, your domain, FTP. Remove any you do not recognize |
| Database users | Databases, then update the password in the site configuration |
| Site administrators | In your CMS admin area. Remove unknown accounts |
| Mailboxes | In the Plesk mail settings, especially if suspicious email was sent |
For WordPress, also replace the security keys in wp-config.php with new values. This closes all open sessions.
Step 6: keep a copy of the current state
Before cleaning, keep a record of the site as it is:
- Create a full backup in Backup Manager, without excluding log files. See Back up and restore your website.
- Add the comment
INFECTED - DO NOT RESTORE. - Download the logs from Logs, then Manage Log Files, because they are eventually archived or deleted.
Step 7: look for what was changed
Start by checking in Plesk:
- Scheduled Tasks: remove any task you did not create, because it can reinstall the malicious code.
- FTP: review the list of accounts.
- Databases: look for unknown administrators and scripts injected into content.
Then examine the files, especially:
.htaccess, at the root and in subfolders;index.php,header.php,footer.phpandfunctions.php;- PHP files in an upload folder such as
wp-content/uploads; - recent files whose origin you do not know.
If SSH access is available, these commands, run from your home directory, list files to examine. They change nothing.
# PHP files modified in the last 14 days
find httpdocs -type f -name '*.php' -mtime -14 -ls
# PHP files in an upload folder
find httpdocs -type f -path '*/uploads/*' -name '*.php' -ls
# Functions often used to hide code
grep -rlE 'eval\(base64_decode|eval\(gzinflate|str_rot13\(' httpdocs --include='*.php'Without SSH, download a copy of the site with FileZilla and search on your computer. A match is not proof: some legitimate plugins use these functions. Conversely, an empty result does not guarantee the site is clean.
In the logs, look for POST requests to unusual files around the date of the first signs. This helps identify the entry point.
Step 8: clean the site
Choose the method that fits your situation.
Option A: restore a clean backup
This is often the safest solution if you have a backup from before the intrusion. A hack can precede its first visible sign by several weeks, so choose a date far enough back and check the result. Content added since then will be lost.
The vulnerability is still there after the restore. Go straight to step 9 before bringing the site back online.
Option B: reinstall from official sources
- Replace the CMS files with those of the same version, downloaded from the official website. For WordPress, replace
wp-adminandwp-includes. - Reinstall plugins and themes from their official source. Remove those you do not use.
- Compare
wp-config.php,.htaccessand your custom files with a clean version, then remove anything suspicious. - Delete the files identified in step 7 after examining them.
- Clean the database: unknown accounts, scripts in content, altered site addresses.
In WP Toolkit, Check WordPress Integrity then Verify Checksums compares WordPress core files with the originals. Reinstall WordPress Core replaces them. This check does not cover plugins, themes or wp-config.php.
Step 9: fix the vulnerability
- Update the CMS, plugins and themes.
- Replace any component abandoned by its publisher.
- Use a PHP version that is still maintained and compatible with your site.
- Turn on two-factor authentication for the site's admin area if it is available.
- Change the passwords again: those from step 5 may have been exposed if the site was still infected.
Step 10: bring the site back online
- In Websites & Domains, set the website status back to Active.
- Test the main pages in a private window and from a phone on mobile data: some redirects only target those visitors.
- Watch
error_logand recent files for several days. See Read the logs. - In Google Search Console, open the Security Issues report. If an issue is listed, fix it on all affected pages, then click Request Review and describe what you did. A review can take from a few days to a few weeks.
Your obligations if data is affected
If the site holds personal data (customer accounts, forms, orders) and you are subject to the GDPR, the incident may be a personal data breach:
- Record the incident in your internal register in all cases.
- If there is a risk to individuals, notify your supervisory authority within 72 hours of becoming aware of it. In France, this is the CNIL (page in French). You can complete the notification later.
- If the risk is high, also inform the people concerned.
You can also file a complaint with the police. In France, the website defacement sheet (in French) details the steps to take. If you are unsure of your obligations, ask your data protection officer or a lawyer.
Check the result
- The site displays normally, with no redirect, on computer and mobile.
- No unknown account, scheduled task or file remains.
- The CMS, plugins and themes are up to date.
- All passwords were changed after the cleanup.
- The Search Console security report no longer shows a problem.
- A clean backup is kept outside the server.
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| The site is infected again after a few days | Remaining backdoor, unfixed vulnerability, scheduled task or infected computer | Go back to steps 4 and 7, then prefer a full reinstall or a specialist |
| You can no longer log in to WordPress | Administrator account changed or deleted | In phpMyAdmin, correct your email address in the users table, then use "Lost your password?" |
| The restored backup is infected too | The intrusion is older than this backup | Restore an older backup or move to option B |
| Redirects only affect some visitors | A rule targets mobile users or visitors from search engines | Examine .htaccess and header files, then test from a phone |
| WP Toolkit shows the site as quarantined | The tool cannot read the files properly, sometimes because of an infection | Check the files, then contact support if the site is clean |
| Your email lands in spam or is rejected | Malicious sending has damaged your sender reputation | Change the mailbox passwords and report it to support |
| The Google warning remains | No review was requested or it is not finished | Check the report. Wait for the answer before sending another request |
Reduce the risk in future
- Schedule backups and keep a copy outside the server.
- Apply updates quickly and remove what you no longer use.
- Use unique passwords and a separate account for each person.
- Transfer your files only over encrypted FTP.
Further reading
- FAQ My site was hacked, official WordPress documentation
- WP Toolkit, official Plesk documentation