Skip to content

How to Uninstall and Reinstall WordPress

wordpress

At some point in a site’s lifecycle, starting fresh with a clean installation becomes the most efficient way to solve persistent issues, remove legacy clutter, or recover from a security incident. Knowing how to correctly uninstall and reinstall WordPress—without losing critical data—is a core skill for any site owner, webmaster, or developer.

When (and When Not) to Reinstall WordPress

Reinstalling the core software is a powerful reset, but it isn’t always necessary. Understanding the right use cases helps you avoid extra work and potential data loss.

Common reasons to reinstall

  • Persistent errors after updates: White screen of death, unexplained PHP errors, or core files corrupted during an update.
  • Malware or hacked site: Infections spread across themes, plugins, and core files that are hard to fully clean.
  • Bloated or broken setup: Years of experiments, plugin conflicts, and database clutter that make troubleshooting painful.
  • Moving to a new hosting environment: You want a clean slate with a fresh configuration while keeping your content.
  • Development and staging workflows: Resetting a test site back to a vanilla state for new projects or client demos.

When a full reinstall might be overkill

  • Simple plugin or theme conflicts: Often resolved by disabling or replacing the problematic extension.
  • Minor performance issues: Typically caused by poor hosting, unoptimized media, or heavy plugins—not the core itself.
  • Single-page errors: Frequently due to template or shortcode issues rather than corrupted core files.

Before you decide on a full uninstall and reinstall, try basic troubleshooting. But if you suspect deep corruption, severe misconfiguration, or a compromised installation, a clean rebuild can be the safest path.

Understand What Uninstalling WordPress Actually Removes

WordPress consists of two major components you must treat carefully:

  • Files: Core files, themes, plugins, uploads, custom scripts.
  • Database: Posts, pages, users, settings, menus, comments, plugin data, and more.

A full uninstall generally means removing both files and database tables. However, you can perform three main types of reinstalls:

  • Core-only reinstall: Replace WordPress core files without touching the database or the wp-content folder.
  • Reinstall while preserving content: Remove and reinstall WordPress and themes/plugins, but keep your database and uploads.
  • Complete wipe and rebuild: Delete files and database, then start from scratch as if WordPress was never installed.

The right approach depends on your goals and how much of your existing site you want to keep.

Critical Step: Back Up Everything First

Before you uninstall anything, create at least one complete backup. Ideally, store copies in multiple locations.

What to back up

  • All WordPress files:
    • Core files in the root directory (e.g., wp-admin, wp-includes, and root PHP files).
    • The entire wp-content folder (themes, plugins, and uploads).
    • Any custom files such as .htaccess, robots.txt, or custom scripts.
  • Database: The full MySQL or MariaDB database used by your installation.

How to create a backup

  • Via hosting panel: Most hosts offer one-click backups in cPanel, Plesk, or a custom dashboard.
  • Via backup plugins: Tools like UpdraftPlus, BlogVault, or similar solutions can create and store backups remotely.
  • Manual backup via phpMyAdmin and FTP/SFTP:
    • Export your database via phpMyAdmin (or a similar tool).
    • Download all files using FTP/SFTP.

After backing up, verify that your backup archive is complete and accessible. A corrupt backup is the last thing you want when trying to recover a site.

Gather Essential Information Before You Start

Uninstalling and reinstalling is easier and safer when you know the exact parameters of your environment.

  • Database credentials: Host, database name, username, and password (often found in wp-config.php).
  • Table prefix: Default is wp_, but it may be custom (important when cleaning or reusing an existing database).
  • Current domain and URL structure: Useful for search engine visibility and avoiding URL mismatches after reinstall.
  • List of must-have plugins and themes: Keep a record of what you actually plan to reinstall.
  • Any custom code or snippets: Functions in functions.php, custom plugins, or snippets added via a code manager.

Option 1: Reinstalling WordPress from the Dashboard

If the admin area is still accessible and the damage is limited to core files, you can often reinstall without touching your database or content.

