Why reinstall WordPress
The removal and reinstallation of WordPress may be necessary in various situations, whether due to an intrusion, the accidental deletion of essential files, a faulty theme or plugin, or even an update that caused major malfunctions. When a critical issue affects the stability, performance, or security of the site, starting from a clean installation helps eliminate potential sources of problems and ensures a reliable environment before proceeding with a proper and up-to-date configuration.
Here are the steps to follow:
-
Back up your site
Copy all of your site’s files via FTP and export its database via phpMyAdmin to your computer. -
Export your site content from the hacked WordPress
From your compromised WordPress site, export all content (posts, pages, navigation menus, and custom post types) using the Export tool (Tools > Export > All content), and save the generated XML file to your computer.
- Go to your WordPress interface, then click “Log In” to access your dashboard.
- Click on "tools"
- Click on 'Export', select 'All content', then click on 'Download export file'.
3.Delete old files
Using FTP, remove all your old content (WordPress folders, root files, etc.) except for the directories related to your hosting account.
4.Delete your old database and create a new one
Create a new database with a different name and a strong password.
- You can refer to one of the following guides to learn how to create a new database from your hosting control panel.
- On cPanel:How to create a MySQL database on cPanel?
5. Download and install the latest version of WordPress
You can either download it directly from the official WordPress website or install it via the Softaculous tool in your cPanel account.
- For detailed steps, refer to: How to install WordPress using "WordPress Manager" from cPanel?
6-Install the latest version of your theme
For more details please check this link How to update WordPress?
7-Import your content into the new WordPress installation
From your WordPress dashboard, go to Tools > Import > WordPress, then follow these steps:
- Click on “Tools”
- Click on “Import”
- Click on “Browse” to upload your previously exported WordPress XML file
8-Install the latest versions of your plugins
Make sure to install only the most recent, up-to-date versions of your plugins — ones that are secure and free of known vulnerabilities.