restore hacked WooCommerce site — cover illustration
← Blog

How to restore a hacked WooCommerce site without losing orders

Updated Ivan Pantić

When a regular website is hacked, the damage is unpleasant. When a shop is hacked, the damage is measured in hours. Every hour the shop is down, or up but redirecting customers to someone else's pages, means lost orders, customers going to competitors and risk to the data of those who bought from you.

So after a hack, shop owners have one wish: get the shop working again as fast as possible. That's understandable, but it's exactly in that rush that the most expensive mistakes happen. The most common one is restoring an old backup, after which the shop works but the last few days of orders are gone, and the infection comes back within a week.

In this article we describe how to restore a hacked WooCommerce site so that you keep your orders, customers and data, and the problem doesn't come back.

In short: to restore a hacked WooCommerce site, follow this order: stop the damage without wiping the database, preserve the orders, check the payment page, clean the site instead of blindly restoring a backup, close the entry point, rotate payment keys, and only then reopen the shop. Urgent intervention for shops: from €150.

Request urgent help → · +381 65 402 5000

Why a shop is different from a regular site

Why a shop is different from a regular

On a regular site, content rarely changes. Pages and articles stay the same for days and weeks, so a backup from ten days ago contains almost everything that matters.

On a shop, the database changes with every order. New orders, new customers, stock changes, payments, refunds. A backup from ten days ago means ten days of orders that don't exist. These aren't just numbers in a report, they're customers who paid and are waiting for goods, invoices, records for your accountant.

Second, a shop processes customer data: names, addresses, phone numbers, emails, and with some payment methods the data customers type on the payment page. That makes a shop a special target. A brochure site is useful to an attacker for spam and redirects; a shop can bring them data worth money.

Third, a shop is connected to external services: the payment processor, the courier, the invoicing system. If the attacker had access to the site, they had access to the keys for those services too.

Because of all three, restoring a WooCommerce shop has several steps you can skip on a regular site.

Step 1: Stop the damage, but don't shut everything down

The first instinct is to shut the shop down. Sometimes that's right, but how you do it matters.

If the shop is redirecting customers or showing a fake payment page, stop the damage immediately. The best way is maintenance mode, so customers see a message that the shop is temporarily unavailable, not someone else's page.

Don't delete files or restore a backup at this point. Maintenance mode stops the damage to customers without destroying evidence or data.

Don't close the hosting account or move the site to another server. Moving an infected shop just moves the problem, and along the way you lose the logs that show how the attacker got in.

Change passwords for WordPress admin, hosting and FTP, if you still have access.

What if you don't have admin access

With shops it often happens that the owner can't get into WordPress after a hack. The password was changed, the admin account deleted, or the login page redirects to another site.

That doesn't mean the shop is lost. Orders, customers and products are in the database, and the database is on your hosting, which you still have access to. If you've lost hosting access too, the first step is to recover it through your host's support, with proof of ownership.

Once you have hosting access, everything in this article can be done through files and the database, without entering admin. Don't reset the whole hosting account or reinstall WordPress to "get access back", because that can wipe exactly the data you're trying to save.

Step 2: Preserve orders and customers

Step 2: Preserve orders and customers

Before any work on the site, make a full copy of the files and database, as they are, infection included. This copy contains all orders up to the moment of the hack, and they exist nowhere else.

In addition, export recent orders to a separate file from WooCommerce admin, if it's accessible. That's your record if something goes wrong: you know who ordered what and whether they paid.

If admin isn't accessible, the database copy is enough. Orders can be extracted from it later.

Step 3: Check the payment page

This step must never be skipped on a shop. Before asking how to restore the shop, you need to know whether customer data was at risk.

Attackers on shops often inject a script that copies what the customer types on the payment page and sends it to an external server. The shop keeps working completely normally. Orders come in, payments go through, and nobody notices anything until customers start reporting card fraud. We describe this attack in detail in card skimming on a WooCommerce store.

Signs the payment page is compromised:

  • the checkout page loads a script from an unknown domain,
  • the card entry form looks different than before, or appears on your site even though you use an external payment processor,
  • customers report strange transactions after buying from you,
  • the payment processor or a bank contacts you about fraud.

If there's even the slightest suspicion, priorities change. Besides cleanup, you then also need to think about notifying the payment processor and customers. More on that in step 7.

Step 4: Clean, instead of blindly restoring a backup

This is the key step where the biggest mistake is made.

Restoring a backup looks like the fastest way: pick a version from a few days ago, restore it, and the shop works. The problem is threefold.

First, you lose orders. Everything after the backup date disappears. Customers who paid have no order in the system.

