How to Clean malware

More than 673 sites are affected by malware, directing users to various ad networks.
This contamination affects PHP files, JS files, wp_posts tables, site URLs ( wp_options ).

MAGEFIX SecurityMalware cleanup & protection

Need help? Let us clean your site.

This contamination affects both database and web files, so I would recommend to:
a) Check other sites hosted on the same hosting account.
If malware infection is widespread, each site should be isolated, to prevent cross-site contamination.
b) Perform a site rebuild for each WordPress instance, manually adding plugins, theme and core files from official sources.

To fix a hacked website, follow these steps:

Step 1
1. Backup database and web files using a file manager tool, FTP client.
2. Disable MySQL remote access, especially if you’re using Plesk.

Step 2
Rebuild site
1. Download a fresh WordPress copy:
2. Extract, add a clean version of wp-config.php file from your infected site inside WordPress folder.
3. Add plugins and theme manually, one by one, inside /wp-content/plugins/ and /wp-content/themes/
4. Upload everything back to your server.

Step 3
Reset site URL
Restore site URL:
Easiest way would be to edit wp-config.php file.

define( 'WP_HOME', '' );
define( 'WP_SITEURL', '' );
Step 4
Clean local files
If site rebuild still contains plugins or theme from a previous backup, all index.php and JS files may be corrupted as well.
Look for “$a=chr(“, “chr(104)”, “String.fromCharCode”, “driverfortnigtly”, and “”.

Insert the following script inside pack.php file and place it inside your root folder. This way you can pack all PHP and JS files, which can be cleaned locally.

Search and replace tools for malicious strings inside multiple files: dnGrep, grepWin, VisualGrep, PowerGREP.

Step 5
Database check
  • As a precaution measure, look for “driverfortnigtly”, “String.fromCharCode”. This way you will know if other tables are infected as well.
    Injections usually target wp_posts and wp_options tables.
    The following SQL commands may be used to clear any malicious JS:
  • Search and replace database tool for malicious strings: Better Search Replace, Search Replace DB ver. 4.

  • Check users with administrator privileges.
Step 6
Major update
Perform a major update, making sure core files, theme and plugins are up to date.
Disable and remove any abandoned plugins.

Step 7
Blacklist status & Google cache
Site should be verified with Google search console. To refresh indexed pages, ask for a re-index.
This way, any infected cached pages listed on Google will be updated.

Step 8
Cross-site contamination
If you’re using a single shared hosting account for multiple websites, all index.php and JS files may be infected.
So make sure other sites hosted on the server are secured and isolated.

Try our Free site check.

If your Google Ads are currently suspended, we recommend our Platinum plan, which will include malware cleanup and Ads support:

Malicious URLs:

Malicious domains:,,,,,,,,,,,,,,,
Malicious IPs: ( Nice IT Services Group Inc. ), ( LeaseWeb DE ),, ( )