As the other answers seem to imply, there is no built-in way to do this. There is no theme uninstall API similar to that for plugins. There is actually a long-standing ticket to get this feature added to WordPress core, so that themes can uninstall themselves. The consensus from the lead developers there seems to be that this isn’t a feature that want themes to have. I’m not sure what the rationale for that is. Maybe you can help explain to them the benefits of it.
Related Posts:
- Remove settings if theme is deleted?
- Solutions for generating dynamic javascript / CSS
- How do I add settings to the Background Options Page?
- Import media to online WordPress from local development
- How to add a checkbox element to attachments editor with example
- Auto get_header and get_footer on every template?
- What is the right way to include a wp-admin file in your theme?
- Nested comments ignored for max per page in wordpress
- Theme Check gives: Required: This theme doesn’t seem to display tags?
- Is it possible to use line break in theme description?
- How does WordPress decide what template to use as frontpage
- get_option function
- Override Current Theme Setting in wp_config.php
- Theme showing incorrect update
- modify a output of a widget
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
- Which is the simplest theme for WordPress to use it as your base?
- How to highlight the current page in the nav menu?
- Is tag default in WordPress?
- “Display Site Title and Tagline” checkbox not working?
- Should I use language_attributes() or bloginfo(“language”) in html tag
- Getting jquery to work with custom theme
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Why does WP recommend against custom favicon functionality in themes?
- What’s the best action to use when you want to do something only once per theme setup?
- Excluding a page with a certain name from wp_page_menu
- Widgets with groups / sub widgets? Widget in a widget?
- Why is the first query affecting the second query, even after wp_reset_query() and wp_reset_postdata(), but not on the second page?
- Avada resources still loading from localhost after database migration [closed]
- No Appearance –> Header menu
- Add theme templates for child categories into the template hierarchy
- How do I create a custom partial / template?
- Internationalization and functions that use it
- Get a setting value conditionally in the Customizer api
- How should I be handling my theme version numbering?
- How would you accomplish the following advanced settings page?
- How do I Add images uploaded in the post to a default custom field
- image url relative path not working in css file
- Update Custom Theme Version
- Storefront child theme not applying parent theme [closed]
- Sort wp_query by sum of two meta fields
- Custom Navigation build using wp_nav_menu and walker
- Call to undefined function add_menu_page() on theme activation
- The Content is not Wraping in tag
- Using page-id-{ID} from body_class() in local dev, versus live staging
- Should all references to a text domain be to my current theme?
- WordPress Settings API not saving options
- Custom image size vs CSS sizing
- Unique design inside a specific category’s url
- Rewrite the HTML markup of wp-login.php
- Making a WordPress theme based on twentyten
- Doing context-aware previews in the WordPress Customizer
- multiple html/css files for wordpress theme?
- Create new wordpress theme with no need update
- Multi Site Setup, Child Themes, Getting Style Sheet Directory
- Add image URL automatically to custom field?
- content filter (add_filter) for category description?
- How do I pass the category object to a function when is_archive() is true?
- Making a horizontal flyout menu from WordPress category listing
- How to use Canonical URL meta tag to avoid duplicate content issues with WP home pages
- getBoundingClientRect() showing different values on load vs scroll
- How to update mark-up of a gallery block in a custom theme?
- Host Private Custom Theme
- Why not works the search.php file?
- How do I make my terms for each product display via foreach loop? (woocommerce)
- WordPress Insert ads after every 5th post
- Exclude categories from wp query not working
- Copying a modified theme from one wordpress site to another wordpress site [closed]
- How to get custom logo with REST API instead of get_theme_mod();
- How can I change this SVG shape that’s generated?
- Can I set rest API endpoints from within a theme?
- Theme starter content translation is not working
- (Parent) theme Is Not Showing In Theme Selection Panel and Therefore Breaks Child Theme
- How to add an image to a theme page template in code?
- Looking to create an “update theme” functionality for a custom front-end dashboard
- remove_action(‘genesis_header’,’genesis_do_header’) hook not working
- Text View (Code View) in WordPress Customizer TinyMCE Editor
- Breaking Categories Up into Individual Divs
- Different stylesheet for different pages not working fully
- Can I use WP Multi-site on a sub-domain with a different theme but use all the original site’s posts/pages?
- How to Apply Category Filter to Pagination
- Strip HTML tags on custom code from the_content
- Get all Custom Post Types
- wpdb->insert adds too many rows
- wpalchemy repeating fields dropdown issue
- Does WordPress require that your submitted theme supports multiple menu levels?
- WordPress loop not working on blog.php page
- Option to show/hide widget depending on is_home?
- Add Dynamic Sidebar to Exisiting WordPress Theme [closed]
- Why does the first loop take arguments from the second loop?
- How do I middle-align my header menu items in WordPress [closed]
- Theme layout for home page [closed]
- How to add Dummy content when active wordpress theme without xml import?
- Is there any reason that other theme elements (such as nav menus) shouldn’t be within the loop?
- Is there any way to show child theme in theme detectors?
- Is there a way to have WordPress autodetect page templates in the page-templates directory and any sub-folders?
- How can I use pre declared blocks in a php file?
- jQuery Snippet Not Working on WordPress Site [closed]
- WordPress Two Level Filters on Getting Custom Taxonomy Terms