You could do this using the WordPress uninstall.php support:
<?php
if( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) exit();
global $wpdb;
$wpdb->query( "DROP TABLE IF EXISTS NestoNovo" );
delete_option("my_plugin_db_version");
?>
This uninstall.php file is called when your plugin is deleted.
Related Posts:
- How can I delete orphan keys in WordPress database tables?
- How to delete all records from or empty a custom database table?
- Using Vagrant for customizable WordPress Multi-sites [closed]
- clean wp_options table unused rows
- Add some fileds to the wp_posts table
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Integrating Custom Database with WordPress
- Pull Data from DB for Admin Page Display as Relates to Admin Page Class by BA Internet
- Posts are deleted everyday at night
- What is right way to go about adding functionality to a published WordPress plugin?
- Creating button next to “add media” that allows you to choose a single post
- WooCommerce create new product and add to cart on form submit
- Extending WC_Cart in woocommerce
- How can a Firebase user registration and login be integrated into a WordPress site?
- Custom Widget Creating PHP Exception When Placed In Its Own PHP File
- How to set value/term of a Woocommerce attribute text field in admin panel?
- Why is this custom taxonomy showing in the database?
- WordPress Plugin development Call to undefined function jQuery()
- Conditional Display of Links in Widgets
- Created Widget Not Showing up on Admin Panel
- I need to add a custom “cover” to every new post — plugin or custom setup?
- how to show database content in wordpress post
- What is the easiest way to implement cascading database upgrade for my plugin?
- Recommendations for books/resource to get started with wordpress 3 development (plugins/themes) [closed]
- Remove obsolete plugins artifacts from database tables
- Why does deactivating a plugin cause error: “You do not have sufficient permissions to access this page”?
- Check if User exists in WordPress Multisite
- Override the filter from plugin in child theme
- Custom plugins/Manipulated plugins: Always a terrible idea to inherit these types of WP sites that discourage updates? [closed]
- wordpress.org codebase
- Can a plugin deactivate and delete itself once installed and activated?
- What kind of data is that?
- Embed a Google Sheet as you view it in a separate tab?
- How to import my YouTube channel into WordPress?
- My Category is too big on the Menu what can i do?
- How can I capture Memberpress user info after signup [closed]
- JS Support Ticket – Auto create WP account
- Removing customise fields during plugin uninstallation
- How to Create a Custom Panel and Fields in Post Page [Plugin]
- Prevent duplicate records in plugin table
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Best place for short bio,image and button [closed]
- Automatic switch to backup database on fail
- Automatic Updates Individual Plugins Not Working
- Why this function not working for install database on plugin activation
- WordPress as web application base
- Plugin for users to create their own ads like Google Adsence
- How do I apply style to each category of a list?
- Plugins in WP_Options but not Active
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- Custom widget doesn’t save values from dropdown box
- Updating options into the wp database performance
- Plugin function inside custom plugin
- Change the style of h1, h2, only in post entry
- Ajax save data to database on document ready, no data being saved
- Custom API plugin to execute 3rd party API to retrieve data
- shortcode – multiple instances of same parameter name in one shortcode instance
- External wpdb connections in different plugins on single page
- How to create a plugin that includes all the other plugins?
- Why is it important to check for isset and is_array before checking in_array in this example?
- How Should Custom Functions Be Called For Single Posts?
- same user role or copy the user role to be same as the other role
- Want to modify a Plugin – Tweetily – Can I make it tweet a Custom Field instead of Post Title?
- How can I replace content on site generated from plugin without changing plugin
- Edit post image attributes on fly?
- Getting URL GET parameter with Code snippets and storing it in database?
- Same Plugin tables between wordpress installations
- Replace only the first CSS class
- Ultimate Members Default Post Layout problem
- WordPress database problem wp_posts, primary key
- How to allow URL with filename & extension in wordpress?
- How to send custom mail when a user complete a specific form
- PHP message: WordPress database error Deadlock found when trying to get lock
- Echo custom admin field into a is_single()
- Manual Backup – How to save to Firefox or Chrome (instead of IE which brings up popup I can’t get rid of)
- using wordpress login details for other website / application / forum?
- how to create database to use it in wordpress website?
- How to create a custom page for unrelated database?
- User content database [closed]
- Am I using an action hook correctly?
- Conditional required fields for WordPress Contact Form 7
- Replace code in plugin template
- Display_rows() and column_cb() strange behaviour
- Directory structure for plugin changes
- How can I pass value to function in add_menu_page?
- disable lightbox in a plugin [closed]
- Is there a plugin that will override the “Error establishing a database connection” message? [closed]
- Get the url of attachments from the post?
- Remove the ‘Press This’ Tool
- Create New Admin Menu Section – Like how custom post type works, in a way
- How wordpress plugin hooks works? [duplicate]
- Selling Downloadable Products [closed]
- How to delete remain data in WP database after deleting custom post via admin interface
- How can I modify the colors of my theme for a single section of my site? [closed]
- How to generate a responsive output from plugin?
- Need help saving input fields for Security Deposit plugin in WC Vendors page
- Shortcode returning specific content of a post
- get_option returning a different value from what’s saved
- How can I delete the options from DB when the plugin is deleted?
- Using ACF to allow user to add and edit multiple saved forms