The ‘rogueads.unwanted_ads’ is a common WordPress malware. This malware is the result of several malicious injections that result in displaying ads (or opening pop-ups) without the consent of the site owner.

If you are using a cache plugin on your WordPress site, it is important that you clear the cache after removing the malware.Here is a complete guide on how to remove ‘rogueads.unwanted_ads’ from WordPress.

Step 1. Locate post.php File

Go to your WordPress installation directory. Open ‘wp-includes’ folder and locate post.php file. Right click on post.php file then click edit. Then remove the following code :

<?php if (file_exists(dirname(__File__) , '/wp-vcd.php')) include_once(dirname (__File__) , '/wp-vcd.php'); ?>

Locate this code and delete the exact line(as shown above). Now save post.php file. You can find this code usually on the top of post.php file.

Step 2. Delete ‘wp-feed.php & wp-temp.php

Inside ‘wp-includes’ folder you have to delete two .php file i.e. wp-feed.php and wp-temp.php. You can find the malicious code inside wp-temp.php file. Now, all you have to do is : delete wp-feed.php and wp-teme.php from wp-includes folder.

  • wp-tmp.php
  • wp-vcd.php
  • wp-feed.php

Delete these files

Step 3. Locate Function.php inside theme folder

Now, go back to WordPress installation directory. Then go to ‘wp-content’ > ‘theme’ folder. Here you will see your installed themes. Go inside your active-theme and locate function.php file. Now all you have to do is remove everything before this code.

rogueads.unwanted_ads

Code can be slightly different depending upon your theme. You will find this code on the bottom of the function.php file.

<?php
if ( !defined ('ABSPATH') ) {die(); ) }
global avia$ config;

Remove all of this extra code by comparing to your genuine functions.php of your theme. For more deep analyses. Do checkout header.php, footer.php, and few other files to check the malware code.

Use Wordfence for free! This plugin provides an extensive security for your WordPress site. Wordfence plugin performs the following functions to provide you with a safer WordPress experience.

Also If you are using any cache plugins then simply clear the cache. Now ‘rogueads.unwanted_ads’ will be removed completely from your WordPress sites.

Written by