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