WordPress hacked: What to do now, step by step

Titelbild: WordPress gehackt: Was du jetzt tun solltest, Schritt für Schritt

If your WordPress site has been hacked, stay calm and work through the steps in order: secure the current state, put the site into maintenance mode, change all passwords and keys, find and remove the malicious code or restore a clean backup, update everything and lock down all access. If customer data is involved, also check your notification duties under the GDPR.

A hacked website is stressful. Suddenly the site redirects to foreign addresses, Google warns visitors about your domain, or users you never created appear in the backend. Anyone who frantically works on five things at once in this situation often makes things worse. That is why you get a clear process here: how to recognize a hack, what matters in the first minutes, how to clean the site and how to stop it from happening again. When your WordPress hacked situation is real, one rule applies above all: understand first, then act.

This guide does not replace advice for your specific case. It does help you make the right decisions, whether you do everything yourself or bring in support.

How do you know your site has been hacked?

Not every hack is visible right away. Many attackers do not want you to notice anything. They use your site in the background to send spam, distribute malware or manipulate search results. You should know these warning signs:

  • The site redirects to foreign or shady addresses, often only on mobile or when visitors come from Google.
  • Google shows the notice "This site may be hacked" in the search results, or Chrome displays a red warning page.
  • There are administrators in the backend that you do not know, or your own permissions have been changed.
  • Plugins or themes have appeared that you never installed.
  • Suddenly Japanese or pharmaceutical page titles that are not yours appear in the search results (the so-called pharma or Japanese keyword hack).
  • Your host shuts the site down or writes to you about spam sending or high server load.
  • The site is unusually slow even though nothing has changed.
  • Files were changed, for example the index.php, the .htaccess or the wp-config.php.
  • You receive emails about password resets that you did not request.

Quick test in three minutes

Before you panic, run a short check. Open your site once in a private window, once on your phone using mobile data and once via a Google result. Then enter site:deine-domain.de into Google and scroll through the results. If pages appear there that you do not recognize, that is a clear warning sign. Also check the "Security issues" section of Google Search Console to see whether Google has already reported something. A combination of several signs is more telling than a single one.

WordPress hacked: featured image with a site hacked warning

Immediate measures: the first 30 minutes

The first steps decide how big the damage becomes. Proceed in this order.

1. Stay calm and do not delete anything

The first impulse is often to delete everything as quickly as possible. Do not do that. The existing files and logs help you find out later how the attacker got in. Without that information you will not close the hole, and the hack will come back.

2. Secure the current state

Now make a complete copy of the files and the database, even if they are infected. This copy is your evidence and your fallback if something goes wrong during the cleanup. Store it separately from the site, ideally on your own computer. How to do this properly is explained in our guide on Create a WordPress backup.

3. Put the site into maintenance mode

As long as the site is infected, you put your visitors at risk. Therefore put it into maintenance mode or block it via the .htaccess for everyone except your own IP address. This protects visitors and prevents Google from picking up more malicious content.

4. Change all access credentials

Immediately change the passwords of:

  • all WordPress users, especially administrators
  • the hosting account and your provider customer area
  • FTP or SFTP access and SSH keys
  • the database user (and enter the new password in the wp-config.php file)
  • your email account, which you can use to reset passwords

Also renew the security keys (salts) in the wp-config.php. This immediately invalidates all existing logins, including the attacker's (repeat this step again once the cleanup is complete).

5. Inform your host

Your host sees things you do not see: access logs, server scans, suspicious processes. Write a short note to support describing what happened. Many providers help with the analysis or provide backups. If in doubt, take a look at our Emergency Recovery Serviceif you do not want to rescue the site yourself.

Infographic: immediate plan for a hacked WordPress site in 6 steps
Immediate plan: get through the hack in 6 steps (click to enlarge)

How did the hacker get in at all?

An attack on WordPress is rarely a coincidence. In the vast majority of cases it is automated programs that search the web for known vulnerabilities. Your site is rarely targeted personally; instead, automated bots find it because a door was left open. The most common entry points are outdated plugins and themes with known vulnerabilities, weak or reused passwords, poorly isolated hosting environments, and tampered software.

