How to delete a WordPress site from CPanel

How to delete a WordPress site from CPanel

FULL ARTICLE:  https://justlearnwp.com/delete-wordpress-site-from-cpanel/

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.

Step 3: 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: They 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.

Step 4: 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.

    • Related Articles

    • Add Google Analytics 4 to WordPress

      On October 14th, 2020, Google released Google Analytics 4, also called GA4. This is being referred to as their “next generation analytics.” You may have previously known it as App > Web property, within your Google Analytics account. Before you add ...
    • Add A Pardot Form to WordPress

      There are many ways to include a Pardot form on your WordPress website. You can use a plugin, write custom code, or integrate it using a 3rd party tool. Here are five methods that I’ve used and tested, along with a detailed breakdown of how each ...
    • FIX - APEX Code Trigger NullPointerException de-reference a null object

      Description The execution of a trigger will sometimes generate an error message, "execution of [EventName] caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.[TriggerName]: line [XX], column [XX]" This error is ...
    • Best Practices - Salesforce Changesets

      What are the requirements for change sets utilization? Sending of these messages necessitates a deployment connection , which means that they can be sent only, like earlier mentioned, between ventures that are affiliated to each other. However, the ...
    • Best Practices Using Pricebooks and Products

      Define your Product: A Product is a service or item that the company sells to the customers. Once you have added the Products, you can set the price of the product per unit based on your business. In Salesforce, Product is a Standard object having ...