How to Reinstall WordPress Safely Without Losing Your Site
Reinstalling WordPress can help repair missing or damaged core files, but it should never be the first step without a backup. A careful process protects posts, pages, uploads, settings and plugin data while replacing only the files that need attention.
Before you reinstall
- Create a complete backup of both the WordPress database and the files, including
wp-contentandwp-config.php. - Confirm that the backup can be downloaded and that you know how to restore it.
- Record your WordPress version, active theme and plugins. Check the site’s PHP and database compatibility.
- Put the site into maintenance mode if visitors might see errors during the work.
- Investigate the original problem. A plugin conflict, exhausted disk space, permissions issue or compromised site may not be fixed by replacing core files.
Method 1: Reinstall from the WordPress dashboard
For a standard site, sign in as an administrator and open Dashboard → Updates. If WordPress offers a reinstall option for the installed version, use it to replace core files. The exact button text can vary by release and host. Do not choose an option that deletes content or resets the database.
Official guide: Updating WordPress.
Method 2: Replace core files manually
Use this method only when you are comfortable with file access or your host supports it. Download a clean copy of the same WordPress version from WordPress.org. Extract it locally. Replace the core folders and root core files on the server, but preserve wp-content and your existing wp-config.php. Never overwrite the uploads folder with an empty package.
When using SFTP or a hosting file manager, take care to avoid deleting custom files stored outside the normal WordPress structure. If your host offers a staging site, test the procedure there first.
After reinstalling
- Log in to wp-admin and check Dashboard → Updates for pending database or core updates.
- Open the home page, key pages, posts, forms and login screen.
- Check permalinks under Settings → Permalinks and save only if required to refresh rewrite rules.
- Confirm images and media load, and test contact forms and email delivery.
- Review plugin and theme versions and update them through a tested process.
- Check Site Health and review the PHP error log if problems continue.
Important security note
If you suspect malware or an account compromise, reinstalling core files alone is not a complete cleanup. Change passwords, rotate exposed keys, inspect administrator accounts, scan themes and plugins, remove unknown files, and ask your host or a security professional to investigate persistence mechanisms.
See the WordPress hardening guide and WordPress hacked-site guidance.
Conclusion
A safe WordPress reinstall is a controlled replacement of core files, not a reset of your website. Back up first, preserve wp-content and configuration, use the official files, then test the site carefully. When the underlying problem is a plugin conflict, malware or hosting issue, address that cause as well.
