Home › Knowledgebase › KB-1251

My business website has been hacked and is spreading malware

Summary

This guide helps you troubleshoot and resolve: My business website has been hacked and is spreading malware. Follow the steps below to fix the issue.

Quick Tip: Need immediate assistance? 💻 Open a Ticket

Common Causes

A website compromise occurs when an attacker gains unauthorised access to your site's files or database and inserts malicious code. This can lead to visitors being redirected to phishing pages, customer credentials being stolen, or your server being used to distribute malware to other users. Search engines and email providers frequently flag compromised domains, resulting in browser warnings, email blacklisting, and a significant loss of customer trust.

Do not visit your infected website using your web browser while attempting to clean it. Browsing the site can expose your local computer to malware and may allow attackers to capture additional credentials.

Step 1: Secure Your Local Computer First

Before changing any website passwords, confirm that the computer you use to manage your site is clean. Malware on your local machine can capture keystrokes and reinfect your website immediately after you change passwords.

  1. Disconnect your computer from the internet temporarily.
  2. Run a full system scan using updated antivirus or anti-malware software.
  3. Remove all detected threats and restart your computer.
  4. Only reconnect to the internet and proceed with website password changes after your local machine is confirmed clean.

Step 2: Take the Website Offline

Prevent visitors from accessing infected pages and stop the malware from spreading further.

If you use cPanel

  1. Log in to your cPanel account.
  2. Navigate to the Files section and click File Manager.
  3. Open the public_html folder.
  4. Create a new file named .htaccess if one does not exist, or edit the existing .htaccess file.
  5. Add the following directive at the top of the file to return a 503 error to all visitors:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^.*$ /maintenance.html [R=503,L]
  1. Save the file and create a simple maintenance.html page in public_html informing visitors the site is temporarily offline.

If you use Plesk

  1. Log in to your Plesk control panel.
  2. Go to Websites & Domains.
  3. Click Hosting Settings.
  4. Clear the Hosting enabled checkbox to suspend the site temporarily.
  5. Click OK to apply the change.

If you use WordPress

  1. Log in to your WordPress admin dashboard.
  2. Go to Plugins > Add New.
  3. Search for and install a reputable maintenance mode plugin.
  4. Activate the plugin and enable maintenance mode from its settings page.

Step 3: Change All Website and Hosting Passwords

Attackers often retain access through compromised credentials. Change passwords only after your local computer is confirmed clean.

  • Hosting control panel (cPanel or Plesk admin password)
  • CMS administrator accounts (WordPress, Joomla, Drupal)
  • FTP and SFTP accounts
  • Database users
  • Email accounts associated with the domain

Use strong, unique passwords for each account. Do not reuse passwords across different services.

Step 4: Restore from a Clean Backup

If you have a backup taken before the infection, restore your website files and database from that point.

cPanel users

  1. Log in to cPanel.
  2. Go to Files > Backup or Backup Wizard.
  3. Select Restore and choose the backup file that predates the compromise.
  4. Follow the prompts to restore files and databases.

Plesk users

  1. Log in to Plesk.
  2. Go to Websites & Domains > Backup Manager.
  3. Select the backup created before the infection date.
  4. Click Restore and confirm the restoration.
If no clean backup exists, do not attempt to manually edit code unless you have technical experience. Incorrect modifications can break your website permanently. Download a full copy of your site files and database before making any changes, then contact your hosting provider for assistance.

Step 5: Update All Software

Outdated CMS versions, plugins, and themes are common entry points for attackers.

WordPress users

  1. Log in to your WordPress admin dashboard.
  2. Go to Dashboard > Updates.
  3. Update WordPress core, all plugins, and all themes.
  4. Go to Plugins > Installed Plugins and delete any plugins or themes you no longer use.

Joomla users

  1. Log in to the Joomla administrator panel.
  2. Go to Components > Joomla! Update.
  3. Apply all available updates for core and extensions.

Step 6: Remove Malicious Code

If you cannot restore from a clean backup, you must identify and remove infected files.

  • Check index.php, header.php, and footer.php for unfamiliar code.
  • Inspect .htaccess files for suspicious redirect rules.
  • Review WordPress wp-config.php and functions.php files.
  • Look for recently uploaded files in media or upload directories.

Use a reputable security scanner to identify infected files, then remove or replace them with clean versions. If you are unsure about any file, do not delete it—seek professional assistance.

Step 7: Notify Affected Customers

If customer data, login credentials, or payment information may have been accessed, you must inform affected individuals promptly. Explain what happened, what data may have been exposed, and what steps they should take, such as changing their own passwords and monitoring accounts for unusual activity. Depending on your industry and location, you may also have legal obligations to report the breach to relevant authorities.

Step 8: Resolve Search Engine and Email Warnings

Once the site is clean, request a review to remove warnings and blacklistings.

  1. Verify ownership of your domain in Google Search Console.
  2. Go to the Security Issues section and request a malware review.
  3. If your emails are blocked, contact your email service provider to request delisting from blacklists.
  4. This process can take several days. Continue monitoring Search Console and email delivery until warnings are removed.

Step 9: If Your Hosting Account Is Suspended

Some hosting providers suspend accounts when malware is detected. If your website is offline because your host suspended it:

  1. Contact your hosting provider through their support portal.
  2. Provide evidence that the infection has been removed, such as scan reports or a list of cleaned files.
  3. Request that they reactivate your hosting account.
  4. Do not attempt to reactivate the site yourself until the host confirms the suspension is lifted.

Step 10: Implement Ongoing Security Measures

After cleanup, reduce the risk of future compromise by adding protective layers.

  • Install a reputable security plugin or extension for your CMS (for example, Wordfence or Sucuri Security for WordPress).
  • Configure a Web Application Firewall (WAF) to filter malicious traffic before it reaches your site.
  • Schedule automatic, regular backups of your website files and database.
  • Enable two-factor authentication on all administrator and hosting accounts.
  • Set up automatic updates for your CMS, plugins, and themes where possible.
  • Monitor your site files regularly for unexpected changes.
If you host with us, you don't need to do this yourself — just Open a Ticket and our Brisbane team will get it sorted.

Still Having Issues?

Need more help? If the issue persists after trying these steps, please open a support ticket and our team will assist you.

💻 Open a Ticket