Skip to content
Host4u Limited

My website has been hacked: what to do

Support Portal  »  Knowledgebase  »  Viewing Article
There was a problem loading the comments.
  Print

If your website shows content you did not put there, redirects visitors somewhere else, sends spam, or we have told you your account has been compromised, act quickly. Hackers nearly always get in through an out-of-date plugin, theme or script, a stolen password, or a pirated ("nulled") theme or plugin that already contained malware.

1. Take a backup

Take a full backup of the account first, so nothing is lost and you can look into what happened. See What backups are included.

2. Change every password

Change them all, because the hacker may have copied them:

3. Remove users you do not know

Check the list of users in WordPress (or Joomla, or whatever the site runs) and delete anyone who should not be there. Hackers often add their own admin users, or change an existing user's email address so they can reset the password.

4. Clean the files

Malware is often hidden in many files so that the site can be hacked again. The only way to be sure is to start from clean files.

  1. Rename your public_html folder (for example to public_html_old) to put it out of the way, and make a new empty one.
  2. Install a fresh copy of the latest version of WordPress (or your software): see Installing WordPress.
  3. Check your original wp-config.php for malicious code, including in commented-out sections. If it is clean, copy it across.
  4. Reinstall only the plugins and themes you really need, from their original source, such as WordPress.org.
  5. Put back only the files you cannot get from a source, such as your image uploads and any custom theme, and check each one before you do. Backdoors are often hidden in theme files and upload folders.
  6. Update everything and delete software you no longer use.

If you would rather not do this yourself, restoring a clean backup from before the hack is the quickest way back. You can restore from JetBackup 5 in cPanel: see What backups are included.

5. Scan and watch

Run the Malware Scanner in cPanel (under Security), and keep an eye on the site and on Website access and error logs. Our own scanner may also find and tell you about malware: if it reports a cron job you did not create, see Scheduled tasks (cron jobs).

6. If Google has flagged your site

If your site is flagged as dangerous, fix it first, then ask Google to review it through Google Search Console, using its "Request a review" process.

7. Stop it happening again

See Keeping WordPress secure.

Need help?

We can help check the account. Open a support ticket and tell us what you found. We may reset passwords for you straight away if we think your account is being misused.


Share via
Did you find this article useful?  

Related Articles


Self-Hosted Help Desk Software by SupportPal