Skip to content

Home / Blog

Guide

Hacked WordPress Site? How to Recover Using Backups

Hacked WordPress Site? How to Recover Using Backups

Your site redirects visitors to a strange page, or Google shows “This site may be hacked” under your name. If you are dealing with a hacked WordPress site, what you need first is a clear head and a plan. Restoring from a backup is often the fastest way back, but restoring the wrong copy, or restoring and stopping there, can bring the infection right back or wipe out orders you meant to keep. Here is the order to do things in.

Signs of a hacked WordPress site

Not every problem is a hack; a failed update or a server outage can look similar. These signs deserve a closer look:

  • Redirects to other sites, sometimes only for visitors coming from Google or on mobile, so you may not see them yourself.
  • Browser or Google warnings that the site is dangerous or hacked.
  • Strange pages in search results. Search site:yourdomain.com and look for pages in other languages or on unrelated topics.
  • Administrator accounts you don’t recognize.
  • Plugins or files you didn’t add, or unfamiliar code in the header or footer.
  • A malware alert from your host, or email bouncing because the server’s IP landed on a blocklist.
  • Unusual resource usage without a matching rise in real traffic.

Before you restore anything: five first steps

Rushing makes things worse. Spend half an hour on these first:

  1. Write down what you see. When did you notice it? What exactly happens? Did you add a plugin or theme recently? WordPress.org’s FAQ for hacked sites calls documentation the first actionable step.
  2. Contact your host. Support can see server logs and malware scan reports, and may be able to tell when the infection began.
  3. Keep a copy of the current state, infected or not. You may need it to recover new content or understand what happened.
  4. Export recent data. A restore takes the site back to the backup date. Orders, form entries and posts created since then will disappear unless you export them first.
  5. Change your most sensitive passwords now from a clean device: hosting account, cPanel and email. Scan your own computer too; sometimes the infection starts there.

Choosing the right backup

This is where most people slip. Infections usually begin before anyone notices, sometimes weeks before. Restore yesterday’s copy and you may restore the malware along with the site.

Look for the earliest sign using:

  • The first-detected date in Google Search Console’s Security Issues report.
  • File modification dates, especially index.php, functions.php and .htaccess.
  • The creation date of unknown users in WordPress.
  • Your host’s malware scan reports.

Then pick a backup from before that date, with some margin. If the infection is older than your oldest available backup, restoring won’t solve it and you’ll need a manual clean-up of files and database instead.

What to restore

Restore type Use it when Watch out for
Full account (files, databases, email) The infection is widespread or affects several sites in the account Email and settings also roll back to the backup date
Site files plus its database, same date The usual case for a single WordPress site Restore both from the same date so they match
Database only Only content or users were tampered with Rarely enough; most hacks leave files behind too

How to restore with JetBackup in cPanel

If your host uses JetBackup, the steps usually look like this (labels can vary slightly by version):

  1. Log in to cPanel and open JetBackup 5 in the Files section.
  2. Under Restore & Download, choose Full Backups for the whole account, Home Directory for files, or Databases.
  3. Select the backup with the date you chose above.
  4. To restore one folder, use Change File Selection and tick your site’s folder.
  5. Click Restore and confirm.
  6. Track progress in the Queue; restores run in the background.

Afterwards, check the folder for unfamiliar files newer than the backup date, because restoring selected files may not remove files the attacker added later. If you’re unsure, ask support before restoring over live files.

After the restore: close the hole

