Quick answer: If a WordPress website may be infected, first preserve evidence and contact the hosting provider or a qualified security specialist. Restrict harmful activity if visitors are at risk, secure all access points from a clean device, identify the entry point, inspect files and database content, remove malicious code, update vulnerable software and restore only from a verified clean backup. Changing the WordPress password or deleting one suspicious file is not a complete malware cleanup.
A hacked website can show obvious symptoms such as spam pages and redirects, or remain visually normal while malicious code runs in the background. It may send spam email, inject links, create administrator accounts, redirect mobile visitors or expose customer information. This guide explains a careful response for small business WordPress sites. It is not a substitute for forensic incident response on a compromised server, but it gives owners a structured way to protect the business, work with the host and verify that the site is safe to return to normal operation.

What is WordPress malware?
Malware is software or code placed on a website without authorization to perform harmful or unwanted actions. On a WordPress installation it may appear as an altered PHP file, injected JavaScript, a malicious plugin, a modified theme, a database record, a scheduled task or a compromised administrator account. Some malicious code is designed to redirect visitors or display spam, while other code creates hidden access for an attacker or attempts to infect other websites.
Not every unfamiliar file is malware. WordPress, plugins, themes and hosting tools create legitimate files, caches and temporary data. A filename that looks random may be a normal cache artifact, while a familiar filename can be modified maliciously. Do not delete files based only on their name or location. Compare them with clean official versions, review timestamps and logs, and ask a qualified person to investigate if you cannot establish what the file does.
Common signs that a WordPress website may be hacked
Watch for unexpected redirects, browser security warnings, unfamiliar administrator accounts, unknown plugins, spam pages in search results, changed homepage content, strange pop-ups or a sudden increase in outgoing email. The hosting provider may suspend the account after detecting malware or excessive resource use. Search Console may report security issues. A website can also become unusually slow, although performance problems have many possible causes and should not be treated as proof of infection without further evidence.
Check the website from more than one device and browser, including a private browser window. Some malicious scripts behave differently for logged-in administrators, desktop visitors or users arriving from search engines. Review hosting alerts and access logs if available. Note the first time the symptom appeared, which pages were affected and whether a recent plugin update, account change or migration preceded it. This timeline helps narrow the investigation.
What to do first when you suspect malware
Do not immediately reinstall random plugins, delete unfamiliar files or restore the latest backup. Those actions may erase evidence, leave the entry point open or reintroduce infected code. Contact your host and explain the observed behavior. Ask whether the provider has detected a specific file, account, process or outbound connection. If customers may be exposed to malicious content, ask whether the site should be temporarily restricted while the investigation begins.
Preserve relevant server logs, security alerts and a copy of the current site state where it is safe and practical to do so. Do not make the infected site more public by sharing a direct link to a malicious page. Record the time, symptom and action taken. If the site processes payments or stores personal information, involve the business owner and follow the applicable incident and privacy procedures. The goal is to contain the risk while keeping enough evidence to understand what happened.
Step 1: Secure every access point
A WordPress compromise may involve more than the dashboard. Review the hosting control panel, SFTP or SSH accounts, database users, domain registrar, DNS provider, business email and third-party services connected to the website. Change credentials from a clean device, not from a computer that may itself be infected. Use unique passwords and enable multi-factor authentication wherever it is available. If an attacker still controls the hosting or email account, changing only the WordPress password may not stop them from returning.
Review administrator accounts and active sessions where the available tools support it. Record unfamiliar accounts before removing them so the investigator can understand when and how access was created. Remove access for former contractors and rotate shared credentials. If the same password was reused elsewhere, change it on those services too. Do not send passwords or API keys through ordinary email or include them in screenshots shared with support.
Step 2: Ask the host to check the server environment
Hosting support can often see information that is not visible in the WordPress dashboard, including server logs, file ownership, account isolation, malware scanner results and suspicious processes. Ask whether the infection is limited to one WordPress installation or whether other directories or accounts may be affected. If multiple websites share one hosting account, review all of them because a compromised site can sometimes become a route to other installations.
Request the exact file paths, timestamps and detection names reported by the host. Ask whether the provider has isolated the account, blocked outbound email or disabled a process. If the host has suspended the site, understand what is needed to restore service and whether a clean backup exists. Keep the support ticket reference and timeline. A host’s automated scan is useful evidence, but a clean scan does not prove that every backdoor or database injection has been removed.
Step 3: Identify the likely entry point
Review recent changes to plugins, themes, WordPress core, administrator accounts and hosting access. Look for extensions that were abandoned, downloaded from unofficial sources or installed shortly before the first symptom. Check whether a staff member clicked a phishing link or shared credentials. Review file modification timestamps, login history and server logs around the incident window. The purpose is not to blame an individual; it is to identify the route that allowed the attacker to make changes.
Common entry points include outdated software with a known vulnerability, stolen credentials, insecure file uploads, compromised hosting accounts and vulnerable third-party integrations. An incident can have more than one cause. If the exact entry point cannot be identified, treat the site as at risk until the installation and surrounding accounts have been secured. Removing the visible malicious code without fixing the weakness may lead to reinfection.
Step 4: Inspect WordPress core files
WordPress core files can be compared with clean files from the official WordPress release. A developer or security specialist can verify checksums or replace core files with a clean copy while preserving the configuration and content directories. Do not overwrite files blindly on a live site before making a forensic copy and confirming which version is installed. Custom modifications to core files should not be used as a normal development practice because they complicate updates and security verification.
Pay attention to unexpected PHP files in directories where executable code should not normally appear, modified index files, unfamiliar code in wp-config.php and changes to core files. A filename that begins with a dot or uses random characters is not automatically malicious, but it deserves investigation if it was not created by a known tool. Ask the host or developer to review file ownership and permissions as well as the content itself.
Step 5: Review plugins and themes
Make a list of every installed plugin and theme, including inactive items. Identify the source, version and maintenance status of each component. Remove pirated or untrusted copies and replace abandoned extensions with maintained alternatives. If a plugin is required for a critical business workflow, find a supported version or an alternative before removing it. Keep a record of the components removed and why they were considered unsafe.
Reinstall clean copies from the official WordPress directory or the genuine vendor account rather than trusting files from the compromised server. Check custom code and child themes separately because a legitimate plugin can coexist with an injected file. After reinstalling, update software and test the pages that depend on it. If the site uses Elementor, WooCommerce or custom integrations, verify the complete customer journey rather than checking only whether the homepage loads.
Step 6: Inspect the WordPress database
Malicious content can be stored in the database rather than in a visible PHP file. Check for unknown administrator accounts, suspicious options, injected scripts in posts or widgets, unexpected redirects and spam content. Review scheduled tasks and plugin settings where relevant. A database export can be searched and compared, but do not run destructive SQL queries without a verified backup and a clear understanding of the affected records.
WordPress and plugins often store serialized values, structured settings and encoded content. Blind search-and-replace can corrupt those records. Use WordPress-aware tools or a qualified developer to inspect and clean the database. After changes, verify the affected pages and settings. If the site uses a page builder, inspect its content storage carefully because layouts and widgets may include markup that is not obvious in a plain text view.
Step 7: Check scheduled tasks, redirects and hidden access
Attackers may create scheduled tasks that reinsert malicious code after a cleanup. Review WordPress cron events and server-level cron jobs for tasks the business does not recognize. Inspect redirects in the hosting panel, .htaccess, web server configuration and relevant plugins. Check for unknown administrator accounts, application passwords, API keys and suspicious drop-in files. The exact locations vary by hosting environment, so involve the provider if you do not know how the server is configured.
Do not remove a scheduled task or rewrite server rules simply because it looks unfamiliar. Caching, backup and security tools create legitimate tasks and configuration. Identify the owner and purpose first, then remove only confirmed malicious entries. After cleanup, monitor the same locations for reappearance. If a malicious file returns, the original entry point or another persistence mechanism may still be active.
Step 8: Decide whether to clean or restore from backup
A clean restore can be faster and more reliable than manually repairing a heavily compromised site, but only if the selected backup predates the infection and contains no malicious code. Confirm the backup timestamp, source and contents. If the infection may have been present for weeks, the newest backup may already be compromised. Consider a clean rebuild if the site has many unknown modifications, the entry point cannot be found or the integrity of the database is uncertain.
For a smaller issue, a specialist may be able to remove malicious code and reinstall clean software while preserving current content. The choice depends on the scope, business data and available restore points. Before restoring, preserve recent orders, bookings or enquiries where possible. Do not overwrite a live store without a plan for transactions that occurred after the backup was taken. For a step-by-step backup process, see the WordPress backup and restore guide.
Step 9: Test the cleaned website before reopening it
Restore or clean the site in a controlled environment first. Open the homepage, service pages, blog posts, contact page and any pages that previously showed suspicious behavior. Test navigation, forms, login, search and checkout. Check that the browser does not show security warnings and that the site no longer redirects visitors to unrelated destinations. Review the database and files again after testing to make sure suspicious content has not reappeared.
Check outgoing email, scheduled tasks, cron jobs, API connections and user permissions. Re-enable integrations only after confirming their credentials and purpose. Update WordPress, themes and plugins to supported versions. Clear relevant caches and review CDN or firewall rules. If a security scanner is used, run a fresh scan after cleanup and review any remaining warnings with the host or specialist. A green scan is one piece of evidence, not the sole sign that recovery is complete.
Step 10: Review search engine and browser warnings
If Google or a browser has flagged the website, review the exact warning and affected URLs. Search Console can show security issues and manual actions when the property is verified. After the malware is removed and the site is safe, follow the relevant review process in the platform. Do not request a review while malicious pages or redirects remain active. Keep evidence of the cleanup and monitor the result.
Spam pages may remain visible in search results for a period after they have been removed from the website. Make sure the malicious URLs return an appropriate response and that legitimate pages remain accessible. Do not redirect every unknown URL to the homepage simply to hide the symptom. Investigate whether the spam content created new URLs, altered canonical tags or changed the sitemap. Continue monitoring Search Console’s Page Indexing and Security Issues reports.
What if the WordPress site is still reinfected?
Repeated reinfection usually means that something important remains unresolved. The cause may be a backdoor, an unpatched plugin, compromised hosting access, a malicious cron job, a database injection or another website in the same account. Do not keep deleting the same file without finding out what recreates it. Preserve the evidence and ask the hosting provider or a security specialist to inspect the wider account and access logs.
Check every account that can write to the website, including SFTP, SSH, hosting panel, WordPress administrators and deployment tools. Review all sites sharing the hosting account. Rotate credentials and API keys after the environment is clean. If the site uses a third-party service, verify that the connection is legitimate and that its secret has not been exposed. A cleanup should end with a written explanation of the entry point, the actions taken and the controls added to prevent recurrence.
How much does WordPress malware removal cost?
There is no universal price because the work depends on the number of infected files, database changes, websites in the hosting account, availability of clean backups and business urgency. A simple cleanup on a small site is different from a server-wide incident involving several domains, customer data or a store with live orders. A low fixed price may cover only a scanner run or visible file deletion rather than investigation and recovery.
Ask a provider what the quoted work includes: evidence preservation, server and account review, file and database cleanup, software reinstallation, password rotation, backup restoration, post-cleanup testing, search-engine review and a written report. Confirm whether hosting support, premium security tools or emergency work are billed separately. Avoid anyone who guarantees permanent protection without explaining what will be checked and what happens if the site is reinfected.
How to prevent another WordPress malware incident
Keep core, plugins and themes supported and updated. Remove unused extensions and never use nulled software. Use individual accounts, unique passwords and MFA. Secure the hosting and domain accounts as carefully as the WordPress dashboard. Keep tested off-site backups, monitor alerts and review file changes. Limit access to the people who need it and remove old supplier accounts. Schedule maintenance so that the website does not remain unattended after launch.
Use the WordPress security checklist for preventative controls and the maintenance checklist for recurring checks. If your team cannot investigate a compromise confidently, get qualified support before making changes that could affect customer data or the server. A good recovery plan combines prevention, detection, containment and a tested restore process.
Frequently asked questions
How do I know if my WordPress website has malware?
Possible signs include redirects, unfamiliar administrator accounts, spam pages, unknown files, injected links, browser warnings and hosting security alerts. Some infections are hidden, so review logs and files with a qualified specialist rather than relying only on the visible homepage.
Can I remove WordPress malware with a plugin?
A reputable security tool can scan files and identify known threats, but a scan does not guarantee that every backdoor or database injection is removed. Complex incidents may require manual investigation, clean software replacement and a review of hosting access.
Should I delete suspicious PHP files?
Do not delete files based only on unusual names. Preserve evidence and compare the file with clean software or ask the host to identify it. Removing the wrong file can break the website, while deleting one malicious file may leave the persistence mechanism intact.
Will changing my WordPress password remove malware?
No. Password changes can help secure an account, but malicious code may remain in files, the database, scheduled tasks or hosting configuration. Secure all access points and complete a full investigation and cleanup.
Can I restore a hacked site from backup?
Yes, if the backup is known to be clean and predates the compromise. Verify the restore point, preserve recent business records and fix the entry point before returning the site to production. An infected backup can reintroduce the malware.
Why does malware come back after cleanup?
Reinfection may happen because a backdoor, vulnerable plugin, compromised hosting account, malicious scheduled task or another infected site remains. Repeatedly deleting the same file is not enough; investigate how it is being recreated.
Can malware affect Google rankings?
It can. Injected spam pages, redirects and browser security warnings can affect user trust and search visibility. After cleaning the site, review Search Console and follow the platform’s review process where a security warning was issued.
How long does WordPress malware removal take?
Time depends on the scope, access to logs, server complexity, database changes and availability of a clean backup. A small site may be straightforward, while a multi-site hosting account or e-commerce incident needs more investigation and testing.
Should I take my website offline during cleanup?
That depends on the risk to visitors and business operations. If the site is redirecting visitors, serving malicious downloads or exposing data, ask the host or security specialist about restricting access while the incident is contained.
What should a malware cleanup report include?
A useful report records the suspected entry point, affected files or database areas, access credentials rotated, software replaced, restore point used, tests completed and remaining risks. It should not expose passwords or customer information.
WordPress malware response checklist
Record the symptoms and time discovered. Contact hosting support. Preserve logs and a safe copy of the affected state. Secure WordPress, hosting, SFTP, database, domain, DNS and email accounts from a clean device. Identify the entry point. Inspect core, plugins, themes, uploads, database records, scheduled tasks and redirects. Remove malicious code or restore a verified clean backup. Patch the weakness, rotate credentials and test all business workflows. Review Search Console or browser warnings and monitor for reinfection. Keep a written incident report and update the maintenance plan.
Official resources
WordPress.org: FAQ – My site was hacked
WordPress Developer Resources: Hardening WordPress
WordPress Developer Resources: Backups
WordPress.com: What to do if your site is hacked
Editorial note: Malware cleanup is security-sensitive work. If the site stores customer information or runs payments, involve your hosting provider and a qualified incident-response professional.
