Reinstalling WordPress
Before reinstalling WordPress, first make a complete backup of everything needed to restore the site. The most important items are the database and wp-content/uploads: the former stores posts, comments, categories, settings, and other content, while the latter stores uploaded images and attachments.
1. Back Up the Database and Uploaded Files
Open phpMyAdmin, select the database currently used by WordPress, and run “Export.” If the admin dashboard is still accessible, you can also first back up the database with a plugin such as WordPress Database Backup.
At the same time, use an FTP tool or the hosting control panel’s online file manager to download the entire wp-content/uploads directory. If you back up only the database and forget this directory, the images and attachments in your posts cannot be fully restored.
2. Clean Up the Old Installation
After confirming that the backup is usable, clean up the old site.
- In phpMyAdmin, delete all tables from the current WordPress database.
- Go to the WordPress installation directory and delete the old
wp-config.phpand.htaccess. Older posts often abbreviatewp-config.phpasconfig.php; the actual filename should be whatever you see in the server directory. - If you need to keep themes, plugins, or uploaded files, do not delete the entire
wp-contentdirectory directly; only clean it up when you clearly understand the impact.
3. Reinstall WordPress
Open the WordPress site address in your browser to enter the installation wizard. Follow the prompts to enter the database name, database username, database password, database host, and table prefix, then fill in the site title and administrator account information.
wp-config.php is usually created automatically by WordPress. If the server does not have write permissions, you can manually create and upload it according to the instructions on the installation page.
After installation is complete, remember the administrator password and log in to the dashboard to check whether login works normally. If you use the default admin account, it is recommended to change the password immediately. If possible, you can also switch to an administrator username that is harder to guess.
4. Restore the Old Data
Return to phpMyAdmin and import the database file exported in step 1. After importing, check the following:
- Whether the homepage opens.
- Whether posts and pages have been restored.
- Whether image attachments display normally.
- Whether the permalink settings in the dashboard are normal; if necessary, save the permalink settings once so WordPress regenerates the
.htaccessrules.
If a blank screen or plugin error appears after restoration, you can temporarily rename the wp-content/plugins directory via FTP to disable all plugins, then restore them one by one for troubleshooting.