Steps to reinstall via the dashboard

  • Log in to your admin area with an administrator account.
  • Go to the updates screen.
  • Use the option to reinstall the current version of the core software.
  • Wait for the process to finish, then log out and back in if necessary.

This method:

  • Replaces core files with a fresh copy.
  • Does not touch themes, plugins, uploads, or the database.

Use this approach when you suspect core file corruption or a failed update but know your themes, plugins, and database are otherwise intact.

Option 2: Manual Core Reinstall via FTP or File Manager

If the dashboard is inaccessible or heavily broken, a manual reinstall using FTP or your hosting file manager is more reliable.

Download a fresh copy

  • Get the latest stable package from the official source.
  • Extract the archive on your local machine.
  • Delete the wp-content folder from the extracted archive to avoid overwriting your themes, plugins, and uploads when you upload the files.

Connect to your server

  • Use FTP/SFTP (e.g., FileZilla) or your host’s file manager.
  • Navigate to your site’s root directory (typically public_html or a domain-specific directory).

Replace core files safely

  • Do not delete your existing wp-content folder. This is where your themes, plugins, and uploads live.
  • Do not delete wp-config.php unless you specifically plan to reconfigure your database and keys.
  • Upload all remaining files from the fresh package, allowing them to overwrite existing core files.

Once the upload completes, clear any server or browser caches, then test the front end and admin area. In many cases, this is enough to restore a broken site without performing a full uninstall.

Option 3: Uninstall and Reinstall While Keeping Content

If you want to remove themes, plugins, and non-core files but keep posts, pages, users, and settings, you can perform a semi-clean reinstall. The idea is to preserve the database and uploads while rebuilding the rest.

Step 1: Export your content (optional but recommended)

Before touching files or databases, export your content via the built-in exporter:

  • Navigate to the export tool in your admin area.
  • Export “All content” and download the XML file.

This gives you an extra layer of safety for posts, pages, custom post types, and taxonomies.

Step 2: Preserve the uploads folder and database

  • Back up the full database using phpMyAdmin or your host’s tool.
  • Via FTP or file manager, download and save the wp-content/uploads directory.

You’ll use these to restore media and data after the reinstall.

Step 3: Remove non-essential files

In your site’s root directory:

  • Delete everything except:
    • wp-config.php
    • .htaccess (if present and not compromised)
    • Any custom files you know you still need
  • Inside wp-content, remove all themes and plugins you don’t plan to keep.

Alternatively, you can delete the entire wp-content folder if you are certain you want to start from scratch with themes and plugins, but be sure your media uploads are backed up.

Step 4: Install a fresh copy

  • Upload a new copy of the core files using FTP or the host’s file manager.
  • Include a fresh wp-content folder if you removed the old one, or only replace core directories (wp-admin, wp-includes).

The existing wp-config.php will connect to your current database automatically. If you kept the same table prefix and database, your content will still be there.

Step 5: Restore uploads and reinstall extensions

  • Upload your saved uploads directory back into wp-content.
  • Install fresh copies of your preferred theme and plugins from trusted sources.
  • Reactivate and configure them one by one, checking for errors along the way.

This method gives you a significantly cleaner environment without sacrificing existing content and media.

Option 4: Complete Uninstall and Clean Rebuild

A full wipe is the most drastic approach. It’s appropriate when you:

  • Want to completely repurpose a domain.
  • Have a deeply compromised or irreparably broken site.
  • Are starting from zero and do not need existing content or data.

Step 1: Remove files

  • Use FTP/SFTP or your host’s file manager.
  • Delete all files and folders in the site’s root directory:
    • Core directories (wp-admin, wp-includes, wp-content).
    • All PHP files like wp-config.php, index.php, wp-login.php, etc.
    • Any leftover or suspicious files added by malware.

Step 2: Remove database tables