The restored copy almost certainly includes the same outdated plugin or theme the attacker used. These steps are not optional:

  1. Update everything right away: WordPress core, plugins and themes.
  2. Delete what you don’t use, including inactive plugins and themes and any “nulled” copies of paid plugins.
  3. Review users and remove any administrator you don’t recognize.
  4. Change every password again: WordPress admins, cPanel, FTP/SFTP, the database user (then update wp-config.php) and email. WordPress.org advises doing this after the site is confirmed clean.
  5. Rotate your security keys (salts) in wp-config.php with fresh values from the official WordPress generator. This logs everyone out, attacker included. Some plugins use these keys to encrypt stored settings, so you may need to re-enter a few API keys.
  6. Turn on two-factor authentication for admins (WordPress needs a plugin for this), and add define( 'DISALLOW_FILE_EDIT', true ); to wp-config.php to disable the dashboard file editor.
  7. Scan again before you call the site clean.

Clearing Google’s warning

A Google warning won’t vanish on its own the moment you fix things. Open the Security Issues report in Search Console and review each issue and its sample URLs. Fix every issue across the whole site; partial fixes don’t count. Then click Request Review and explain what you found and what you did.

According to Google’s Search Console Help, a review can take from a few days to a few weeks; once the site is found clean, Google’s guidance on web.dev says browser and search warnings are removed within 72 hours. Don’t submit until you are sure; a premature request only extends the wait.

Making next time easier

No host or plugin can promise a site will never be hacked, but preparation turns a disaster into a short interruption:

  • Daily backups stored off the site, kept long enough to catch an infection you find late.
  • Regular updates, tested on a staging copy first.
  • Ongoing malware scanning with early alerts.
  • Account isolation so one infected site can’t spread to others.

At Start Bigger, backups run daily with JetBackup, kept for up to 60 days depending on the plan, and hosting customers can restore themselves from cPanel. Plans also include Imunify360 and Monarx malware scanning and CloudLinux account isolation. Details are in our backups policy.

If you’d rather not handle this yourself, our Managed Site service takes care of WordPress updates, backups and security, and we run restores for you when needed, while you keep full access to your WordPress dashboard.

In short

  • Confirm the hack, document it and talk to your host before restoring.
  • Export recent data, then pick a backup from before the first sign of infection, not just before you noticed.
  • Restore files and database from the same date.
  • Straight after: update everything, remove unknown users, change passwords and rotate salts.
  • If Google flagged you, fix everything, then request a review in Search Console.

Frequently asked questions

Is restoring a backup enough to remove a hack?

Not on its own. An older backup usually contains the same weakness the attacker used, such as an outdated plugin. Update everything and change passwords and security keys right after restoring, or the site may be reinfected.

Will I lose new orders and posts when I restore?

Yes. Anything added after the backup date is rolled back. Export recent orders, form entries and new content before restoring, then re-add what you need once you are sure it is clean.

How do I know which backup is clean?

Pick one from before the first sign of compromise, not just before the day you noticed it, because infections usually start earlier. Use the first-detected date in Search Console, file modification dates and your host's malware scan reports as clues.

How long does it take for Google's warning to go away?

After you request a review in the Security Issues report, Google says a review can take from a few days to a few weeks. Google's guidance on web.dev adds that once the site is found clean, browser and search warnings are removed within 72 hours.

How long does Start Bigger keep backups?

Backups run daily with JetBackup, with retention of up to 60 days depending on the plan. Managed Site customers have restores done for them; hosting customers restore themselves from JetBackup in cPanel.

Read next

Security guide

Website Security for Small Business: 7 Layers That Matter

An honest guide to securing a business website: seven layers from the server to your password, who is responsible for each, and what to check today, with no promise of perfect protection.

Domains guide

How to Recover a Domain From a Former Web Developer

Practical steps to get back a domain a former developer or employee registered for you: find the registrant and registrar, gather documents, request a registrant change or transfer code, and prevent it happening again.

Domains guide

Domain Expired? What Happens Next and How to Get It Back

What happens after a domain expires under ICANN rules: the grace period, the redemption period and deletion, plus the recovery steps for each stage and how to stop it happening again.

Ready to start, or have a question first?

We answer on WhatsApp Saturday to Thursday, 9:00 am – 9:00 pm Amman time (GMT+3)

WhatsApp