Revenue Driven For Clients

2,120,240,443

article-1-featured-website-got-hacked

My Website Got Hacked — What Should I Do First?

Quick Summary: The 7 Emergency Steps

  1. Do NOT reinstall or delete files yet
  2. Take the site offline / into maintenance mode
  3. Create a backup of the infected site
  4. Change ALL passwords immediately
  5. Identify how the hack happened
  6. Clean the malware (or call a professional)
  7. Submit for Google blacklist removal

Step 1: Don't Panic But Do Act Fast

The most important thing you can do in the first five minutes is resist the urge to start deleting files. Here is why:

  • Deleting files before scanning means you lose the evidence needed to identify how the hacker got in which means they can get in again.
  • Reinstalling WordPress immediately replaces core files but leaves the database, uploaded files, themes, and plugins untouched  all of which may contain backdoors.
  • Restoring from an old backup without cleaning the server first will just result in a re infection within hours.

Did You Know?

91% of WordPress vulnerabilities come from plugins, not WordPress core. Restoring a clean backup to the same server with the same vulnerable plugin will see you hacked again within hours.

Source: Patchstack State of WordPress Security 2026

Step 2: Take Your Website Offline

Before doing anything else, limit the damage. Every minute your hacked site is live, it may be:

  • Redirecting your visitors to malware or scam sites
  • Stealing customer data and payment information
  • Sending spam emails through your server
  • Getting deeper blacklisted by Google and other security vendors

How to Take Your Site Offline

Method How to Do It
Maintenance Mode Plugin If you still have WP admin access, install and activate a maintenance mode plugin (e.g. WP Maintenance Mode) and enable it.
Password Protect Directory In cPanel, use 'Directory Privacy' to add a password to your public_html folder.
Contact Your Host Call or chat your hosting provider most can restrict public access within minutes.
Rename index.php Via FTP, rename index.php to index.php.bak this will show a 403 error to visitors while you work.

Step 3: Create a Full Backup of the Infected SitSe

This sounds counterintuitive why would you back up an infected site? Because you need:

  • A snapshot of the attack for forensic analysis
  • The original database content so no customer data is lost
  • Evidence if you need to report the breach

How to Back Up

  1. Log into your hosting cPanel and use the Backup Wizard to download a full account backup.
  2. Use an FTP client (like FileZilla) to download your entire public_html folder.
  3. Export your database via phpMyAdmin (Databases > Export > Quick > Go).
  4. Store this backup on a separate drive or cloud storage  not on the same server.

Is Your Website Hacked? SEOHUB Can Fix It in 24-48 Hours.

Our security team has cleaned 500+ infected websites across Pakistan and worldwide. Get a
free malware scan today.

Step 4: Change Every Password Immediately

Hackers almost always leave behind credential access. Even if you remove the malware, they can log back in if you haven’t changed all passwords.
Area What to Change Priority
WordPress Admin Go to Users > Your Profile > Update Password CRITICAL
Hosting / cPanel Log into your host control panel and reset the account password CRITICAL
FTP / SFTP Change all FTP account passwords in cPanel > FTP Accounts CRITICAL
Database Password Change in cPanel > MySQL Databases, then update wp-config.php HIGH
Email Accounts Reset all email passwords on the domain HIGH
Google Search Console Check for unauthorized users and remove them HIGH
Important Security Note
After changing your WordPress admin password, immediately check Users > All Users for any admin accounts you did not create. Hackers routinely add new admin users. Delete any unknown accounts.

Step 5: Identify the Type of Hack

Not all hacks look the same. Understanding what type of attack hit your site helps you know where to look during cleanup. Here are the most common types:
Hack Type What You'll See Where to Look
Redirect Hack Visitors sent to spam, pharma or adult sites .htaccess file, wp-content, core PHP files
SEO Spam Injection Pharma/Japanese keyword pages indexed under your domain Database, injected posts, PHP files
Backdoor Shell Unknown PHP files in uploads, themes or plugins folder wp-content/uploads, theme files
Admin User Added New administrator in WordPress Users you don't recognize WordPress Users section
Defacement Homepage replaced with hacker message index.php, active theme files

Step 6: Scan and Clean the Malware

This is the most critical step  and the one most people get wrong. There are two approaches:

Option A: DIY Scan with a Security Plugin (Limited)

