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?
- Menu items description? Custom Walker for wp_nav_menu()
- Sizing screenshot.png without losing aspect ratio
- What is $post_id? is it a global variable in WordPress?
- “Quick Edit” > update clears out my custom meta values
- How can I set image sizes and still have responsive images using the srcset attribute?
- Call dynamic_sidebar but include/exclude named widgets?
- Add default Backgrounds
- Possible to “Attach” images to multiple posts without inserting or uploading twice?
- Custom Comments – Parent / Nested Reply
- What is best practice for writing/using custom PHP classes in a theme?
- add_image_size is scaling, even though crop is set to true
- Problems with Layout inherit in theme.json
- Efficient WordPress Development Workflow Help?
- Replace #site-title with resizable image in Twenty Twelve? [closed]
- How can I remove the Static Front Page option from the Customizer
- Settings API enable default settings on theme install?
- Change date number to another language/script?
- Custom php page in WordPress theme?
- Finding Page Template and Displaying Content
- Compact pingback list with favicons
- Removing feeds from header using a function?
- How to link to theme options page from anywhere in admin?
- How to add theme support?
- What is the best way mark entries as featured?
- How do you apply multiple skins to a site via the “templates” selector using stylesheet switching?
- Add theme support for post thumbnail isn’t working from theme class
- I need to know how to structure my WordPress theme
- Featured Images are not able to be set
- Single-level menu option? Another way?
- Any dummy content I can use for development?
- How to add an option for “nofollow” to the Link editor’s existing “Link Relationship(XFN) options list?
- How can I alter the display of category listings via sidebar.php?
- Need advice > converting category assignments to custom post meta values
- How to edit theme functions file to modify pagination?
- Divi – How can we show background video on mobile
- Calling post_exists() causes white screen in after_setup_theme
- What’s the best practice way of handling custom fields in different post formats?
- How to create a fixed header and scrolling content area
- Edit value of the_content() before showing
- is_home and is_frontpage always true
- How to correctly enqueue the parent and child theme stylesheets in the creation of a child theme? [duplicate]
- header_image not returning header image url
- Taxonomy-$taxonomy-$term not working
- WordPress linking
- wp.media issue with selected image
- how to make wordpress change the title and keep page name?
- Why does admin-ajax load slow and what are ways to speed it up?
- searchform.php doesn’t work properly
- Shortcodes do not work in own template
- Adding Bootstrap to WordPress TwentySixteen Theme
- What are the allowable Tags values in a theme file header?
- Following/tracing page construction through theme PHP
- my single.php is mixup on some post for no reason
- How do I implement jPanelMenu?
- altering search terms
- Creating a theme update notification api [duplicate]
- Custom menu: Link names
- Post thumbnails Retrieve Url
- Stylesheet is not loading on firefox and IE!
- static front page ONLY for certain themes?
- How to add cropped custom header image?
- Inconsistent bloginfo information
- How to custom category template based on category?
- add_action for admin_init hook with a parameter
- get_the_terms() returning wrong results inside of loop
- custom post type query causing errors
- Category-specific loop not working
- Is it possible for the enqueue styles function to mess up my CSS?
- How to diagnose wp-env environment problem
- how can i remove js file from my footer in wordpress
- WordPress Admin bar missing from custom theme
- How to dynamically set a background image with the customizer without putting the css as an inline-style
- SIte logo is not displaying
- wordpress custom category post shortcode
- the_content() is getting null in Preview Debug
- Unable to delete option
- Different WP Rest API custom endpoints across different themes
- How to set different localization file for different users?
- How to add an import widgets functionality to wordpress themes without a plugin
- overlay post title over post’s featured image
- how to add jquery to wordpress
- Hook in parent theme Menu function
- How to add custom nav_menu_css_class to certain menu only?
- Need help with adding custom menu content
- Import from HubSpot COS into WordPress 4?
- child comments not displaying as nested
- Simple loop with shortcode rendering problem
- Theme automatically inserting “more” tag on every post
- How get the 10 most viewed pages (not post)
- WordPress widgets manager option for emulating theme layout
- Conditional tags issue for multiple is_page() conditions in sidebar.php
- have_posts() return false on single post
- Im using a right approach to use this class inside WordPress theme?
- Bestway to write php functions
- Is using display: none the proper way to hide elements in a theme?
- How to change order of elements using a child theme
- Twenty sixteen – full height
- Correct way to make a custom block theme responsive
- My theme is full of error messages in the “Customize” screen, but nowhere else