WORDPRESS SECURITY
My WordPress Website Has Been Hacked - What Should I Do?
Has your WordPress website been hacked? Learn how to protect visitors, secure your accounts, remove malware and recover your website safely.
My WordPress Website Has Been Hacked - What Should I Do?
A practical guide to recovering a compromised WordPress website and protecting your business.
Discovering that your WordPress website has been hacked can be alarming, particularly when your business depends on that website to attract customers, generate enquiries or process orders.
Perhaps your website has started redirecting visitors to suspicious pages. Maybe Google is displaying a security warning, your hosting provider has suspended your account, or an unfamiliar administrator has appeared in WordPress.
Whatever the warning signs, one thing is important: the actions you take immediately after discovering a compromise can significantly affect your recovery.
A hacked WordPress website doesn't necessarily mean everything is lost. However, simply changing your password or deleting a suspicious file may not be enough to resolve the problem.
In this guide, we'll explain what to do when your WordPress website has been hacked, how to limit further damage, and what needs to happen before your website can safely return to normal operation.
Before making major changes: preserve access, take a backup or snapshot where possible, and record what you're seeing. Randomly deleting files can make recovery harder without removing the underlying compromise.
Step 1: Prevent Further Damage
Your first priority should be protecting your website's visitors, customers and business information.
A compromised website may be used to distribute malware, display fraudulent content, redirect visitors to malicious websites or collect information without authorization.
If your website is actively exposing visitors to harmful content, consider temporarily restricting public access while the incident is investigated.
Contact your hosting provider and explain that you suspect your WordPress installation has been compromised.
Your hosting provider may be able to help you isolate the affected website, preserve relevant information and prevent further malicious activity.
For an emergency interruption expected to last only a day or two, a properly configured maintenance page using an HTTP 503 response can communicate that the website is temporarily unavailable.
Avoid permanently removing your website or changing its search-indexing settings without understanding the consequences.
Important: If you operate an online store and suspect that checkout functionality has been compromised, stop accepting payments through the affected website until the payment process has been verified as safe.
Protecting your customers takes priority over keeping a compromised website online.
Step 2: Preserve a Backup Before Cleaning Anything
One of the most common mistakes during an incident is immediately deleting suspicious files.
Although removing malware is essential, deleting files without understanding the compromise can destroy valuable evidence or damage the website further.
Before attempting repairs, preserve a copy of the affected website.
A complete WordPress backup generally includes both the website's files and its database.
The files contain your WordPress installation, themes, plugins, configuration and uploaded media.
The database contains important information such as pages, posts, settings and user records.
Where available, preserve relevant server logs and record the time you first discovered the problem.
Store the backup securely and separately from the live website.
Remember that a backup created after a compromise may contain malicious code. It should be retained for investigation, not automatically treated as a clean restoration point.
If your website is actively harming visitors, containment should happen immediately, with evidence preservation coordinated as safely as possible.
Step 3: Secure Your Website Accounts
Attackers sometimes gain access to WordPress through compromised credentials rather than vulnerabilities in WordPress itself.
Changing your WordPress administrator password is an important step, but it may not be sufficient.
Depending on how your website is configured, other credentials may also need to be changed.
These can include WordPress administrator accounts, hosting control-panel credentials, database passwords, SFTP or SSH credentials and relevant third-party integration secrets.
Use a trusted device when changing passwords. If your computer may be infected with malware, investigate that possibility before using it to access sensitive accounts.
You should also review the WordPress user list for unfamiliar accounts or unauthorized changes to existing users.
Remove unauthorized access, require strong and unique passwords, and enable multi-factor authentication wherever supported.
WordPress authentication keys and salts should also be rotated as part of the recovery process to invalidate existing login sessions.
Remember: Securing your accounts helps prevent unauthorized access, but it does not automatically remove malware already present on your website.
Step 4: Identify How Your Website Was Compromised
Before declaring a website clean, you need to understand what happened.
WordPress websites can be compromised in several ways.
Common possibilities include vulnerable plugins or themes, outdated software, stolen credentials, malicious software installed on an administrator's computer, and weaknesses in the hosting environment.
Attackers may modify legitimate files, create unauthorized administrator accounts or install hidden backdoors that allow them to regain access later.
An investigation should examine the WordPress installation, installed plugins, themes, user accounts, database and relevant hosting environment.
Particular attention may be required for unexpected PHP files, modified configuration files, unfamiliar scheduled tasks and malicious code embedded in website content.
Some infections are deliberately designed to remain hidden from website administrators.
For example, a malicious redirect might only activate when someone arrives from a search engine, while the website appears normal to its owner.
This is why simply opening your homepage and seeing that everything looks normal is not proof that the infection has been removed.
A proper investigation aims to identify both the malicious changes and the mechanism that allowed them to happen.
Step 5: Remove Malware and Hidden Backdoors
Once the compromise has been investigated and the necessary evidence preserved, remediation can begin.
The exact cleanup process depends on the infection.
In some cases, compromised WordPress core files can be replaced with verified copies obtained from official sources.
In other cases, the infection may involve plugin files, theme files, website configuration, database content or malicious scripts hidden elsewhere in the hosting environment.
Removing visible malware is only part of the process.
Attackers may install backdoors that provide continued access even after the original infection appears to have disappeared.
If these backdoors remain, the website may become infected again.
This is why deleting one suspicious file, installing a security plugin or running a single malware scan cannot guarantee that a website is safe.
A successful cleanup must address the infection, unauthorized access and any persistence mechanisms discovered during the investigation.
If you are unfamiliar with PHP, database administration or web-server security, professional assistance is strongly recommended.
Incorrectly modifying website files or database records can cause additional damage and make recovery more difficult.
Step 6: Fix the Vulnerability That Allowed the Attack
Removing malicious code without addressing the original security weakness can leave your website exposed to another compromise.
Once the affected software and entry point have been identified, appropriate corrective action should be taken.
This may involve updating WordPress, replacing vulnerable plugins, removing abandoned themes, correcting insecure permissions or securing compromised accounts.
Unnecessary plugins and themes should also be reviewed and removed where appropriate.
If an extension has a known vulnerability and no secure version is available, it may need to be disabled or replaced with a safer alternative.
Updates should be performed carefully, with suitable backups and compatibility testing where necessary.
The goal is not simply to restore your website's appearance.
The goal is to prevent the same attack from succeeding again.
Step 7: Check Google Search Console
Website compromises can affect more than your website's functionality.
Attackers sometimes inject spam pages, hidden links or malicious redirects intended to manipulate search engines.
In other cases, Google may identify potentially harmful content and display security warnings to visitors.
If your website has been compromised, review its status in Google Search Console.
Open the Security Issues report and check whether Google has identified any problems.
If security issues are reported, investigate the affected areas and ensure the problems have been addressed throughout the website.
Once the necessary remediation is complete, you can request a review through Google Search Console.
Google may take some time to review your website and update its security status.
A successful malware cleanup does not necessarily mean warnings or search-related damage will disappear immediately.
Continue monitoring your website and its search performance after recovery.
Step 8: Determine Whether Customer Information Was Affected
If your WordPress website collects customer information, an incident may require additional investigation.
This is especially important for membership websites, online stores and businesses that process sensitive customer enquiries.
Depending on the nature of the compromise, attackers may have gained access to information stored in the website's database or submitted through website forms.
However, a hacked website does not automatically mean customer information was stolen.
The investigation should determine what systems were accessed, what information may have been exposed, and whether any unauthorized extraction occurred.
Where personal information or payment systems may have been affected, seek appropriate technical, legal or payment-provider guidance.
Businesses may have obligations to notify authorities, customers or other affected parties depending on their location, the information involved and applicable regulations.
These obligations should be assessed promptly rather than postponed until every technical detail is known.
Step 9: Verify That Your Website Is Safe Before Reopening
Before returning your website to normal operation, perform appropriate verification.
Confirm that unauthorized accounts have been removed, compromised components have been repaired or replaced, relevant credentials have been secured, and identified vulnerabilities have been addressed.
The website should also be checked for suspicious redirects, malicious scripts, unexpected pages and abnormal behavior.
Important business functionality must be tested.
For example, an online store should verify that its checkout and payment integrations function correctly and securely.
Contact forms, administrative access and other essential website features should also be tested.
Where appropriate, repeat malware scans and review server logs for signs of continued malicious activity.
No security assessment can guarantee that future incidents are impossible, but a systematic recovery process can substantially reduce the risk of reinfection.
Can I Just Restore My WordPress Website From a Backup?
Restoring a previously known-clean backup can be an effective part of recovery, but it is not always a complete solution.
If the backup was created after the compromise, it may already contain malicious files or altered database records.
Even an older clean backup may restore vulnerable plugins, insecure configuration or compromised credentials.
For this reason, backups should be verified and restored alongside appropriate security remediation.
Restoring a backup is not the same as resolving the cause of a security incident.
What if I Cannot Access My WordPress Dashboard?
Losing access to the WordPress administration area does not necessarily mean your website cannot be recovered.
An attacker may have changed your password, modified your administrator account or interfered with the login process.
If you still control your hosting account, your hosting provider or a qualified WordPress security specialist may be able to help you investigate and recover access.
Avoid repeatedly attempting random repairs or installing unknown recovery tools.
Your priority should be regaining control through a trusted recovery method while preserving the information needed to investigate the incident.
How Long Does WordPress Malware Removal Take?
The time required depends on the extent of the compromise.
A relatively limited infection may require fewer changes than an incident involving multiple websites, compromised hosting credentials or extensive database manipulation.
Some incidents also require additional investigation to identify how the attacker gained access.
A responsible recovery process should prioritize thorough remediation and verification rather than simply getting the homepage working again.
Need Help Recovering a Hacked WordPress Website?
If your WordPress website has been compromised, you don't have to investigate and resolve the incident alone.
SecureMyWP provides professional WordPress malware removal and incident recovery services for businesses and website owners.
Our incident-recovery approach focuses on identifying malicious activity, removing compromised components, investigating unauthorized access and implementing appropriate security improvements.
We understand that a compromised website can disrupt business operations, damage customer confidence and create uncertainty about what to do next.
Our objective is to help you work towards a secure, functional website with a clearer understanding of the incident.
Standard WordPress Incident Recovery — $199
More complex incidents may require an individually assessed quotation.
Get Professional WordPress Recovery Assistance
If you suspect your WordPress website has been hacked, contact SecureMyWP to discuss the problem and request assistance.
SecureMyWP — WordPress Security & Incident Recovery
Visit securemywp.com to get started.
Final Thoughts
Discovering that your WordPress website has been hacked is serious, but a methodical response can make recovery more manageable.
The most important actions are to contain the threat, preserve relevant information, secure access, investigate the compromise and remove malicious code.
Once the website has been cleaned, the underlying security weaknesses must also be addressed.
A website that looks normal is not necessarily a website that has been fully secured.
Effective recovery means more than removing malware. It means addressing how the compromise happened and reducing the risk of it happening again.