keepcalculator

06 Numbers and Powers

Reinstall WordPress Without Losing Content

Card No. 06·41223 · Updated · Standard formula, shown below

This guide walks you through reinstalling WordPress while keeping your posts, pages, media, and settings intact. You’ll replace the core WordPress files (the ones that often get corrupted or hacked) without touching your database or uploads folder. You need access to your hosting control panel (cPanel, Plesk, or similar), an FTP client or file manager, and your database credentials.

What You’ll Need

  • FTP client (FileZilla, Cyberduck) or your host’s file manager
  • Your hosting control panel login
  • Database name, username, and password (stored in your wp-config.php)
  • A fresh copy of the WordPress zip file from wordpress.org
  • A text editor (Notepad++, Sublime) for editing files

Step-by-Step

  1. Back up everything. Before touching anything, download your entire WordPress directory via FTP or file manager. Also export your database from phpMyAdmin (or your host’s DB tool). This gives you a full restore point if anything goes wrong.
  2. Identify your WordPress root folder. This is the folder that contains wp-config.php, wp-admin, and wp-content. It might be public_html, www, or a subfolder.
  3. Download the latest WordPress zip. Go to wordpress.org and download the current version. Unzip it on your computer.
  4. Delete the old core files. In your root folder, delete these folders and files (but NOT wp-content and NOT wp-config.php):
    • wp-admin
    • wp-includes
    • All files in the root except wp-config.php, .htaccess, and wp-content

    This removes the core WordPress installation while keeping your content and configuration.

  5. Upload the fresh core files. Upload the contents of the new WordPress folder you unzipped into your root folder. Your FTP client will overwrite the remaining files (like index.php) with new versions. Do NOT overwrite wp-config.php or wp-content.
  6. Check your wp-config.php. Open the file on your server and verify the database credentials are correct. If you’re moving hosts, update the host field (often localhost). Save it.
  7. Verify .htaccess is intact. If you had custom rewrite rules (for permalinks, caching, security), make sure the file is still there. If it’s missing, go to Settings → Permalinks in WordPress and click “Save Changes� to regenerate it.
  8. Run the WordPress update script. Visit yourdomain.com/wp-admin. WordPress will detect the new files and prompt you to run the database update. Click “Update WordPress Database� and wait for it to finish.
  9. Test your site. Log in, check a few posts, pages, and media files. If something looks off, check the error log or re-upload any missing files.

Common Mistakes

  • Deleting wp-content. This folder holds your themes, plugins, and uploads. Deleting it wipes your media library and custom code.
  • Overwriting wp-config.php. The new WordPress zip includes a sample config file. If you upload that over your real one, you’ll lose database settings and may get a “Error establishing a database connection� message.
  • Skipping the backup. Even a simple reinstall can go wrong. Without a backup, you risk losing months of content.
  • Using an outdated WordPress zip. If you download from a third-party site, you might get an old or modified version. Always use wordpress.org.
  • Not clearing browser cache. After the reinstall, your browser might show old CSS or JS. Hard-refresh (Ctrl+F5) or clear cache.

Tips

  • Use a staging site first. If you’re nervous, replicate the process on a subdomain or local install before doing it live.
  • Keep a copy of your wp-config.php on your computer. If you accidentally overwrite it, you can restore it quickly.
  • After the reinstall, update your themes and plugins. They may have been out of date, which is often why you’re reinstalling in the first place.
  • Consider using a maintenance mode plugin. It shows a friendly “Under Maintenance� page to visitors while you work.
  • If you’re reinstalling due to malware, change all passwords (FTP, database, WordPress admin) and scan your computer for the source.

Troubleshooting

  • “Error establishing a database connection� after reinstall. Your wp-config.php is wrong or missing. Restore the backup of that file. Double-check the database host, name, user, and password.
  • White screen of death. This usually means a PHP error. Enable debugging by adding define('WP_DEBUG', true); to wp-config.php. Then check the error log. Common causes: a plugin is incompatible with the new core, or a file didn’t upload completely.
  • “Briefly unavailable for scheduled maintenance.� Delete the .maintenance file from your root folder. It sometimes gets left behind after an update.
  • Lost custom permalinks. Go to Settings → Permalinks and click “Save Changes� to flush rewrite rules.
  • Media files missing. Check that the wp-content/uploads folder is intact. If it’s missing, restore it from your backup.
  • Plugins not working after reinstall. Deactivate all plugins via FTP (rename the plugins folder to plugins_old), then reactivate one by one to find the culprit.

Frequently Asked Questions

Will reinstalling WordPress delete my posts and pages?

No, as long as you keep the wp-content folder and the database intact. Posts and pages are stored in the database, not in the core files.

Do I need to reinstall plugins and themes?

No, they live in wp-content/plugins and wp-content/themes. They stay as long as you don’t delete that folder. After reinstall, you may need to reactivate them.

What if I don’t have FTP access?

Use your host’s file manager (usually in cPanel or Plesk). It works the same way.

Can I just reinstall via the WordPress admin dashboard?

Yes, if your site is still accessible. Go to Dashboard → Updates → Reinstall WordPress. That does the same thing automatically, but it may not fix files that are corrupted at the server level.

Will my custom code in functions.php survive?

Yes, because functions.php is inside your theme folder in wp-content. Just don’t delete that folder.

How long does the process take?

Typically 15–30 minutes, depending on your hosting speed and internet connection. The actual file transfer is the longest part.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →