Automatically delete the database after deleting the site

I quickly installed the wordpress program, but after I deleted the site, the connected databases were not deleted together. Do I think this is a design defect? After the site is deleted, the databases created together will also be deleted theoretically, so I don’t need to delete additional database pages, and I may delete many databases by mistake? Please tell me how to delete the database after the site is deleted?

hestiaCP doesn’t know which database goes with which website.

Databases can be shared among website apps.

The quick install is just a set of commands to install a WP database and the PHP files.

If you want to delete fast and easy you may have only one WP per hesta user and delete the user.

Alternatively you may have a cli script to do that:
Read wp-config to get database name and then remove website and database

3 Likes

If you use the wp-cli command line client, you can just do

wp db drop --yes
1 Like

Thank you for your answer. This is a good way. I’ll try this

I don’t think you are able to drop the database from wp-cli except deleting the tables.
(Due to lack of permissions)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.