If you still have WordPress admin access, you can install a security plugin like Wordfence or Sucuri Scanner to perform a scan. This will identify some infected files, but:

  • Limitation 1: Free scanners miss database infections and obfuscated malware.
  • Limitation 2: They don’t find custom backdoors planted in obscure file locations.
  • Limitation 3: They can’t clean all infection types — some require manual code level removal.

Option B: Professional Malware Removal (Recommended)

A professional cleanup goes far beyond what any plugin can do:

  • Manual inspection of every file and database table
  • Identification and removal of all backdoors and shells
  • Database injection cleanup
  • Removal of SEO spam pages and redirect scripts
  • File permission hardening
  • Firewall installation and brute force protection

SEOHUB Emergency Cleanup

SEOHUB has cleaned 500+ infected websites from WordPress blogs to complex Laravel applications.

Our team completes most cleanups within 24-48 hours with zero data loss.

Get Malware Cleanup →

Step 7: Remove the Google Blacklist Warning

Once your site is clean, you need to get Google to re evaluate it and remove the ‘Deceptive site ahead’ or ‘This site may be hacked’ warnings. This process takes 1 to 3 days typically.

How to Submit a Review Request

  1. Open Google Search Console at search.google.com/search-console and log in.
  2. Go to Security & Manual Actions then click ‘Security Issues’ to see what Google flagged.
  3. Review the flagged URLs and confirm your site is clean. Take screenshots as evidence.
  4. Click ‘Request a Review’ and in the description explain: what the infection was, when and how you found it, what steps you took to clean it, and what you did to prevent re infection.
  5. Wait for Google’s response which typically arrives via email and Search Console notifications within 1-3 business days.

Other Blacklists to Check

Google is not the only blacklist. Check and submit removal requests to:

  • Sucuri SiteCheck: sitecheck.sucuri.net
  • McAfee WebAdvisor: siteadvisor.com
  • Norton Safe Web: safeweb.norton.com
  • Bing Webmaster Tools: bing.com/webmasters

Step 8: Harden Your Site to Prevent Re Infection

The worst outcome after a hack is getting hacked again. Here is your post cleanup security checklist:

Security Action Why It Matters
Install a Web Application Firewall (WAF) Blocks malicious traffic before it reaches your site. Stops brute force attacks, SQL injections, and XSS.
Update all plugins, themes and WordPress core 91% of WordPress hacks exploit outdated plugins. Keep everything updated immediately.
Delete unused plugins and themes Every inactive plugin is a potential attack surface. Remove what you don't use.
Enable two factor authentication (2FA) Even if your password is stolen, attackers cannot log in without the second factor.
Set up automated daily backups Store backups off server. In case of a future attack, you can restore quickly.
Change file permissions Set files to 644 and folders to 755. wp-config.php should be 600.
Disable XML RPC if not needed XML-RPC is a common brute-force attack vector. Disable it via .htaccess if you don't use remote publishing.
Schedule regular malware scans Automate weekly or daily scans so infections are caught early before damage spreads.

When to Call a Professional

You should contact a professional website security team immediately if any of the following apply:

  • You cannot access your WordPress admin panel
  • Your hosting account has been suspended for malware
  • Google Search Console shows a manual action or security issue
  • You have found the malware but it keeps coming back after removal
  • You have a WooCommerce or ecommerce store and customer data may be at risk
  • Your site runs on a custom platform (Laravel, CodeIgniter, custom PHP)
  • You are not comfortable working with FTP, cPanel or code files

Is Your Website Hacked? SEOHUB Can Fix It in 24-48 Hours.

Our security team has cleaned 500+ infected websites across Pakistan and worldwide. Get a
free malware scan today.

Frequently Asked Questions

Should I tell my customers their data may have been compromised?

If your site collects personal data, emails, or payment information, yes depending on your jurisdiction you may have a legal obligation to notify affected users. Consult a legal professional if you are unsure.

Can I restore my site from a backup instead of cleaning it?

You can, but only if: (a) the backup is from before the infection, (b) you know the exact date the hack occurred, and (c) you also address the vulnerability that allowed the hack. Restoring without patching the vulnerability results in immediate re infection.

How long does malware removal take?

For WordPress sites, a professional cleanup typically takes 24 to 48 hours. Custom coded sites in Laravel or CodeIgniter may take 2 to 4 days depending on complexity.

Will cleaning malware affect my SEO rankings?

The malware itself damages your rankings   not the cleanup. Once your site is clean and Google removes the blacklist warning, your rankings should recover. The faster you clean, the less permanent SEO damage.

SHARE:

Leave a Comment

Your email address will not be published. Required fields are marked *