Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Clean Your Website of Malicious Content

This guide shows how to find and remove harmful code from a hacked website, step by step.

Web Hosting2 min read11 steps

What is malicious content?

Malware is bad code that hackers hide in your site. It can send visitors to spam sites, steal data or send junk email. Often you do not see it at first. Signs include a sudden drop in visitors, a browser warning, strange pages, or new files you never made.

Before you start

Cleaning can remove files and break a site. Take a full backup first, even if the site is infected. A copy lets you undo a mistake.

Steps

  1. Back up all files and the database.
  2. Change your passwords. Change the control panel, FTP, database and website admin passwords. FTP is a way to move files to and from your hosting. Use long, mixed passwords.
  3. Run a malware scan. Your control panel or a security plugin may offer one. Ask Hostvento support which scanners are on your plan.
  4. Look at recently changed files. A file you did not change may be bad. In your file manager, sort by Last modified.
  5. Check common hiding places: index.php, .htaccess, the wp-content/uploads folder, and theme files. Watch for long strange code, often containing base64_decode or eval.
  6. Replace clean core files. If you use WordPress, download a fresh copy from the official site and upload the core files again. Do not overwrite wp-config.php or wp-content blindly.
  7. Reinstall plugins and themes from their official sources. Delete any you do not use.
  8. Check for unknown admin users in your site dashboard and remove them.
  9. Remove bad code from the database if the scan finds it. Be careful, as wrong edits can break the site.
  10. Update everything. Old software is the most common way in.
  11. Scan again to be sure the site is clean.
Tip: If your site is blacklisted by a search engine or browser, you can ask them to review it once it is clean.

Prevent it happening again

  • Keep software, plugins and themes up to date.
  • Use strong, unique passwords.
  • Keep regular backups.
  • Install only trusted plugins.

Need help?

If you cannot find the problem, open a support ticket. Tell us the website name and what you noticed.

Quick recap

  • Back up before you clean.
  • Change all passwords.
  • Scan, then remove bad or changed files.
  • Reinstall core files, plugins and themes from trusted sources.
  • Update software and scan again.