Site down or flagged? — engineers on shift right now, average response 11 minutes. Start a free scan →
October 15, 2026 · FixMalware Team · 9 min read · 244 views

How to Fix "My WordPress Site is Hacked What Do I Do?" - Immediate Steps for Website Owners

WordPress site hacked? Don't panic. Here are the immediate, no-fluff steps to take to get your website back online and secure.

My WordPress Site is Hacked: What Do I Do? Immediate Steps

So, your WordPress site is hacked. I get it. That sinking feeling when you see weird content, redirects, or a Google warning is rough. I've been cleaning up hacked websites for over 8 years, and I've seen this exact panic happen dozens of times. The good news? You can fix it. You just need to act fast and follow some clear steps. This isn't about fancy tech talk; it's about getting your site clean and back to business.

First Things First: Don't Panic, But Act FAST

The absolute worst thing you can do right now is freeze up. Hackers love it when site owners delay. Every minute your site is compromised, it's doing damage – to your reputation, your visitors, and potentially even your bottom line. Think of it like finding a leak in your roof; you don't wait for the whole ceiling to collapse.

Look, if you're reading this, you're already on the right track by seeking help. This guide will walk you through the essential immediate actions. We'll cover what to do right now, and then what comes next to prevent it from happening again.

Step 1: Take Your Site Offline (Temporarily!)

Before you touch anything else, you need to stop any further damage. The best way to do this is by taking your site offline. This prevents visitors from seeing malicious content or getting infected themselves. It also stops the hacker from doing more damage or stealing more data.

How do you do this? The easiest way is to put up a simple 'Under Maintenance' page. You can do this through your hosting control panel, or by replacing your site's index.html file with a basic HTML file that says something like, 'Our website is temporarily offline for maintenance. We apologize for the inconvenience.' This is a temporary measure, and we'll get you back online soon.

Step 2: Secure Your Hosting Account

Your hosting account is the gatekeeper to your website files. Hackers often try to exploit weaknesses here too. If they have access to your hosting, they can do a lot of damage, even if you clean up your WordPress files.

Here's the thing: you need to change your hosting account password immediately. Make it strong – a mix of upper and lowercase letters, numbers, and symbols. Don't use anything easily guessable like your name or birthday. Also, check your hosting account for any unfamiliar files or directories. If you see anything suspicious, let your host know.

Step 3: Change ALL Your Passwords

This is a big one, and it's often overlooked. Hackers don't just break into your site; they often steal login credentials. You need to assume that every password you've used is compromised.

Change passwords for:

  • Your WordPress admin login.
  • Your hosting account control panel (cPanel, Plesk, etc.).
  • Your FTP/SFTP accounts.
  • Your database user (if you know how to do this).
  • Any other users with access to your website or hosting.

Use strong, unique passwords for each. A password manager can be a lifesaver here.

Step 4: Scan Your Website Files

Now it's time to look for the actual malware. This is where you start digging into the code. You'll need to access your website's files, usually via FTP or your hosting account's File Manager.

You're looking for unfamiliar files, modified core WordPress files, and suspicious code injected into your existing files. Hackers often hide malicious code in seemingly innocent files like 'index.php', '.htaccess', or within your theme's 'functions.php' file. This can be tedious work. I've spent many late nights sifting through code, looking for that one rogue line.

Pro Tip: Sometimes it's easier to compare your current files with a fresh download of WordPress. If a core file looks different, it's probably been tampered with.

Step 5: Clean the Malware

This is the core of the fix. You need to remove the malicious code. If you're comfortable with code, you can try to do this yourself. Look for strange PHP functions, encoded strings (often using functions like `base64_decode`), or redirects you didn't put there.

The truth is, manual cleaning can be tricky. You might miss something, or accidentally break your site's functionality. This is where many people realize they need expert help. If your site has been injected with malicious JavaScript, for example, it can be hard to find and remove all traces. If you're not an expert, or if you've already tried and failed, it's time to consider professional help like our WordPress Malware Removal service.

Step 6: Restore from a Backup (If You Have One!)

This is the golden ticket if you're lucky enough to have a clean, recent backup. If you have a backup from *before* the hack happened, restoring it is often the fastest way to get a clean site.

Make sure the backup you restore is from a time before you noticed any suspicious activity. A backup taken *after* the hack will just restore the malware. Always test your backup on a staging server first if possible, to ensure it's working correctly before overwriting your live site.

Step 7: Update Everything

Hackers exploit vulnerabilities in outdated software. So, after cleaning or restoring, you absolutely *must* update everything.

Update your WordPress core, all your plugins, and all your themes to their latest versions. Don't skip this. Outdated plugins are one of the most common ways sites get hacked. If you're running old versions of things like OpenCart or Joomla, the same applies – keep them patched up.

