In my opinion, a best practice would be to clean everything on uninstallation. It’s also mentioned as a best practice in the docs:
When your plugin is uninstalled, you’ll want to clear out any plugin options and/or settings specific to to the plugin, and/or other database entities such as tables.
However, if you’re struggling to decide what’s best for your plugin, why not let the user decide? You could always ask them whether they want to keep their data just after they have clicked the uninstall button. Take a look at this similar question for details.
Related Posts:
- How to Add an Index to Plugin Database table
- Creating two database tables via plugin
- How does WordPress handle MySQL row lock errors?
- WordPress register_activation_hook table creation not working
- Default Plugin Settings Not Writing to Database
- Building an email signup form. Where should the information be saved in the DB?
- Plugin Options Not Saving to Database in WP 4.5
- How to create custom tables in WordPress using my own plugin?
- Is it possible to create Custom Post plug-in?
- Help With MySQL to WPDB Query Conversion
- Prevent duplicate records in plugin table
- WordPress Backend HA (Automatic failover)
- How can I change the meta_key for a particular piece of information?
- Can I create a table on my DB without creating a plugin?
- WordPress : Explain Plugins & Theme string value in database
- How to insert and call new data in wordpress website database through a plugin
- WPDB: Update table
- Issue running db create table query from static method
- Separate database for a wordpress plugin
- Best/Correct way to add an option to a category
- What is the WordPress approach to custom data?
- How to create plugin/ page that reads from database
- DB Query not working in Plugin
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- WordPress plugin: efficient way to store large data
- Integrating Custom Database with WordPress
- How to display results from a data table with an encrypted user id?
- How to make a Product page without ordering and database
- I want to schedule email (date, time is in database->table) wp_schedule_event() not working
- How to securely controlling data without keeping it in postmeta?
- $wpdb->insert not working inside save_post tag
- Where do the section input fields values are stored in database
- My plugin can’t see my files
- how can i get records from wp_postmeta table using particular meta_key in database?
- Create New Admin Menu Section – Like how custom post type works, in a way
- Creating fields in the database
- How to submit the custom form data in database in WordPress without plugin?
- get_option returning a different value from what’s saved
- How can I delete the options from DB when the plugin is deleted?
- register_activation_hook not working
- On the same site, how do I send data from a plugin file to a theme file?
- plugin doesn’t retrieve data from database
- Loading external page template and enqueue script from plugin causes 403 forbidden error
- Where the Nickname is being used in WordPress
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- How can I include a setting that has a variable number of values in a settings page using register_setting?
- Adding dynamic section to WordPress
- Yoast SEO blocking/re-initialising longer running process
- Add Fields with Sub-Fields to WP Job Manager
- template_redirect not being called when using ajax
- How to edit/delete single row items in a table on my own menu page
- Is there a way to alter the order in which the plugins appear in the page?
- How to correctly detect accessing wp-content/uploads?
- How to create custom embed block in gutenberg wordpress
- How can sanitize $_FILES[‘haq_slider’] field
- How to trigger $_GET request within admin plugin page?
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- Change plugin main file name (that is currently in the repo)
- Edit Yoast SEO breadcrumbs output [closed]
- Using a post-signup hook to get user details
- How to apply a patch via plugin?
- wp_remote_get() returns 403 while file_get_contents() does not
- How to set add question capability for author role in wp pro quiz plugin
- Insert Array in Plugin Database
- after wordpress update to 3.5+ i get many errors in plugin wpdb::prepare()
- plugin wraps the entire content
- Shortcode Attributes to Return different $_POST
- Plugin onclick button activate other plugin
- How programatically cause uploads folder to be created?
- Yoast SEO Plug In and my Theme duplicating code. Need some feedback on what to do? [closed]
- Using Class loader in WordPress boilerplate
- Allow a particular user to access a particular plugin?
- wordpress plugin add page when activate
- Add style to body based on url
- How to check for already existing plugin versions on activation? and prevent errors
- update_post_meta is not working for me when I use e.preventDefault for update button
- How to create a plugin with automatic update?
- Loading plugin script only on required page?
- Create survey that redirects to sidebar menu customized to answers
- Uploading images to custom table
- Plugin management with my custom plugin
- Plugin Version List not Shown
- How to pass value from WordPress to Javascript
- How do I create a state of “don’t assign anything to variable” if WP_Error throws an error?
- Plugin communication between sites that use it?
- Database error when user logs in
- How to change meta data(title, description) for current post?
- Provide http service by wordpress plugin
- create web service for android app using wordpress website
- WordPress custom posttype meta values doesnot save
- Why tinyMCE.editors doesnt work on tinyMCE
- Filter EVERY category link with my plugin
- get_option include in my adsense
- How can I make a website with dynamic features with wordpress?
- How to add custom html to the Media > Attachment Details modal?
- Displaying Category Feature image on loop
- How to check record is exist or not in WordPress CRUD Operation with $wpdb
- How to disable pagination in WordPress’ API results?
- How to change the version of block.js and plugin to the same of Package.json?
- Warning “Attempt to read property ‘feeds’ on null” using post update function