Opened 4 years ago
Last modified 3 years ago
#53351 new enhancement
Delete Theme Files in Database When Using Delete Option
Reported by: | deborah86 | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.7.2 |
Component: | Themes | Keywords: | 2nd-opinion |
Focuses: | Cc: |
Description
Right now, when a user deletes a theme, the theme files still remain in the database. This can cause future security issues as well as slowdown a site in the future as the database of the website grows.
This also makes it difficult for end-users to troubleshoot issues with a theme because it is impossible to install a brand new version of the theme without deleting multiple files the database.
When deleting plugins, the plugin data is automatically removed from the database if the plugin developers follow the plugin development standards. The same standard should be applicable to themes downloaded through the theme repository.
Users expect a theme to be fully deleted when using the delete option.
Change History (3)
#1
in reply to:
↑ description
@
4 years ago
- Component changed from Database to Themes
- Keywords reporter-feedback added
#2
@
4 years ago
@SergeyBiryukov
I am referring to the entries stored in the database.
Steps to Replicate
- Install a brand new version of WordPress
- Activate the Twenty Twenty theme
- Make changes to the theme in the customizer such as the color
- Activate the Twenty Twenty One Theme
- Delete the Twenty Twenty theme
- Reinstall the Twenty Twenty theme
If you reinstall the theme, you will notice the settings you edited are present. The theme is not freshly installed without the saved settings. According to the theme team, this is working as intended.
In order to get a fresh install of the theme, a plugin has to be installed to delete the theme_modes_twentytwenty option in the site's database.
See the response here: https://core.trac.wordpress.org/ticket/53147#comment:12
I am requesting the entire theme deletes without the use of a third-party plugin.
#3
@
3 years ago
- Keywords 2nd-opinion added; reporter-feedback removed
Another option would be to have a "reset theme to defaults" button in the Appearance > Themes > [Theme] card that opens when you click a theme, or even in the Customizer itself. I believe the preservation of user settings is a feature, removing theme customisations would be a poor experience for when you try out a theme and then you go back.
Hi there, welcome back to WordPress Trac! Thanks for the ticket.
Replying to deborah86:
wp-content/themes/theme-name
and are removed when the theme is deleted, so the ticket description is a bit confusing for me.