Security glossaryMalware is software written to harm, such as viruses, trojans, ransomware, and spyware. On websites it often injects spam, redirects visitors, or steals data.
Malware, short for malicious software, is any program or code written to do something its victim did not agree to: steal data, damage files, spy, extort money, or quietly use someone else's computer or server for the attacker's benefit. On personal computers it usually arrives as a file someone opens. On websites it usually arrives through a security hole and hides among the site's own files and database.
Common types
- Virus: code that attaches itself to legitimate files or documents and spreads when they are opened or run.
- Worm: a self-contained program that spreads across networks by itself, without needing a host file or a user to run it.
- Trojan: malware disguised as something useful. It does not replicate; it relies on the victim installing it.
- Ransomware: encrypts files or systems and demands payment for the key, often after copying the data out first.
- Spyware: secretly collects information, such as keystrokes, passwords, or browsing activity, and sends it to the attacker.
- Adware: forces unwanted advertising onto a device or browser, sometimes tracking the user to do it.
- Fileless malware: runs in memory or through legitimate system tools rather than as a file on disk. It is hard for traditional file scanners to catch, but behavior-based and memory scanning can detect it.
Malware on websites
Website malware is built to make money from the site's traffic, reputation, or server. Typical infections on WordPress sites include:
- SEO spam: hidden links or thousands of spam pages, such as the pharma hack or the Japanese keyword hack, often shown only to search engines.
- Malicious redirects that send some visitors, often only those arriving from search or on mobile, to scam sites.
- Backdoors and web shells that let the attacker back in after the original hole is fixed.
- Card skimmers injected into WooCommerce checkout pages.
- Phishing pages and spam mailers hosted on the compromised server.
The usual ways in are outdated plugins and themes with known vulnerabilities, "nulled" pirated premium plugins that come with malware built in, weak or reused passwords, and other compromised sites in the same hosting account.
Signs of an infection
- A browser warning such as "Deceptive site ahead", or a message in the Security Issues report in Google Search Console.
- Strange titles or pages in Google results for a
site:search of your domain. - Admin users nobody created, or PHP files inside
wp-content/uploads. - A host suspending the site, or reports that it is sending spam.
Removing it
- Take a full backup first, so nothing is lost if the cleanup goes wrong.
- Replace WordPress core, plugins, and themes with fresh copies from trusted sources. WP-CLI's
wp core verify-checksumsflags core files that have been changed. - Remove unknown files and users, and check the database for injected scripts and links.
- Change every password (WordPress, hosting, database, SFTP) and replace the security keys and salts so stolen sessions stop working.
- Fix the hole: update or remove the vulnerable plugin.
- If Google flagged the site, request a review in Search Console.
Our guide to removing malware from WordPress covers each step in detail.
Prevention
Keep everything updated, delete plugins and themes you are not using, never install nulled software, use strong unique passwords with two-factor authentication, keep regular off-site backups, and consider a web application firewall to block known attacks.