Entry point Typical example How common
Outdated plugins and themes A known vulnerability was fixed in an update, you did not update very common
Weak passwords Brute force on wp-login.php using lists of common passwords common
Nulled plugins and themes Pirated copies with a built-in backdoor common
Insecure hosting environment Shared servers where another site was infected occasionally
Stolen credentials A password from a data breach, reused occasionally
Insecure file permissions Write permissions 777 on folders occasionally

Particularly insidious are so-called nulled plugins. Anyone who downloads a premium plugin for free from shady sites often installs a backdoor along with it. The money you save costs you many times over later. You can find more about the mechanisms in the article on WordPress vulnerabilities and in the article on brute force attacks.

Find the cause: check logs and files

Before you clean up, you should roughly know what happened. That saves you from repeating it.

Read access logs

In the hosting panel you can usually find the access logs. Look for suspicious POST requests to files you do not know, for many requests from individual IP addresses, and for access shortly before the time the changes appeared. The modification date of the infected files gives you the timestamp for your search.

Find changed files

Sort the files by modification date. Files with recent timestamps in folders where normally nothing changes are suspicious, such as wp-includes or wp-admin. A very common place for malicious code is the folder wp-content/uploads. Only images, PDFs and similar media should be there, but no .phpfiles. Every PHP file in the uploads is suspicious.

Suspicious patterns in the code

Malicious code often hides behind functions such as base64_decode, eval, gzinflate or str_rot13. These functions also exist in legitimate code, but long, cryptic strings in combination with eval are a strong warning sign.

Remove the malicious code: two ways

There are basically two strategies, and the choice depends on whether you have a clean backup.

Way 1: restore a clean backup

If you have a backup from a point in time before the hack, this is usually the fastest and safest way. What matters is that the backup is really clean. Hackers sometimes sit in a site unnoticed for weeks. If your last backup is two days old but the hack began three weeks ago, you restore the malicious code with it. So go back in time until you are sure. The exact instructions are in the article Restore a WordPress backup.

Before lifting maintenance mode, immediately update everything and change all passwords and salts again, because the original vulnerability the attacker used is still present in the old backup.

Way 2: clean manually

Without a usable backup you have to clean the site by hand. This is laborious but doable:

  1. Download WordPress core, all plugins and the theme fresh from the official sources and overwrite the existing files with them. You check the folder wp-content/uploads and your wp-config.php separately.
  2. Delete all plugins and themes you do not need. Less code means less attack surface.
  3. Search in uploads for .phpfiles and delete them.
  4. Check the .htaccess for foreign redirects and reset it to the standard WordPress version if in doubt.
  5. Check the database for foreign administrators (table wp_users) and injected scripts in posts or options.
  6. Then scan the site with a reliable security scanner such as Wordfence or Sucuri SiteCheck and review the results.

The complete step-by-step guide for this way is summarized in the article Remove WordPress malware zusammengefasst.

If you are unsure

Manual cleaning is error-prone. If you overlook a single backdoor, the site is infected again after a few days. If you are not sure, professional help is worthwhile. At Boudmedia you get our Emergency Recovery Service at a fixed price of $539.

After cleaning: release the site again

Before you make the site public again, go through this list:

  • All user accounts checked and unknown accounts deleted
  • All passwords changed, salts renewed
  • WordPress, plugins and theme up to date
  • Unneeded plugins and themes removed
  • File permissions set (folders 755, files 644, wp-config.php 600 or 640)
  • Scan shows no more findings
  • Two-factor authentication active for administrators
  • Fresh backup created after the cleaning

Lift Google and Chrome warnings

If Google has marked your site as dangerous, you have to request a review. You can do this in Google Search Console under "Security and manual actions". Briefly describe what you have cleaned. The review usually takes a few days. Until then the notice may remain. You can also request the removal of injected spam pages from the index there.

Legal: notification duty and data protection

If personal data may have leaked through your site, for example from contact forms, orders or customer accounts, the GDPR applies. In that case, Article 33 of the GDPR generally requires notifying the competent data protection authority within 72 hours of becoming aware of the breach, provided there is a risk to the rights and freedoms of the individuals affected. Depending on severity you may also have to inform those affected yourself. So document everything: when did you notice the hack, what was affected, what did you do? When in doubt, get legal advice. This is not legal advice, but a reminder not to ignore the question.

How to prevent the next hack

A hack is a warning shot. The good news: with manageable effort you reduce the risk significantly. Our detailed WordPress security checklist goes through all the points. The most important measures at a glance:

Apply updates consistently

Most successful attacks exploit vulnerabilities for which an update has long existed. Update WordPress, plugins and themes promptly, ideally after a backup and a test. With Maintenance for $99 per month we take care of this for you.

Secure the login

Enable two-factor authentication, limit login attempts and use unique, long passwords. You will find seven concrete measures in the article Secure your WordPress login.

Use a firewall

A firewall blocks known attack patterns before they reach WordPress. Which types exist and what they do is explained in the article WordPress firewall. With the Security package for $32 per month you get protection and monitoring from a single source.

Regular backups with an external copy

Backups are your life insurance. They must run automatically, keep several versions and be stored in a different place than the site itself. Our backup service costs $16 per month. Why the 3-2-1 rule helps is something you read in the article about Create a backup.

Less is more

Every additional plugin is additional code and therefore additional attack surface. Remove everything you do not actively use, and stick strictly to well-maintained plugins with regular security updates and good reviews.

What does a hack cost, and what does prevention cost?

The math is quickly done. A hack means downtime, lost inquiries, a damaged ranking and, in the worst case, warning letters or fines. Being listed on blacklists can also cost weeks until the site looks clean again. Prevention, on the other hand, is cheap: security for $32 per month, backups for $16 per month, maintenance for $99 per month. If you book everything together, you pay less than a single emergency costs. And if something does happen, the emergency recovery helps for $539.

Practical example: a hack in real life

A craft business gets in touch on a Monday morning: on mobile, the site suddenly shows ads for online casinos. On the desktop everything looks normal. The owner changes the password first, but the redirect stays. What had happened?

  1. Cause: A contact form plugin had not been updated for eight months. A known vulnerability allowed a file to be uploaded.
  2. Backdoor: In the folder uploads/2026/03/ there was a file named cache.php. It let the attacker execute any code.
  3. Result: The .htaccess was changed so that only mobile visitors coming from Google were redirected. The owner saw none of this on the computer.
  4. Solution: Site locked, backup from the previous month restored, plugin updated, all passwords and salts renewed, firewall activated, Search Console review requested. Duration: a good three hours, plus two days until Google lifted the warning.

The example shows three typical patterns. First: hacks are often only visible to certain visitors. Second: changing a password alone does not help. Third: the trigger is almost always an update that was missing.

The most common mistakes after a hack

  • Treating only the symptom: Removing the redirect but not finding the backdoor behind it.
  • Restoring an old backup without closing the vulnerability: The attacker comes back the same way.
  • Changing only one password: Hosting, FTP, database and email stay open.
  • No documentation: Without notes you later do not know what was affected, and the GDPR duties are hard to prove.
  • Releasing too early: The site goes online before a second scan was clean.
  • Ignoring Google: Without a review request the warning stays for weeks.
  • The same password everywhere: If it comes from a foreign data breach, the new login is useless as long as you reuse it.

Emergency checklist to print out

Step What Done
1 Secure evidence (copy files and database) ☐
2 Put the site into maintenance mode ☐
3 Change all passwords and salts ☐
4 Inform your host ☐
5 Narrow down the cause via logs and files ☐
6 Restore a clean backup or clean manually ☐
7 Update everything, enable firewall and 2FA ☐
8 Second scan, function test ☐
9 Request Google review ☐
10 GDPR check and documentation ☐

What you should tell customers and visitors

Communication is often forgotten in an emergency. If customers could be affected, inform them honestly, briefly and factually: what happened, which data may have been affected, what you have done, what they should do now (for example change their password). Avoid reassurances and speculation. On the site itself, a short note in maintenance mode that the site is temporarily unavailable due to maintenance work is enough. That builds trust and prevents unnecessary calls.

Key terms around hacked sites

Backdoor

A hidden script that lets the attacker get back in later, even after a password change. Backdoors are the reason sites get infected again after a half-hearted cleanup.

Web shell

A program on the server that gives the attacker a user interface: view files, run code, read the database. Web shells often sit in the uploads or are disguised as a plugin file.

