Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Reset a WordPress Site to a Fresh Install (Safely)

A WordPress “fresh install” can mean clearing content, rebuilding the database, or replacing the entire site. This guide shows which scope to choose, the exact WP-CLI commands, backup requirements, file considerations, multisite targeting, and verification steps.
Length13 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A “fresh install” can mean three different things in WordPress: deleting content while keeping the existing setup, dropping every database table and rebuilding the database, or replacing both the database and untrusted site files. Choose the smallest scope that solves your problem, export and verify a complete backup first, then use wp site empty for a content wipe or wp db reset followed by wp core install for a blank database. A database reset alone does not remove plugins, themes, uploads, malware, custom PHP, or server files.

Choose what “fresh install” means

Resetting WordPress is not one operation. The command you choose determines which data survives and what you must restore afterward.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Reset scope What is removed What remains Files removed? Typical access
Content reset Posts, pages, comments, terms, links, and optionally uploads Users, options, themes, plugins, and their settings No SSH or another environment where WP-CLI runs
Database reset Every database table Files referenced by the old database, including themes, plugins, uploads, and custom code No SSH/WP-CLI with database credentials in wp-config.php
Full rebuild The database plus any files you deliberately remove or replace Only reviewed items you choose to retain Yes, according to your host-specific rebuild plan Hosting panel, SSH, database tools, or a managed support workflow

These scopes are not interchangeable. If you only want an empty site for new posts, a content reset is safer. If the database is damaged or belongs to an abandoned project, reset the database and reinstall WordPress tables. If you suspect compromised or untrusted code, review or replace the filesystem as well.

Before any reset: identify the installation and make a usable backup

Confirm the site and its scope

Write down the document root, database name, table prefix, and whether the installation is single-site or multisite. Confirm the domain and the directory in which WordPress is installed. Decide whether you are preserving users, settings, media, themes, plugins, or custom code. A reset performed against the wrong document root or database can destroy a different site on the same account.

For multisite, target the intended site explicitly with WP-CLI’s --url parameter. A network administrator should verify whether the operation is meant for one site or the entire network before running a destructive command.

Check your access and maintenance window

You need an account that can run WP-CLI in the installation directory and a database user with the privileges required by the command. If SSH is unavailable, use the host’s database and file tools or ask managed support to perform the same sequence. Put the site in a maintenance window if visitors could submit orders, comments, forms, or other data while the reset is running. Tell collaborators which administrator account will exist after a database reinstall.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not rely on a browser bookmark or a familiar hosting path as proof that you have the right installation. Read the active wp-config.php, confirm its database name and table prefix, and compare the site URL with your notes. On a multisite network, a site-level content command and a database-wide reset have very different reach.

Back up both database and files

Export the database and copy the complete site files before changing anything. The file copy should include wp-content, uploads, configuration, custom code, and server-specific files such as .htaccess when present. A database export without the files cannot restore themes, plugins, media, or custom code; a file copy without the database cannot restore posts, pages, users, or settings.

Download the backup and verify that it can be read and restored. WordPress.com documentation describes wp site empty commands as irreversible; recovery therefore depends on having a previous, usable backup. Keep the pre-reset export separate from the live site so a later mistake cannot overwrite both copies.

WP-CLI can create a SQL export with wp db export pre-reset.sql and can import a known-good SQL file with wp db import. An export that merely exists is not proof of recovery: check that the file is non-empty, opens as expected, and is stored outside the document root. If possible, test the import on a staging installation or separate database before touching production.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reset content while keeping the WordPress setup

Use this option when you want an empty publishing area but intend to keep the current users, configuration, themes, plugins, and their settings. WP-CLI’s wp site empty is designed for this scope.

Run the content reset

  1. Change to the WordPress installation directory, or otherwise ensure WP-CLI is operating on the intended site.
  2. Run wp site empty --yes to remove posts, pages, comments, terms, and links.
  3. To remove media files from the uploads directory as part of the operation, run wp site empty --uploads --yes instead.
  4. For a multisite target, add --url=https://example.com for the specific site you identified.

The command truncates the relevant content tables and flushes the object cache. It does not remove themes or plugins, and it does not change options or users. Custom database tables created by plugins or bespoke code require separate handling; they are outside the standard content set.

What this reset does not do

  • It is not a reinstall of WordPress core.
  • It does not remove plugin or theme directories.
  • It does not reset configuration values stored in options.
  • It does not remove user accounts.
  • It does not automatically purge every external or persistent cache. If visitors still see old content, purge any cache operated by your hosting or caching provider after the command completes.

Because options and users remain, this method can also retain old site names, permalinks, plugin licenses, API keys, scheduled settings, and administrator accounts. Review those values before handing the site to a new owner. If a plugin stores business records in its own tables, determine whether those tables should be retained or removed separately; deleting standard posts does not guarantee that a plugin’s data is gone.

Reset every database table for a blank WordPress database