Second, the backup may already be infected. If you don't know exactly when the infection started, and hardly anyone does, you're restoring a version that already contains a backdoor. Attackers often leave a spare entrance weeks before they activate the visible part of the attack. We cover this scenario in restoring a site from a backup after a hack.

Third, the entrance stays open. Even if the backup is clean, the vulnerability the attacker used is still there. The same attack repeats.

So for shops the rule is: clean the current state, don't restore an old one. Cleanup keeps all orders, customers and settings and removes only what doesn't belong on the site.

Cleanup covers:

  • comparing core files with the official version and replacing modified ones,
  • checking themes and plugins, especially those related to payment and checkout,
  • searching for backdoor files in uploads, mu-plugins and other hidden places,
  • reviewing the database: options, content, users, scheduled tasks,
  • removing fake administrators,
  • removing malicious scheduled tasks that bring the infection back.

How hidden entrances are found is explained in how to find a WordPress backdoor. A real example of a shop cleanup is in hacked WooCommerce store: how we cleaned it up.

When a backup does make sense

A backup isn't the enemy, it's a tool. It makes sense when:

  • you know exactly when the infection started and have a backup older than that date,
  • you export orders from the backup date until today and restore them manually,
  • after restoring, you close the entry point and check that the backup contains no backdoor.

In practice that's rarely simpler than cleanup, but for some cases it's the right choice. The decision depends on the specific situation, not a general rule.

How to check that orders are complete

After cleanup, before getting back to normal work, compare the orders in the shop with other sources:

  • the payment processor's report for the same period, every successful payment should have an order,
  • the courier's records, every shipped parcel should have an order,
  • the order export you made in step 2.

If there's a difference anywhere, now is the time to fix it, while the information is fresh. A customer who paid but whose order is missing will get in touch, but it's much better if you contact them first.

This comparison is also useful as proof that the attacker didn't alter orders, such as shipping addresses or amounts, which happens in some shop attacks.

Step 5: Close the entry point

Step 5: Close the entry point

Once the shop is clean, close the path the attacker used:

  • update WordPress, WooCommerce, the theme and all plugins,
  • remove plugins you don't use, especially old payment, shipping or product import plugins,
  • replace pirated (nulled) themes and plugins with legitimate versions,
  • check who has administrator access, including former collaborators and agencies,
  • turn on two-factor login for all administrators and shop managers,
  • invalidate all active sessions and change security keys.

The most common entry points on shops are outdated plugins, pirated plugins and accounts of former collaborators that were never disabled.

Step 6: Rotate keys and passwords for external services

This is the step most often forgotten on shops. If the attacker had access to the site, they could also see the keys connecting the shop to external services.

Replace:

  • the payment processor's API keys,
  • keys for couriers and shipment tracking systems,
  • keys for invoicing and accounting systems,
  • SMTP passwords, i.e. for sending email from the shop,
  • any other integration that has a key or password saved in the site settings.

Rotating keys usually takes a few minutes per service and closes off the possibility of the attacker using your accounts even after the site is clean.

Step 7: Decide who needs to be notified

Step 7: Decide who needs to be notified

If there's a suspicion that customer data was at risk, it's not only a technical question.

Payment processor. If you suspect data was stolen from the payment page, notify the payment processor. They have their own procedures and can tell you what's next.

Customers. A short, honest notice usually goes over better than silence. Customers who find out from their bank rather than from you rarely come back.

Supervisory authority. A personal data breach may carry a legal obligation to report it. We cover this separately in our article on data breach notification after a hack. If in doubt, consult a lawyer.

Step 8: Check before reopening

Before you turn off maintenance mode, go through this list:

  1. The remote website check is clean, from a computer and a phone.
  2. The payment page loads only scripts you recognize.
  3. Place a test order from start to finish: product, cart, checkout, payment, confirmation email.
  4. Check that orders from before the hack are in place.
  5. The administrator list contains only people you know.
  6. If there was a Google warning, the review request has been submitted. Details are in website blacklisted by Google.

Only when every item passes does the shop reopen.

How to talk to customers

If the shop was down or customers noticed something unusual, communication is part of recovery. A few rules help.

Be short and specific. Customers don't want a technical explanation, they want answers to three questions: what happened, does it affect them, and what should they do.

Don't downplay or exaggerate. "We had a technical problem" sounds like an excuse if customers noticed redirects. "All your data was stolen" is wrong if you don't know that. Say what you know.

Give specific advice. If card data may have been stolen at checkout, advise customers who bought during a certain period to watch their statements and contact their bank if they see unknown transactions.

Leave a contact. A customer with a question should know who to write to.

An example of a short message you can adapt:

