Virus In index.php File On WordPress – How To Remove It

If the virus scanner on your hosting detected a virus in the index.php file on your WordPress website, it is a real big reason to worry. It will adversely impact your website performance and you need to get rid of the virus as soon as possible. As with some other virus you can’t just delete the index.php file as your WordPress website will not work with it.

What is this Virus in index.php file –

The type of the virus normally is shown as SiteLock-PHP-FILEHACKER-rv.UNOFFICIAL by the virus scanner. It can be a foreign javascript or php code or iframe in your index.php file. These scripts or code might be redirecting your website to some other adware site or trying to steal sensitive user data from your website or might try to bring your website down altogether.

How to Disinfect index.php file of Virus –

Directly deleting this file doesn’t work in this case as it is the core file of the WordPress system and removing it will crash your website down. There are two ways you can disinfect your website of this virus in your index.php file.

Method 1 – Replacing it with a fresh index.php file from the similar version of WordPress – As this file doesn’t contain any running data so it can be replaced with a fresh file. Follow the steps to do this :

Go to your file manage from cPanel or FTP account

Reach to the installation directory of WordPress, usually it would be public_html

Look for index.php file and delete it

Download the fresh copy of similar version of WordPress from wordpress.org

Unzip the downloaded files and look for index.php

Upload only the index.php file in the same directory from which you deleted it.

Categories

About WPSitex

Wordpress is a vast platform used my millions of websites. WPSitex is a platform where you can learn about different aspects of Wordpress. Everyone starting from beginners to Experts will find something to learn for sure. We will appriciate your contribution via comments and share.