Choose a database reset when you need to remove all WordPress data, including users and options, and start the database portion from zero. This is destructive: WP-CLI documents wp db reset as removing all tables from the database.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Export first, then drop the tables

  1. From the correct installation, create an export: wp db export pre-reset.sql.
  2. Confirm that the SQL file exists, is readable, and is stored away from the live document root.
  3. Run wp db reset --yes. WP-CLI removes every table and recreates the database using the credentials in wp-config.php.

Do not treat the confirmation flag as a safety mechanism. --yes only skips the prompt; it does not make the operation reversible. If the export has not been tested, stop before the reset.

Install WordPress tables and the first administrator

After the database is empty and the existing files and configuration point to it, run the standard installation process:

wp core install 
  --url=https://example.com 
  --title='New Site' 
  --admin_user=admin 
  [email protected] 
  --locale=en_US

This creates the WordPress tables and the initial administrator. Supply the administrator password through WP-CLI’s documented prompt-based method rather than placing it directly in a command that could be retained in shell history. If WordPress is installed in a subdirectory, make sure siteurl includes that path; otherwise the dashboard and generated links can point to the wrong location.

A database reset does not install a different set of files. The core, plugins, themes, uploads, configuration, and custom code on disk are still the files that the new database will use until you replace or remove them.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Remember that the database credentials and table prefix in wp-config.php still describe the installation. If you created a separate database instead of resetting the existing one, update the configuration deliberately and confirm the web server points to the matching document root. Never assume that an empty database is automatically connected to the site you are viewing.

Perform a full rebuild when the files cannot be trusted

A full rebuild combines a verified backup, a clean database, and an intentional filesystem plan. It is the appropriate scope when you need to eliminate old custom code, abandoned extensions, or suspected malware rather than merely deleting database records.

Use a deliberate file sequence

  1. Preserve the complete backup, including configuration and server-specific files, before deleting anything.
  2. Reset the database as described above, or create a new database and point a clean configuration to it.
  3. Replace WordPress core with a fresh download instead of assuming the existing core files are clean.
  4. Review wp-content and custom files. Restore only themes, plugins, uploads, and code that you have inspected and intend to reuse.
  5. Keep server rules and environment files only when you understand what they do and have confirmed they belong to the rebuilt site.
  6. Run wp core install against the clean database, then verify the site before restoring additional components.

There is no single host-independent deletion command that is safe for every WordPress installation. Hosting layouts, document roots, deployment files, and retained uploads differ. Use your host’s file tools or SSH only after identifying exactly which directory belongs to the site. Do not delete a parent directory that contains other applications or neighboring sites.

Restore in small stages. Install clean core first, sign in, and confirm the URL. Add one reviewed theme or plugin at a time, testing the front end and dashboard after each addition. Copy uploads only after confirming that they are needed and safe. This staged approach makes it easier to identify a file or extension that reintroduces an error or unwanted behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How the reset methods compare in practice

Question wp site empty wp db reset plus wp core install Full rebuild
Does it remove posts and pages? Yes Yes, because all tables are removed Yes, unless selectively restored from backup
Does it retain users and options? Yes No Only if deliberately restored
Does it remove themes and plugins? No No Only files you remove or replace
Does it remove uploads? Only with --uploads No Only according to your file plan
Can old custom database tables remain? Yes No database tables remain after the reset Depends on the new database and any restored data
Backup requirement Use a verified backup; the operation is irreversible Use a verified database export and file backup Use a complete, restorable database-and-files backup
Multisite targeting Use --url for the selected site Acts on the database configured for the installation Requires a network-aware migration and file plan

The access requirement also differs. A content reset needs WP-CLI access to the right site, while a database reset needs working credentials from wp-config.php and privileges to remove and recreate tables. A full rebuild additionally needs authority to replace files and, often, to change document-root or hosting settings. If you lack one of those permissions, stop and use a host-supported workflow rather than improvising with partial commands.

Verify the rebuilt or reset site

Do not consider the job complete when a command exits successfully. Open the front page and /wp-admin, then test the parts that matter to the scope you chose.

  • Confirm the domain, HTTPS scheme, and (if applicable) subdirectory are correct.
  • Sign in with the newly created administrator after a database reinstall, or with the retained account after a content reset.
  • Check that the expected users, themes, plugins, and settings remain—or that none remain when you intended a clean database.
  • Open representative URLs and verify that permalinks resolve.
  • Test an upload if media was retained, and confirm that its URL resolves.
  • Inspect the plugins and themes screens for extensions you did not intend to keep.
  • Review users for unexpected accounts after a content-only reset.
  • Flush caches after the reset. The content command flushes the object cache, but external persistent caches may need a provider-specific purge.
  • Take a new backup once the clean state has been verified.

Also check email and scheduled behavior if the site will be used immediately. A fresh database can remove settings that mail delivery, cron tasks, or integrations depended on, while a content-only reset can leave old API credentials in options. Confirm only the services you intend to run are enabled.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting and recovery

