If you are using Wordpress, and your index.php file has been hacked, there are just a few easy steps you can do on your own to immediately repair your web site.

This article was written under the assumption that you don't have any backup files. If you do have backups, please instead see How to restore files from backup if you have a copy.

If you don't have any backup files, you can download a fresh copy of WordPress and use the index.php files included in the download. To make things easier, in the steps below we've linked directly to the files that you'll need.

  1. Begin by accessing your cPanel and locating the File Manager icon.

  2. Select the domain from the "Document Root for:" drop box. Click Go.

  3. Select your index.php file and choose "Edit" from the top menu bar of File Manager to open the file for editing in a new tab

  4. Select all (Ctrl+A) and delete the contents of this file.

  5. Copy and paste the code below from this file to replace the original Wordpress code:

  6. WordPress index.php file

  7. Save your changes to this file

  8. Reload and test your site. If you do not immediately see the changes, you may need to clear your broswer's cache.

The steps above cover fixing the defacement of your site's homepage. You will next want to repair the index.php page in your admin area.

  1. Back in the File Manager of cPanel, find the wp-admin folder and double click it to open that folder.

  2. Find the index.php inside the wp-admin folder. Select the file and open it for editing by choosing "Edit" from the top menu bar of File Manager.

  3. Select all (Ctrl+A) and delete the contents of this file.

  4. Copy and paste the code from this file to replace the original Wordpress code:

  5. WordPress wp-admin index.php file

  6. Save the changes to this file.

  7. Your site's WordPress admin area should now be available and you should be able to log in.

The steps above should remove any hacked content for this situation. If you have any questions or need additional assistance, we are available 24 hours a day via phone, chat or email.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 757-416-6627 Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}