Websites and applications
Reinstall WordPress while keeping the content
Reinstalling the core can repair incomplete or modified files, but on its own it does not fix the database, a vulnerable plugin or malware in other directories. First identify what you need to recover and keep a current backup.
How is the content preserved if we reinstall?
WordPress keeps much of its data in the database, the media files and components in wp-content, and the connection and settings in wp-config.php. There may also be custom files or external storage.
Before replacing anything, save files and database to a private location and check that you can recover them. Note the core version and language. If you have WP-CLI, use wp core version and check with wp core verify-checksums --include-root to find differences; a warning about an extra file does not by itself prove it is malicious.
Reinstalling WordPress from the dashboard while keeping the content
In Dashboard > Updates, use Re-install version X (Reinstalar ahora in Spanish) when it is available and matches the version you want to repair. Wait for it to finish and check the front end, admin area and logs.
Do not assume that button cleans files that are not part of the core, or that a full reinstall confirms there has been no intrusion.
Reinstalling WordPress via FTP while keeping the content
Download the official package of the same version and language from WordPress. Check which files belong to the core before replacing them through secure file access.
Keep the previous directories in a private location outside the public root; renaming wp-admin inside the website does not stop old PHP from running. Replace wp-admin, wp-includes and the corresponding core files. Do not overwrite wp-config.php, wp-content, .htaccess or your own files without reviewing them.
Reinstalling WordPress via WP-CLI while keeping the content
In the correct root, explicitly specify the version and locale you have checked. This example contains placeholders you must replace:
wp core download --version=VERSION_INSTALADA --locale=LOCALE_INSTALADO --skip-content --force
Without --version, wp core download may download the current available version: that would also be a version change, not the exact repair you are after. The admin user's language may differ from the core package; confirm the right locale.
--force overwrites files and --skip-content skips the themes/plugins included in the package. The command does not remove every stray file that might be there. Check checksums, operation and logs after running it, on a clone first.
Reinstalling plugins and themes
Get the package of the same version from its official repository or vendor. Keep customisations separately, along with a private copy of the previous directory. Upload the clean copy and check its activation and features.
Reinstalling files does not necessarily revert the plugin's database changes. Do not use Delete if you only want to replace code, without checking what data its uninstaller removes.
Full WordPress reinstall (starting from scratch and losing all content)
A new installation does not automatically keep posts, users or settings. If that is the goal, use an empty destination and a new database, keeping the original installation protected until you have checked the result.
You can do it with Softaculous. Check the root and database before deleting any registered installation. Keep the rollback plan and avoid both receiving writes at the same time during the switchover.
After repairing
If the cause was an intrusion, also review users, tasks, plugins, themes and files outside the core. Rotate the affected credentials and keys and fix the entry point before considering the incident closed.
If the repair fails, restore the planned consistent set and check the website before reopening it. Do not leave quarantine folders, SQL files or recovery packages downloadable from the domain.
You may also find useful
- Change the uploads folder and media organisation in WordPress Explains how to turn off date-based folders, change the WordPress uploads path and adjust files and...
- Control WordPress automatic updates Explains how to limit automatic core updates to minor versions, test major changes and avoid indefin...
- Deactivate a WordPress plugin without accessing the dashboard Helps you regain access to WordPress through recovery mode or by temporarily renaming the plugin's d...
- Enable WordPress Multisite Explains how to prepare, enable and complete a WordPress Multisite network with subdomains or subdir...
Something wrong or out of date? Tell us and we will review it.