I recommend not deleting the terms at the point of deactivation.
Instead why don’t you delete the terms at the point of uninstallation?
You can use the uninstall hook: http://codex.wordpress.org/Function_Reference/register_uninstall_hook
Or bypass that.
The plugin should create a file named ‘uninstall.php’ in the base plugin folder. This file will be called, if it exists, during the uninstall process bypassing the uninstall hook.
This may be easier to manage code wise and sometimes people would like to deactivate a plugin and not lose all their data.
Related Posts:
- How to share category taxonomy with custom post type (The Event Calendar plugin)
- Query Posts by Custom Field ‘Price’
- Custom Taxonomy in plugin and template
- How to make a list of companies’ information and display them to user, using custom post types and a custom taxonomy?
- Add .html extension to custom post type taxonomies
- Why is this custom taxonomy showing in the database?
- remove custom taxonomy metabox form custom post type
- How to Build a Movie Library in WordPress 3.x
- Get product attribute for Simple product in WooCommerce
- Custom Post Type causes Page Not Found
- How to show category images (from plugin) on a regular page (page-example.php)?
- Woocommerce custom shared taxonomy
- taxonomy_template filter do not loads custom taxonomy template properly
- Plugin allowing for artists, events and venues
- How to add rewrite rules and pagination to retrieve attachments files?
- custom taxonomy and custom post type url conflict
- Show Heirachy of categories in WP Download Monitor
- Custom Taxonomy Tag Search
- Add custom taxonomy to title tag [closed]
- Possible to replicate economist.com’s debate section in wordpress? [closed]
- WP plugins for building a database?
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- WordPress category add image field
- Where (or when) should I register a new taxonomy?
- Limit Number of Taxonomy Terms (Images) Displayed
- Widget for adding HTML markup to a page
- How I can get custom field’s current value?
- Want wp_get_post_terms return in arbitrarily order, how to do?
- List taxonomy terms for post as checkboxes
- ‘No Results Found’ on single post for custom post type
- auto populate list of questions if user select a category xyz
- How to set taxonomy in custom plugin?
- WP_Terms_List_Table Quick Edit not working
- “Custom Post Type Permalinks” plugin URL strcuture
- Ordering taxonomies by rank
- Plugin generated taxonomies’ permalinks with custom placeholders
- Template filter for custom taxonomy terms
- ‘Organize Series Plugin’ as muti author feature
- WordPress custom taxonomy not showing
- Getting taxonomy images to display on single-post with their terms
- Where to populate custom terms in custom taxonomy in plugin?
- Default taxonomy template in plugin, override in theme
- wp_insert_term() doesnt insert a term
- How to get CPT category checkbox list and show post of selected(multiply) checkboxes via ajax?
- Renaming Custom Taxonomy Values
- Smarter navigation plugin and custom taxonomies
- Installed Forca Theme, wonder how I can alter Post editing screen
- Plugin for a static piece of text on homepage
- Rename existing cpt and taxonomy with new textdomain
- how to create hierachial taxonomy and manage under single post type?
- Get product categories and add them to a custom taxonomy
- Need to edit author permissions | custom taxonomy
- Adding category base to url in custom post giving 404?
- Display posts by alphabetical order
- Rewrite/Change custom taxonomy slug
- Custom Taxonomy is Missing (Or Limiting) Items
- Cannot view Custom Post Type no matter what I try
- How to create meta fields with more than 1 relation?
- Only return taxonomies that are linked to a category & product
- Why is my custom taxonomy image not displaying?
- Show custom taxonomy in theme
- Taxonomy question
- Taxonomy Category Icon on index page
- Get only selected custom taxonomy
- Get custom term link archive with prefix
- Add “selected” class to custom taxonomy dropdown search
- “Tree view” for wp_dropdown_categories() markup
- Save selectlist value (taxonomy) in wp:wp_set_object_terms
- Is saving multiple options or saving multiple items in one option better?
- Show similar category portfolio items?
- CPT-onomies CPT_TAXONOMY->get_terms extremely slow with 6K posts
- How can I add the custom taxonomy categories to the posts and pages?
- Is there a way to add a custom input field for every taxonomy term in WP post editor?
- Award points if a specific custom taxonomy is selected – Cubepoints
- How to list the categories by custom taxonomy created?
- ACF Taxonomy Object term Null [closed]
- Display Custom Post Type and Custom Taxonomy Data on Front End Using Only a Plugin
- Failed to update a post when I add a taxonomy to it
- How to enable suggested edits?
- How to change a user’s password programatically
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- Get URL of a specific file
- Building a plugin that doesn’t break when deactivated
- translation does not work with text_domain
- Sage WordPress – Plugin Namespace: Not Found
- Absolute Image URL in srcset is appended to the upload dir
- Is there an npm library that uses best practices to scaffold a wordpress plugin that is build with React?
- Using meta_query to get date type values from post_meta table WordPress
- Setup wp_schedule_event within a custom plugin
- WHy custom plugin slows down the loading of the pages?
- URL rewrite with external JSON query
- Class or function wrapper for plugin code
- Var_dump ACF “API”
- Replace only the first CSS class
- ACF Repeater Field Question [closed]
- ACF repeater field
- How to remove ‘View Details’ page & updates from third-party plugin?
- appointment plugin doesn’t display all appointments
- W3 Total Cache and IIS7 not doing much [closed]
- Mystery URL http://#/ Listed in XML Sitemap Created by WordPress SEO by Yoast Plugin