How To Unhack Your WordPress Website
- Make a backup of your database
- Open up yoursite.com/wp-config.php and make note of the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST
- Download Adminer https://github.com/vrana/adminer/releases/download/v4.3.1/adminer-4.3.1-mysql-en.php
- Open up cPanel's file explorer or your favorite ftp program
- Upload the adminer file to yoursite.com/adminer.php
- Visit that url: yoursite.com/adminer.php
- Enter your credentials
- Click on the Export link on the left, the Save radio button, and then the Export button
- Save a copy of the database to your computer just in case!
- In the file explorer or ftp program move yoursite.com to yoursite.com.old
- Create a new directory called yoursite.com
- Unzip a fresh installation of WordPress there:
- Copy wp-config-sample.php to wp-config.php and populate the four values as was done above: DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST
- Now reinstall each plugin and theme from /wp-admin/
This way you know for sure all of the files are clean again. It's worth it to go to the trouble.