Step 8: Secure Your Website Against Future Attacks

Cleaning the site is only half the battle. You need to prevent it from happening again. This is where most people drop the ball, and I see it happen over and over. They clean it, forget about security, and get hacked again six months later.

Here are some crucial steps:

  • Use Strong Passwords (Again!): Seriously, make them long and unique.
  • Install a Security Plugin: Plugins like Wordfence or Sucuri can help scan for malware, block malicious IPs, and add an extra layer of security.
  • Regular Backups: Set up automatic, off-site backups. Store them somewhere other than your web server.
  • Two-Factor Authentication (2FA): Enable 2FA for your WordPress admin login. This adds a huge layer of security.
  • Limit Login Attempts: Prevent brute-force attacks by limiting how many times someone can try to log in.
  • Remove Unused Themes/Plugins: If you're not using a plugin or theme, delete it. Each one is a potential entry point.
  • Keep Software Updated: This bears repeating. Update WordPress, plugins, and themes as soon as updates are released.

What If You Can't Clean It Yourself?

Look, I'm all for DIY, but sometimes you just need to call in the cavalry. If you've tried these steps and your site is still acting weird, or if you're overwhelmed by the technicalities, don't beat yourself up. Hiring a professional is often the most efficient and effective solution.

We specialize in getting hacked websites clean, no matter the platform. Whether it's a WordPress site, an OpenCart store, or a Joomla site, we have the tools and experience to remove malware and secure your site. We can even handle custom platforms if that's what you're running. You can get a free quote for our services right here: Get a Free Quote.

Common Reasons WordPress Sites Get Hacked

Understanding *why* it happened can help you prevent future breaches. In my experience, here are the usual suspects:

  • Outdated Software: This is number one. Hackers actively scan for sites running old versions of WordPress, plugins, or themes with known vulnerabilities.
  • Weak Passwords: Easy-to-guess passwords or reused passwords are like leaving your front door unlocked.
  • Insecure Plugins/Themes: Even popular plugins can have vulnerabilities. Free themes from untrusted sources are particularly risky.
  • Compromised Hosting: If your hosting provider has a security breach, your site can be affected.
  • No Security Measures: Simply not having any security plugins, firewalls, or regular scans is a major invitation.

For example, a few years back, a popular slider plugin had a major vulnerability that affected thousands of sites. If you didn't update it, you were a prime target. Similarly, if your Joomla site is flooded with calendar spam, it's often due to an unpatched vulnerability. Cleaning Drupal calendar spam, for instance, is a common issue we see.

What About Being Blacklisted by Google?

If your site has been hacked and is distributing malware or phishing attempts, Google will likely blacklist it. This means visitors will see a scary warning page (like the "Deceptive Site Ahead" warning) before they even reach your site. This can decimate your traffic. Getting off these lists is crucial, and you can learn more about how to fix it in our guide on How to Fix Google Blacklisted Website and Restore Your Site's Reputation.

Don't Let Hackers Win

Getting hacked is a stressful experience, but it's not the end of the world. By taking immediate action and implementing strong security practices afterward, you can recover and protect your online presence.

If you're unsure about any of these steps, or if the task feels too daunting, please reach out. We offer a reliable WordPress malware removal service and can tackle issues on other platforms too, like OpenCart malware removal or Joomla malware removal. We can even help with custom or other platform malware removal.

Want to see if your site is infected right now? Try our free scanner:

Run a Free Malware Scan

Frequently Asked Questions (FAQ)

How long does it take to clean a hacked WordPress site?

The time it takes can vary greatly. A simple hack with a few infected files might take a few hours. However, a more complex infection, or a site that's been compromised for a long time and has many files altered, could take a day or more. If a site is redirecting visitors to scam pages, that often requires deeper investigation.

Will cleaning my site remove my content?

A proper cleaning process should not remove your content. The goal is to remove the malicious code while preserving your legitimate files and data. However, if the hack was severe and files were corrupted or deleted by the hacker, a restoration from a clean backup might be necessary. We always aim to salvage as much as possible.

What if I suspect my e-commerce store is hacked and redirecting visitors?

This is a critical situation, especially for e-commerce. If your e-commerce website is suddenly redirecting visitors to cryptocurrency scam pages, it's a sign of a serious infection. You need to act immediately to prevent financial loss and reputational damage. This is a common problem we address, and you can read more about it in our post on Why is my e-commerce website suddenly redirecting visitors to cryptocurrency scam pages in 2026?. The steps outlined above still apply, but professional help is highly recommended in these cases.

Is your site infected?

Our engineers will clean it within 24 hours — guaranteed.

Keep reading

Related articles