Dear customer, between [date] and [date] our shop had a security incident. The problem has been resolved and the shop is operating safely again. If you paid by card during that period, we recommend checking your statement and contacting your bank if you notice unknown transactions. We're available for any questions at [contact]. We apologize for the inconvenience.

Before sending such a message, if personal data is involved, it's a good idea to consult a lawyer on obligations and wording.

The most common entry points on WooCommerce shops

The most common entry points on shops

Shops have a few specific weak spots that are less common on regular sites.

Payment, shipping and product import plugins. A shop often has a dozen plugins dealing with orders and data. Some of them are less well known, maintained by a small team, and get patches more slowly.

Pirated premium shop themes. Shop themes are often paid and expensive, so the temptation to download them free is big. Such versions very often contain a backdoor from day one.

Shop manager accounts. Shops have more people with access: staff handling orders, accountants, external collaborators. Every account with a weak password is an entrance.

Old copies of the site. A test version of the shop left in a subfolder on the same hosting, never updated, is often the source of an infection that spreads to the main shop.

The first 30 days after restoring

Once the shop is working again, a period of extra attention follows.

  • In the first week, check the administrator list daily and run a remote check.
  • Watch orders and customer reports. An unusually high number of failed payments or complaints is a signal.
  • Watch Search Console for security notifications.
  • Don't postpone updates. The site is probably still on automated scripts' lists.
  • Set up file monitoring. A new PHP file in the uploads folder a few days after cleanup is a clear sign something was missed.

For this period, automated monitoring makes the most sense, because a manual check can easily miss the very day something happens.

How long does it take to restore a hacked WooCommerce site

How long does it take to a

For most small and medium shops, restoring a hacked WooCommerce site to working order takes from a few hours to a day or two, depending on database size and how deep the infection goes. The longest cases are those where the shop was already restored once from an infected backup, so the infection has several layers.

What takes longer than the cleanup itself is recovery on the outside: removing a Google warning, if there was one, and regaining customer trust. That's why the difference between a thorough and a quick job is biggest with shops. A second outage from the same infection costs more than the first.

The most expensive mistakes

Restoring a backup without exporting orders. The fastest way to lose orders and money.

Reopening without checking the checkout. The shop works, and the data-stealing script keeps sending customer data.

Forgotten API keys. The site is clean, but the attacker still has access to the payment processor or mail server.

Moving to a new host in a panic. The problem travels with the site, and the logs stay on the old server.

Staying silent with customers. If their data was at risk, customers will find out. The only question is whether from you or from their bank.

How much does it cost

For shops we recommend the Emergency Response package, from €150: emergency support non-stop, a deep cleanup of files and database, closing known holes and a control check to see whether the signal has returned. If the shop can wait in the regular queue, there's Standard Incident, from €100. We confirm the exact amount after a short assessment, before work begins.

After restoring, for shops we recommend maintenance from €35/month: updates, scheduled database backups, uptime and security monitoring with alerts. For a shop, one day of downtime often costs more than a year of maintenance.

A shop that isn't working loses money every hour

restore hacked WooCommerce site — closing section illustration

If your shop has been hacked, get in touch right away. Send the address and a short description of what's happening. You'll get an assessment, a plan and a price before anything starts.

Request urgent help → · +381 65 402 5000 · or start with a free website check


Questions

Frequent questions

Short answers with this article. If your question is not here, write to us via contact.

Will I lose orders?

You shouldn't, if the shop is cleaned instead of restored from an old backup. A database copy with all orders is made before any work.

Do I have to close the shop while the cleanup is under way?

If the shop is redirecting customers or there's a suspicion of data theft at checkout, yes, temporarily. If the infection is visible only to Google, the shop can sometimes stay open during cleanup. It depends on the case.

Do I have to notify customers?

If there's a suspicion that customer data was at risk, probably yes. For legal obligations, consult a lawyer.

Can my host restore the shop instead of me?

The host can restore a backup, but that doesn't solve orders since the backup date, a backdoor in the backup or the open entrance.

How quickly can you start?

Urgent cases go ahead of regular requests; emergency support is available non-stop.

Should I change payment processors after a hack?

Not necessarily. The problem isn't the processor, it's the site. It's enough to rotate the API keys and check that the payment page doesn't load foreign scripts. If the processor contacts you, cooperate and give them the information they ask for.

What if the infection comes back after a few days?

That's almost always a sign a spare entrance or malicious scheduled task was left behind. That's why there's a control check after cleanup. More in infection returns after cleanup.

Not sure if your site has been hacked?

Run the free check: security, SEO and AI scores. Detailed findings unlock when you enter your email.

Check my site