function my_plugin_remove_database()
{
global $wpdb;
$db_table_name = $wpdb->prefix . 'sandbox'; // table name
$sql = "DROP TABLE IF EXISTS $db_table_name";
$rslt=$wpdb->query($sql);
}
register_deactivation_hook( __FILE__, 'my_plugin_remove_database' );
Related Posts:
- What are the common security flaws I need to look for? [closed]
- Making my plugin multi-site compatible
- Creating 20,000 Posts or Pages using a .csv file?
- What’s the easiest way to duplicate an entire navigation menu?
- Updating WooCommerce variable product stock issue
- How can I get a list of plugins and which blogs are using them?
- What is the easiest way to implement cascading database upgrade for my plugin?
- Plugin Development sqlite or WordPress’ database
- Retrieving a Value from a wp-database
- Problem with creating tables for Plugin
- Prevent duplicate records in plugin table
- WordPress WPforms customization
- How do I run SQL queries on a WordPress web page? [closed]
- Migrating to WordPress Recipe Plugin and Some SQL Issues
- How to create multiple database tables on plugin activation?
- Does deleting a Plugin via the WordPress admin ‘completely’ remove the code?
- Speeding SQL queries for a large database?
- correct validate and sql query
- correct sql query
- SQL query, error
- $wpdb update query in plugin only updating one column
- Woocommerce Backend Search by Title and SKU
- problem with sql query
- Using AJAX to run SQL statement and populate dropdown
- Adding CASE in WP_Query
- JOIN and SUM different statement results (Mailster Database)
- How to get specific column data conditionally in database in WordPress?
- Memcaching recurring SQL Queries
- add products to WordPress site automatically
- How to get database connection details without longing to cpanel in WordPress?
- Performing CRUD operations on front end in wordpress
- Display a number value from mysql query in WP
- Looping the data from WordPress database using foreach
- How To Toggle User_Meta in frontend in a form using PHP
- Get and Update Most Meta Value as an array in HTML form
- WordPress filter from custom table is not working properly
- errno: 150 “Foreign key constraint is incorrectly formed” [closed]
- Create Array from data in the OPTIONS table
- Custom Table doesn’t create on plugin activation
- correct validate inputs
- Get all the related data from WordPress DB
- How to change and edit users according to the extension in the URL
- Remove posts that start with similar words (like a delete duplicate posts plugin)
- How to verify/test that a custom built wordpress theme is as secure as possible?
- How do you debug plugins?
- Add multiple plugin directories
- What are the differences between WPINC and ABSPATH?
- Where do I put the code snippets I found here or somewhere else on the web?
- Giving Multiple Authors Access to a Plugin’s WP.org Repo
- What are the package and subpackage comment for?
- Plugin or advice on how to parse XML in real-time?
- Creating a default Custom Post Template that a Theme can override
- Which files get updated in a plugin update?
- Jigoshop and WooCommerce differences
- How do I check if my $wpdb->insert() was successful?
- Is there a global action for when a plugin is uninstalled?
- How do I add to the list table a filter?
- Pages with 2 Columns
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- WordPress plugin update not showing on wp.org [closed]
- Show plugin only on a specific page
- Hide WordPress Plugin Deactivation Links
- how would I include a js file with tags into wordpress?
- WordPress Plugin development Call to undefined function jQuery()
- Conditional Display of Links in Widgets
- ElasticPress how to Include Meta to the mapping?
- Created Widget Not Showing up on Admin Panel
- Action on post publish
- How to download old versions of plugins? [closed]
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- Tracking Disqus comments on Google Analytics
- Why does deactivating a plugin cause error: “You do not have sufficient permissions to access this page”?
- WordPress 3.5 Media Manager – add a button
- Handling jQuery Component Collision
- WooCommerce – results per page not working after page reload
- Advice and plugins against Malware [closed]
- How to skip woocommerce checkout out page? [closed]
- Can a plugin deactivate and delete itself once installed and activated?
- Allow users mark posts as “complete”?
- Using the “Latest posts” feature on a different site
- Remove specific product from shop in woocommerce [closed]
- Is there a way to order posts and custom post types as one group?
- How to keep users unique id stored in session in addition to IP in WordPress plugin?
- Prevent a plugin from being automatically activated
- The plugin generated 3 characters of unexpected output during activation
- uninstall.php file in Plugin to clean DB
- How to get specific setting by settings_fields()?
- Filter custom posts based on the user role of author
- Save / Show multi line text in metabox
- Plugin updates change folder permissions
- how to protect WordPress RSS Feed from “Feed Fetcher”
- WooCommerce deleted all my menus, categories, theme, pages [closed]
- Best place for short bio,image and button [closed]
- ERR_CONTENT_DECODING_FAILED: How to fully delete gzip compression plugins?
- transfer a file from one domain to another via wp
- Bulk update all posts from plugin settings screen
- Single, unzipped PHP file as plugin?
- WordPress putting “rn” in every line break?
- How to require users to login when not logged in
- TinyMCE Styles Dropdown not adding html tags other than span