Salts and keys

Random strings in the wp-config.php that WordPress uses to secure logins. If they are renewed, all active login sessions become invalid immediately, including the attacker's.

SEO spam

Thousands of injected pages advertising medicines, gambling or counterfeits that show up under your domain in the Google index. They damage your reputation and your ranking.

Blacklist

Lists from security services and browsers of dangerous sites. If you land on them, browsers show warning pages and emails from your domain are more often sorted into spam.

Maintenance mode

A state in which visitors only see a notice page while you work. It protects visitors and prevents data from changing.

The key points in brief

  • Stay calm, secure the state, put the site into maintenance mode.
  • Change all passwords and keys.
  • Find the cause, then clean or restore a clean backup.
  • Update everything, secure login and firewall.
  • Request Google review and check GDPR duties.

The best protection is preparation: current backups, updates and a secured login.

Conclusion

If your WordPress site has been hacked, a calm, structured approach is half the battle: secure, lock down, change credentials, find the cause, clean or restore, close the vulnerability, inform Google. You have the biggest lever beforehand, with updates, strong login, firewall and backups. If you do not want to do this yourself, we are happy to take it over, from Sicherheitsschutz to emergency help. Simply get in touch via the Contact page.

Frequently asked questions about hacked WordPress sites

How do I notice that my WordPress site was hacked?

Typical signs are unexpected redirects, security warnings from Google or Chrome, unknown administrators, suspicious PHP files in the uploads folder, unusual server load, and unfamiliar spam pages in the search results for your domain. Several signs at once are a strong indication.

Can I rescue a hacked WordPress site myself?

Yes, if you have a clean backup or know your way around files and the database. Without experience you easily overlook backdoors. Then professional help is cheaper than a second hack.

How long does it take to clean a hacked site?

With a clean backup often only a few hours. A manual cleanup takes half a day to a full day depending on scope. Getting back into Google can take a few additional days.

Do I have to report the hack?

If personal data may be affected, yes: to the data protection authority within 72 hours if there is a risk to the people concerned. Check this case by case and document everything.

Does a hack harm my Google ranking?

Yes, it can. Google shows warnings or removes pages from the index. After the cleanup and the review via Search Console the ranking usually recovers, but it can take a few weeks.

Is it enough to change the password?

No. The password is only one part. If hidden backdoors remain in your code or database, the attacker will regain access anyway. You must remove all malicious code, renew your security salts, and close the original vulnerability.

How often should I make a backup?

For sites with daily changes daily, otherwise at least weekly, each time with several versions kept and a copy outside your server.

What does help at Boudmedia cost?

The emergency recovery costs $539. If only a single error has to be fixed, the Error Fix service for $129 is often enough. We explain more error patterns, for example, in the article on the critical error.

Can my host help me?

Often yes. Many providers provide backups, show you access logs or remove infections on request. The quality of help varies a lot, though. So ask early how far support goes.

How do I know the backdoor is really gone?

You are only absolutely sure if you have reloaded all replaceable files, checked uploads and configuration and run two scans without findings. Also watch the site for two weeks for new changes.

Amine Boudounite

About the author

Amine Boudounite

Amin is the founder of Boudmedia and builds WordPress websites, online shops and business sites. In his guides he explains technology, loading speed and visibility so that you can apply them without any prior knowledge.

Contents
Help with your WordPress site?

We take a free look and tell you honestly what is needed and what it costs.

Share post

You might also be interested in

WordPress Backend Slow? How to Speed Up the Dashboard

Wenn das WordPress-Dashboard träge ist: Ursachen und Maßnahmen im Überblick.

Finding and Fixing a WordPress Plugin Conflict

So findest du den Plugin-Konflikt in WordPress und löst ihn ohne Datenverlust.

Google Shopping with WooCommerce: How to Make Your Feed Error-Free

Wie ein sauberer Produktfeed für Google Shopping aussieht und welche Fehler du in WooCommerce vermeiden kannst.

Problems with your WordPress site? We fix them at a fixed price.

  • Free check of your site
  • Honest assessment of what is needed
  • Fixed price before we start
  • Reply within 24 hours on business days
Scroll to Top