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
- Add a custom form on the post-new.php admin page
- How to access data in wordpress database externally using php
- Removing customise fields during plugin uninstallation
- Is it possible to create Custom Post plug-in?
- Edit Yoast SEO breadcrumbs output [closed]
- What’s the best way to implement AJAX in WordPress?
- How to Create a Custom Panel and Fields in Post Page [Plugin]
- Translating long texts with html formatting
- WordPress Settings Lost After Site Migration
- Help With MySQL to WPDB Query Conversion
- How would I go about creating a user ranked post popularity page?
- Anonymous Postings
- Do widget options need to be escaped widget()?
- Is there any W3C compatible Share & Follow plugin?
- custom user tables supported in SharDB plugin?
- Does any one have Idea to get these functionalities with the plugin wp-multi-network
- DROP TABLE with uninstall hook not working
- How to check if tables in WordPress still exists after activations
- how to oauth1 Wp plug-in revoke/reset.?
- Disable woocommerce cookies and delete cart data automatically
- Prevent duplicate records in plugin table
- className not populating in custom block
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Run plugins only on certain pages
- Overide plugin files from child theme (/inc/ ) folder
- wp_generate_attachment_metadata is creating an empty array
- custom payment gateway in woocommerce failed to connect to remote api server
- Display encrypted content on my website
- How can I perform high-level database merging for WordPress within continues delivery?
- Delete query not working in plugin
- How to remove traces from widget during uninstallation
- Post category with counts been display like a menu
- Post custom Data value in The Events Calendar plugin [closed]
- Send reply with pre-prepared answers
- Best way to maintain and update 3rd-party WP plugin when developer is unresponsive?
- Save custom attributes of product in woocommerce
- Calling an attribute from a plugin shortcode
- Best place for short bio,image and button [closed]
- Use of Templates in a Plugin
- Why can’t I access my Intranet LDAPS with NADI?
- How do I network enable a plugin for a multisite install via the database?
- External Domain on WordPress Multisite
- In the archive widget, how do I sort in between two years?
- WordPress Backend HA (Automatic failover)
- import posts with dutch/special letters
- Automatic switch to backup database on fail
- Customization API for plugin development
- How can I change the meta_key for a particular piece of information?
- Fromcraft Plugin On click submit button [closed]
- Migrating to WordPress Recipe Plugin and Some SQL Issues
- WordPress Integration with Google Groups
- creating a custom shop page display on archive woocommerce
- Setup page on first login on multisite
- polylang + category/tag custom language link
- Anspress Customization: How to show logged in user votes on a single answer?
- Custom wordpress Theme and Plugin repository
- Automatic Updates Individual Plugins Not Working
- Create a table with wordpress plugin boilerplate
- How do I make a child theme I made POST through a 3rd party plugin?
- wp_editor content in plugin options page
- How create Group Blogs based on user created Groups
- Multiple instance of data in plugin custom database table on plugin activation
- WordPress and a secondary database?
- WordPress plugin creating database in localhost but not on real host
- Why this function not working for install database on plugin activation
- How to redirect users to their profile after they successfully edit their profile
- Custom table naming/access convention for multisite: $table_prefix vs base_prefix or other?
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- date/time-picker and file upload (image) fields for custom fields (e.g. with more fields)
- Getting Theme element into plugins page editor in wp admin
- WordPress as web application base
- Customize The Events Calendar to Include an Option to Expand for More Events Listings
- URL rewrite of independent plugin?
- Plugin for users to create their own ads like Google Adsence
- plugin code is pulling information from database in one instance and not in other. What is wrong?
- GeoMashup plugin: how to customize cluster markers / icons? [closed]
- “Master” WordPress Multisite – Database Sync
- Better ads plugin has 500.000 entries in wp_postmeta
- How do I apply style to each category of a list?
- Add category selection to custom post type (plugin)
- Redirect to another page using contact form 7? [closed]
- changing posts layout in ultimate member profile plugin
- How to create multiple database tables on plugin activation?
- Can I create a table on my DB without creating a plugin?
- WordPress : Explain Plugins & Theme string value in database
- “No Add Button” for me to customize my WordPress with themes and pluggins
- Is it necessary to auto delete my WP plugin database tables when users deactivate/delete my plugin?
- Translation plugin to translate another plugins
- Does deleting a Plugin via the WordPress admin ‘completely’ remove the code?
- Creating a CSV with PHP inside the plugin directory
- Login Customizer doesn’t change the background of the register form