Reinstall Wordpress Core using CLI
We recommend creating a back-up of your website before proceeding.
- Login to your terminal/SSH. If you do not know how - you can follow the guide here
- Navigate to the root directory of your WordPress installation by using the following command:
ssh
cd public_html- Verify that you're in the correct directory by checking for the presence of the wp-config.php file. Optionally, but recommended. - You can remove these directories before reinstalling the core. This will help eliminate any unwanted or malicious code from your website.
ssh
rm -rf wp-admin
rm -rf wp-includes- Reinstall WordPress Core Files by executing the following command.
ssh
wp core download --force- Update database if needed.
ssh
wp core update-dbThat's all! Your core files have been successfully reinstalled.