Deleting a WordPress site completely is a simple and easy process, You just need access to your cPanel control panel.
NOTE: If you have multiple sites on the same hosting account, be careful and check multiple times to delete any file, folder, database and database username from your account. Otherwise, you may lose your precious site and some important files.
How to delete a WordPress site completely from cPanel?
Here are a few things we need to do to completely delete a WordPress site from cPanel.
- Access to cPanel
- delete the correct database using cPanel
- delete correct database username that you added to your site database
- delete all WordPress files
Step 1: Login to cPanel
Login to your cPanel account, check email from your hosting provider to find login details. I am hosting my sites on NameCheap, which is a great domain name and hosting provider company.
To easily access cPanel, I can type mydomain.com/cpanel in the browser address bar. Type your username and password to login to cPanel dashboard.
Under the Files section, click File Manager. Click + symbol to expand public_html. Now you can see all the files for your website.
As you can see in the screenshot below, I have multiple websites. I want to delete demo.justlearnwp.com.
Step 2: How to Find the correct database and username for your WordPress site via cPanel?
Before deleting this site, I need to check the database name and username for this database. Double click on your site folder name to view all the files for your site.
Now right click on wp-config.php and click view.
Under MySQL database username, and The name of the database for WordPress you can see the database name and database username for this site.
It will look something like this:
/** MySQL database username */ define('DB_USER', 'leidi_jpsome');
In the above mentioned example, leidi_jpsome is database username. Save the database and database username.
Delete the database and database user
Once you have confirmed the database and username, now you can delete them.
From the cPanel homepage, click on MySQL Databases. You will be redirected to the following page.
NOTE: I have edited the screenshot to hide database and usernames for security reasons. Never share your database name and database username publicly. Otherwise, bad guys can hack your site.
Just click the delete button and confirm to delete your database and do the same to delete the username for this database.
Once you have deleted the database and username, you won’t be able to access your WordPress site, because WordPress needs a database to work.
Type your domain name in the browser address bar and You should see error establishing database connection error. It means database and username for this site has been deleted successfully.
Delete all WordPress files from cPanel
Click on the file manager, go to public_html. Right click on your site folder name, you want to delete and click delete link.
You will see a confirmation box if you really want to delete all files. Select Yes.
That’s all, You have successfully deleted your WordPress (including all files, database, and username) site from cPanel