How to Remove Unused WP Staging Plugin Database Tables

Remove WP Staging Unused Database Tables

Heads up: This page may include affiliate links. Read the full disclosure.

The WP Staging plugin is commonly used to create a staging site if your host does not provide one-click staging site creation.

WP Staging WordPress Plugin

If you no longer need one of the created staging sites, then you can delete it from the UI of the WP Staging plugins.

Uninstalling the WP Staging plugin would not delete any staging sites or delete the created database tables for the staging site. Even after deleting a staging site, there might be some left-over database tables related to WP Staging.

The Left-over WP Staging database table could be due to a cloning process being interrupted.

If you find any left-over database tables from the WP Staging plugin after the delete process of a staging site has been run, then it is recommended to delete those manually.

WP Staging database tables for the staging site would use the following table prefixes;

wpstg0_ 
wpstg1_
wpstg2_
wpstgbak_

Most hosts provide the phpMyAdmin application, which can be used to easily delete all of the WP Staging database tables using the UI of the application or by running a SQL query to delete those.

The SQL query to run in phpMyAdmin would be;

SELECT CONCAT('DROP TABLE ', TABLE_SCHEMA, '.', TABLE_NAME, ';')
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE 'wpstg0_%'
or TABLE_NAME LIKE 'wpstgtmp_%'
or TABLE_NAME LIKE 'wpstg0_%'
or TABLE_NAME LIKE 'wpstg1_%'
or TABLE_NAME LIKE 'wpstg2_%'
or TABLE_NAME LIKE 'wpstg3_%'
or TABLE_NAME LIKE 'wpstg4_%'
or TABLE_NAME LIKE 'wpstg5_%'
or TABLE_NAME LIKE 'wpstg6_%'
or TABLE_NAME LIKE 'wpstg7_%'
or TABLE_NAME LIKE 'wpstg8_%'
or TABLE_NAME LIKE 'wpstg9_%'
or TABLE_NAME LIKE 'wpstg10_%'
or TABLE_NAME LIKE 'wpstg11_%'
or TABLE_NAME LIKE 'wpstg12_%'
or TABLE_NAME LIKE 'wpstg13_%'
or TABLE_NAME LIKE 'wpstg14_%'

Deleting staging sites in the WP Staging plugin would help keep your site’s database free of bloat.

Useful Links

Looking for something?

Privacy laws apply to businesses that collect personal information. Since no personal information is collected by the MainWP plugins, no privacy laws apply to the MainWP plugins. This includes GDPR, UK DPA 2018, PIPEDA, Australia Privacy Act 1988, LGPD, PIPL, and other privacy laws.
Donata Stroink-Skillrud
Donata Stroink-Skillrud
President of Agency Attorneys

Your Download Is Just One Click Away

…or just download the plugin.

By entering your email, you agree to our Terms of Service and Privacy Policy.