How to remove WordPress from a domain, without leaving anything behind

·

You want WordPress off a domain, because the installation broke, because you are starting over, or because the site is becoming something else. It is only a few steps, but two things get deleted by accident and do not come back.

Removing WordPress deletes the whole site. It is not just the software: the pages, posts, uploaded images, comments and settings all go. Take a backup first, even if you are certain you will not need it: how to restore your data with JetBackup and how to generate the zip and sql files.

The clean route: through the tool that installed it

It is the only one that removes everything at once: files, database and database user. There are two tools in cPanel that do this, and the one that matters is whichever the site was installed through.

Tool Where it is and what it does
WordPress Management Under Domains. It lists the WordPress installations on the account, including ones it did not install itself, and removes files and database in one step. It is the most thorough for this job.
App installer Under Software. If you installed the site here, it appears in its list with the domain beside it, and removal is a button.
1 Sign in to cPanel and open whichever tool lists the installation.
2 Find the site by its domain. Make sure it is the right one, especially if you have several sites on the same account.
3 Click remove and read what the screen asks. It usually lets you choose whether to delete the database and its user too. Leave those ticked, or they stay behind taking up space.
How to tell whether that is how you installed it. If you followed installing WordPress in a few clicks, it is. If the site was built by someone else, or brought over from another provider, probably not, and then it may not be in the installer’s list. Try WordPress Management anyway, which detects installations made by hand. If it is not there either, use the manual route.

Manual removal: the three parts

A WordPress installation is three separate things. Deleting only one leaves rubbish behind, and the forgotten database is the usual case.

1 The files. In File Manager, open the site’s folder (usually public_html) and delete wp-admin, wp-includes, wp-content and every file starting with wp-, including wp-config.php.
2 The database. Before deleting it, open wp-config.php and note the value of DB_NAME: that is its name. Then, in MySQL Databases, delete that database. See databases and phpMyAdmin.
3 The database user. It sits on the same screen, in a separate list. If it only served this site, delete it too.
Note the database name BEFORE deleting the files. The name lives inside wp-config.php. Delete the files first and you are left with an orphan database and no simple way of telling which of the ones listed was yours. It is the most frequent mistake in this job. If it has already happened, the way back is to open each database in phpMyAdmin and see which _options table holds this site’s address in siteurl.

The files that stay hidden

Once you have deleted what you can see, turn on Settings › Show Hidden Files in File Manager. These are nearly always still there:

File What to do
.htaccess WordPress writes address rules here. If something else is going on the domain, clear the block from # BEGIN WordPress to # END WordPress. If the file held nothing else, delete it.
.user.ini and php.ini PHP rules left by plugins or by you. Look before deleting: if you raised limits deliberately, you may want to keep them.
.maintenance Left over from an interrupted update. Always delete.
error_log and debug.log Error records. Useless once the site has gone, and debug.log may hold paths and database names inside it.
.well-known Do not delete. It is used to validate the domain’s certificate.

What stays behind and nobody remembers

With the files and the database gone, there are still things living outside the site folder that keep running, or keep taking up room, with nothing left to serve:

What is left Where you remove it
Scheduled tasks Some plugins create cron jobs in cPanel, and they carry on running against a site that no longer exists, failing every day and e-mailing you the error. Look in Cron Jobs and delete the ones pointing at this folder: cron jobs.
Installer backups Some installers keep copies in a folder of their own on the account, outside public_html. They take space and count towards the account’s file count: the limits nobody advertises.
Redirects If you had cPanel redirects pointing at pages of the site, they now point at nothing.
The site’s mailbox The mailbox the site used to send form messages is still there. If it serves nothing now, delete it; if it still receives mail, leave it.
The certificate Leave it. It belongs to the domain, not to WordPress, and it renews itself.
If you would rather not leave the folder empty. A domain with no files at all shows a folder listing or an error page. Put a simple index.html there, saying whatever you like, and the domain shows that while you decide what comes next.

Careful with shared databases

If you have several sites in the same account, confirm that database served only this one. Some setups share a database between sites using different table prefixes, in which case deleting it takes the other sites down too.

When in doubt, open phpMyAdmin and look at the table prefixes. Prefixes from a single installation mean you can delete in peace.

What is left afterwards

Still there Gone
The domain The domain registration is untouched: still yours, still renewing.
The hosting plan The account and cPanel remain. Removing WordPress cancels nothing and refunds nothing.
The mailboxes The domain’s e-mail is independent of the site and is not touched.
The certificate Still issued for the domain and still renewing by itself.
The site Pages, posts, images and settings, all deleted.

If what you want is to cancel the service, rather than just empty the site, that is done in Meu Interweb and is a different thing: how to cancel a service and keep only the domain.

And if it was only to start over?

If the goal is a clean WordPress on the same domain, remove it and install again: installing WordPress in a few clicks. But if the problem was an error rather than the site itself, it is worth trying to fix before throwing away: common WordPress errors.

Not sure which database belongs to the site?

Ask us before deleting

SEE ALSO

WordPress hosting

Support Policy

Frequently asked questions

RECOMMENDED PRODUCT

WordPress hosting

One-click install, updates handled, and speed that holds up. from $6.59/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?