You can either drop the existing database or clear the tables used by the installation.

  • Drop and recreate the database:
    • Log in to your hosting control panel.
    • Go to the database management section.
    • Drop the existing database (after confirming your backup is safe).
    • Create a new database with a new username and strong password.
  • Or remove only WordPress tables:
    • Open phpMyAdmin.
    • Select the database used for your site.
    • Select all tables with your WordPress table prefix (e.g., wp_).
    • Drop the selected tables.

Step 3: Run a brand-new installation

  • Upload a fresh copy of the core package to your empty root directory.
  • Visit your domain in a browser to launch the setup wizard.
  • Enter your new database credentials and choose a table prefix.
  • Set your site title, admin username, password, and email.

You now have a completely new, clean environment, with no leftover data or files from the previous installation.

Handling a Reinstall After a Hack or Malware Infection

Security incidents require extra attention. A simple reinstall without proper cleanup can leave backdoors on the server.

Best practices when recovering from a hack

  • Scan all files: Use server-level malware scanners, specialized plugins, or external services to identify malicious code.
  • Delete and replace all core files, themes, and plugins: Never trust modified copies of official extensions; always reinstall from known-good sources.
  • Audit wp-config.php and .htaccess: Look for suspicious redirects, code injections, or users added via configuration.
  • Reset all passwords: Change database credentials, admin passwords, FTP, SSH, and hosting account logins.
  • Remove rogue users: Check the list of users and remove unknown administrators or editors.
  • Update everything: After the reinstall, ensure you are using the latest versions of all components.

When in doubt, treat the situation like a full uninstall and rebuild to reduce the risk of reinfection.

Preserving SEO and URLs During a Reinstall

From an SEO standpoint, the most important thing is to preserve your URL structure and content as much as possible.

Key SEO considerations

  • Keep permalinks consistent: Use the same permalink settings after the reinstall to avoid unnecessary 404 errors.
  • Retain slugs and taxonomy structure: Changing slugs for posts, pages, and categories can break indexed URLs.
  • Preserve meta data: If you rely on SEO plugins for titles and descriptions, ensure their database tables are restored or re-imported.
  • Use redirects when changing structure: If you must change URL patterns, set up 301 redirects using your server configuration or a redirection plugin.
  • Resubmit sitemaps: After the reinstall, regenerate your sitemap and submit it via search engine webmaster tools.

A clean reinstall can actually improve search visibility if it results in a faster, more secure, and more stable site—just avoid breaking established URLs without a migration plan.

Post-Reinstall Checklist

Once you finish uninstalling and reinstalling, take time to harden and optimize the new setup.

Security hardening

  • Change all site-related passwords and use a password manager.
  • Install a reputable security plugin to monitor login attempts and file changes.
  • Limit admin accounts, and assign the minimum required roles to each user.
  • Disable file editing from the admin by defining the appropriate constant in your configuration file.
  • Enable two-factor authentication for admin and editor accounts whenever possible.

Performance and stability

  • Set up caching (via plugin or server-level tools) to improve load times.
  • Optimize images and large media files.
  • Install only the plugins you truly need, and remove anything unused.
  • Configure regular, automated backups stored off-site.

Functional testing

  • Test the home page, key landing pages, and critical navigation paths.
  • Verify contact forms and e-commerce flows if applicable.
  • Check the admin area for errors or missing capabilities.
  • Review the error logs for any recurring warnings or fatal errors.

Common Pitfalls to Avoid

Even experienced users can run into problems when removing and reinstalling a site. Keep an eye out for these mistakes:

  • Forgetting a full backup: Starting without a verified backup is the fastest route to permanent data loss.
  • Accidentally deleting wp-content/uploads: Losing this directory means losing most of your media library.
  • Mixing up databases: Working on the wrong database can wipe out the
Anna Pawlik

Anna Pawlik

With over 4 years of experience as a WordPress Developer and Team Lead, I specialize in custom theme development, process automation, and AI integrations that streamline website management. I’m passionate about building fast, scalable, and maintainable digital solutions.

Your website not converting?

Improve it with us