My WordPress site was hacked: what should I do in the first hour?

WordPress site hacked? In the first hour, isolate the site, change every password, copy the infected site and contact your hosting provider. Then restore or clean, and close the way in.

WordPress site hacked: what to do in the first hour? Four steps, in this order: isolate the site (maintenance mode or block access), change every password (WordPress, hosting, FTP/SSH, database and email), copy the infected site so it can be analyzed, and contact your hosting provider.

At Dongee, shared hosting includes Imunify360 and daily backups with assisted restore, and 24/7 human support in your language (the platform translates on the fly) helps you review the site. After that first hour, you need to decide whether to restore or clean, and above all close the door the attackers came through.

Updated November 26, 2026 · Dongee Team

How do I know if my WordPress site was really hacked?

Not every error is a hack. A plugin that breaks after an update can also take the site down. These signs, however, usually point to an intrusion:

  • Redirects to other websites that only happen on mobile or when you arrive from Google results. If you type the address directly, everything looks normal.
  • Browser warnings ("deceptive site", "this site may harm your computer") or security messages in Google Search Console.
  • Admin users you didn't create, often with generic names or odd email addresses.
  • New PHP files in the uploads folder (inside wp-content), where normally there are only images and documents.
  • Spam sent from your email, mass bounces or customers telling you about strange messages.
  • Your hosting provider suspends the site or warns you about malware.
  • Pages in other languages indexed in Google (pharmacy, gambling, knock-off brands) that you never published. Search site:yourdomain.com to see them.

If you see two or more of these signs, act as if the site is compromised.

What do I do in the first 60 minutes?

The goal of the first hour is not a spotless site. It is to stop the damage, preserve evidence and regain control of every login. Follow this order:

  1. Minutes 0–5: don't delete anything yet. It's tempting to remove the suspicious files, but if you do, you lose track of how the attackers got in. Malware also tends to leave several backdoors, so deleting just one fixes nothing.
  2. Minutes 5–10: put the site in maintenance mode or lock it. Turn on a maintenance mode or restrict public access (for example, with password protection for the directory from your panel). That way your visitors and customers are no longer exposed to malicious redirects or downloads.
  3. Minutes 10–20: change passwords from a clean device and turn on 2FA. Use a computer you know is not infected. Change, in this order, the passwords for your hosting/panel, FTP and SSH, the database (and update it in the wp-config.php file), every WordPress administrator and the email accounts on the domain. Then turn on two-factor authentication (2FA) in cPanel and in the client area.
  4. Minutes 20–30: end sessions and review admin users. In WordPress, go to Users and filter by the Administrator role. Downgrade or delete any accounts you don't recognize (write down their name and email first). Forcing every session to log out invalidates stolen cookies; a practical way to do it is to regenerate the security keys (salts) in wp-config.php.
  5. Minutes 30–40: copy the files and database of the infected site. Download everything and store it separately, labeled "infected". Never restore it. It's there to analyze what happened and to recover recent content or orders if you need them.
  6. Minutes 40–50: contact your hosting support and, if you sell online, notify your payment gateway. Tell your hosting provider what you saw and since when. If you run WooCommerce and payment data might have been exposed, your gateway needs to know as soon as possible.
  7. Minutes 50–60: find your last good backup. Work out the approximate date of the infection (modified files, first warnings, spikes of odd traffic) and look for a backup from before that date. Don't restore yet: decide on the strategy first.

Should I restore a backup or clean the site?

It depends on whether you have a clean copy, how much new content there is since then and your technical skills. This comparison helps you decide:

OptionWhen it makes senseAdvantageRisk
Restore a clean backupYou have a copy from before the infection and few changes since thenIt's the fastest way back to a known stateYou lose whatever was created after the copy; if the copy was already infected, the problem returns
Clean it by handThere's no clean copy and you know WordPress, PHP and databases wellYou keep all your recent contentIt's easy to miss a hidden backdoor
Reinstall core, plugins and themesThe damage is mostly in files and the database content is healthyReplaces modified files with official versionsDoesn't clean malicious code stored in the database or in uploads
Professional cleanup serviceSevere or repeat infection, or a store with sensitive dataDeeper analysis and a diagnosis of the causeIt costs money and doesn't replace changing passwords or updating

One rule that never fails: restoring without closing the door is an invitation to get hacked again. If the attacker got in through a vulnerable plugin and you restore a copy with that same plugin, you'll be back where you started in days or even hours. Restore, update everything right away and change the passwords again. If you go this route, follow the guide to restore a WordPress backup.