The command targets the wrong site

Stop immediately if the document root, database name, table prefix, domain, or multisite URL does not match your notes. Reconfirm the installation before running another command. On a network, use the explicit --url target rather than relying on the current directory alone.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The database reset cannot connect

wp db reset uses the credentials in wp-config.php. Check that the file belongs to the installation you identified and that its database name, user, host, and password are valid. Do not “fix” the problem by pointing the command at an unverified database.

The new administrator cannot sign in

Confirm that wp core install completed against the intended database and that the URL, administrator name, email address, and password method were supplied correctly. If WordPress is in a subdirectory, correct the siteurl value so the login URL and redirects include that path.

Old content still appears

A content reset clears WordPress’s object cache, but a host-level or external persistent cache can continue serving an older response. Purge that cache through the provider that operates it, then test in a private browser window. If the old data is in the database, verify that you ran the command against the intended site and scope.

You need to undo the operation

There is no undo command for an empty-site or database reset. Restore the verified database export and the matching site files using your hosting or database tools, then test the restored site before allowing normal traffic. Recovery is possible only when the backup contains the data and files you need and is readable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The site loads but behaves like the old site

That usually means files or persistent settings survived. A database reset leaves plugin and theme directories, uploads, custom PHP, and server rules on disk. A content reset intentionally leaves options and users. Compare the selected scope with the behavior you are seeing before repeating a more destructive command.

Rank #4
Teacher Record Book
  • Keep track of everything from attendance to test scores
  • Spiral bound
  • Measures 8-1/2" x 11"

Common mistakes to avoid

  • Using wp site empty while expecting plugins, themes, options, and users to disappear.
  • Running wp db reset --yes before exporting and checking the database.
  • Backing up only the database and forgetting uploads, configuration, or custom code.
  • Assuming a database reset removes malware or other files on disk.
  • Deleting the entire hosting account directory when only one document root should be rebuilt.
  • Restoring every old plugin and theme immediately instead of adding back only reviewed components.
  • Forgetting to account for a subdirectory in siteurl.
  • Ignoring external caches after a successful reset.
  • Failing to account for custom plugin tables when a content-only wipe is supposed to remove all traces of an extension.
  • Putting an administrator password directly in a shell command that may be saved in history or logs.

Recommended decision path

  1. If you need an empty content area but want to keep accounts and configuration, back up the site and run wp site empty --yes; add --uploads only when media should also be removed.
  2. If every WordPress record must go, export the database, run wp db reset --yes, and run wp core install to create fresh tables and an administrator.
  3. If files may be unsafe or you want a genuinely clean codebase, combine the database reset with fresh core files and a selective, reviewed restoration of wp-content and custom files.
  4. Verify URLs, login, permalinks, media, extensions, users, and caches before declaring the site ready.

Frequently Asked Questions

How do I wipe a WordPress site and start over without deleting the installation?

Back up first, then run wp site empty --yes. Add --uploads if media files should also be removed. This clears standard content but keeps users, options, themes, plugins, and their settings.

Does wp site empty reinstall WordPress?

No. It empties content tables and flushes the object cache; it does not replace WordPress core or delete themes, plugins, users, or options.

How do I reinstall WordPress after deleting the database?

Ensure the files and wp-config.php point to the intended database, run wp core install with the site URL, title, administrator name, email, locale, and a securely prompted password. The command recreates the WordPress tables and first administrator.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Will a database reset remove malware or custom PHP?

No. wp db reset removes database tables only. Plugins, themes, uploads, custom PHP, .htaccess, and other server files remain until you review, replace, or remove them.

Can I reset one site in a multisite network?

Use the intended site’s URL with WP-CLI’s --url parameter for a content reset, and have a network administrator confirm the scope. A database-wide reset affects the database configured for the installation, not just one site.

Is there an undo command for a WordPress reset?

No. Recovery requires a readable, restorable backup. Restore the database export and matching files with your hosting or database tools, then test the restored site before reopening it.

Why do old pages or styles still appear after a reset?

The reset may have targeted a different site, or a host-level, CDN, or other persistent cache may still be serving old responses. Confirm the target and purge caches through the provider that operates them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do custom plugin tables get removed by a content reset?

Not necessarily. wp site empty handles the standard WordPress content set. Custom tables created by plugins or bespoke code need separate, deliberate handling.

The Bottom Line

Pick the narrowest reset that meets your goal. Use wp site empty to clear content while preserving the setup, wp db reset plus wp core install to rebuild a blank database, and a full file-and-database rebuild when the codebase cannot be trusted. In every case, verify a complete backup first and review the resulting URLs, accounts, extensions, media, and caches.

Quick Recap

SaleBestseller No. 1
SaleBestseller No. 3
Bestseller No. 4
Teacher Record Book
Teacher Record Book
Keep track of everything from attendance to test scores; Spiral bound; Measures 8-1/2" x 11"
$4.89

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.