WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 6 months 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: reporter-feedback
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 (2)

#1 in reply to: ↑ description @SergeyBiryukov
6 months ago

  • Component changed from Database to Themes
  • Keywords reporter-feedback added

Hi there, welcome back to WordPress Trac! Thanks for the ticket.

Replying to deborah86:

Right now, when a user deletes a theme, the theme files still remain in the database.

  1. Could you clarify which files exactly you mean here?
  2. Could you provide the steps to reproduce the issue on a clean install?
Version 0, edited 6 months ago by SergeyBiryukov (next)

#2 @deborah86
6 months ago

@SergeyBiryukov

I am referring to the entries stored in the database.

Steps to Replicate

  1. Install a brand new version of WordPress
  2. Activate the Twenty Twenty theme
  3. Make changes to the theme in the customizer such as the color
  4. Activate the Twenty Twenty One Theme
  5. Delete the Twenty Twenty theme
  6. 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.

Note: See TracTickets for help on using tickets.