How do I find out how they got in?

Finding the cause is what keeps it from happening again. These are the most common entry points:

  • Outdated or "nulled" plugins and themes. Pirated versions of premium themes and plugins often ship with malicious code from day one. A legitimate plugin that isn't updated may have a known vulnerability that gets exploited automatically.
  • Weak or reused passwords. If you use the same password on other services and one of them leaked, attackers try that combination on your WordPress.
  • Old FTP accounts from a former developer or an agency that no longer works with you.
  • wp-config.php with open permissions, readable or editable by more users than necessary.
  • Modified .htaccess or index.php files, where conditional redirects (mobile only or only from Google) are usually hidden.
  • Unprotected forms that allow file uploads or data submission without validation.

To investigate, combine two sources. The first is malware scanners: there's a list in 7 useful tools to scan your website for malware. The second is the access logs your hosting provides: look for POST requests to unusual files, hits on wp-login.php from unknown IPs and the date of the first modified files. Compare that date with your latest updates and installs.

What do I do after cleaning so it doesn't happen again?

Once the site is clean, go through this checklist:

  • Update everything: WordPress core, plugins and themes, plus the PHP version if your hosting allows it.
  • Delete plugins and themes you don't use. Deactivating them isn't enough: the code is still on the server.
  • Turn on 2FA in WordPress, in your hosting panel and in your email.
  • Keep admin users to a minimum. Editors and authors don't need that role.
  • Use a test environment for updates. Learn to create a WordPress staging site before updating so you don't put off updates for fear of breaking the site.
  • Keep backups off the site, in addition to the ones your hosting makes, and check from time to time that they can be restored.
  • Check Google Search Console. If Google flagged the site, open the Security issues section, confirm you've cleaned it and request a review.
  • Apply the official hardening. The WordPress hardening guide covers file permissions, disabling the file editor and other measures.

What does Dongee include to help you recover?

No hosting provider can promise you'll never be hacked, especially if the problem is a plugin or a password. What it can do is reduce your exposure and give you tools to recover quickly. Here's what each Dongee product includes:

  • Shared hosting: Imunify360 included, an isolated container per account (whatever happens in another account doesn't spread to yours), 2FA in cPanel and in the client area, and daily backups with assisted restore.
  • Dongee WordPress PRO hosting: automatic backups with 1-click restore and staging to test updates before applying them to the live site.
  • Dongee Business Hosting: 24/7 monitoring by Dongee staff who step in if something fails, and an average support response time under 60 seconds.

Every product comes with 24/7 human support by chat and WhatsApp, in your language (the platform translates on the fly).

PlanHow it helps after a hackPrice
Dongee Startup shared hostingImunify360, isolated container, 2FA, daily backups with assisted restore10 USD/month
Dongee WordPress PRO hosting1-click restore and staging to update with less riskFrom 6.66 USD/month
Business Hosting Sapphire24/7 monitoring by Dongee staff and an average support response time under 60 seconds25 USD/month

Frequently asked questions

Will Google penalize me?

If Google detected malware or deceptive content, it may show warnings to visitors and hurt your traffic in the meantime. If it flagged the site, clean it completely and request a review from Google Search Console. The warnings are removed once Google confirms the problem is fixed.

Will I lose WooCommerce orders if I restore?

Yes, you lose the orders placed after the date of the backup. Before restoring, export recent orders (and new customers) from the infected site or from the copy you saved. Then review them and load them back into the clean site.

Is installing a security plugin enough?

No. A security plugin helps detect and block attacks, but it doesn't replace cleaning out malicious code that's already inside or changing your passwords. If the attacker left a backdoor, the plugin won't always see it.

How long does cleanup take?

It depends on the type of infection, whether you have a clean copy and the size of the site. Restoring a good backup is usually the fastest option. A manual cleanup with malware in the database can take considerably longer. What matters is not reopening the site until you've closed the way in.

Can my hosting provider help me?

At Dongee, 24/7 support helps you review it and, on shared hosting, restore the copy thanks to daily backups with assisted restore. Write to them by chat or WhatsApp, explaining what signs you saw and since when.

A hack is scary, but an orderly first hour makes all the difference: isolate, change logins, keep evidence and ask for help. Then restore or clean, close the door and keep your updates and backups running so it doesn't happen again.

Comenta lo que quieras

Unete a la charla
Solo ingresa tu email