Make WordPress Core

Opened 10 months ago

Last modified 2 months ago

#51832 new enhancement

Add a more visible way to delete unused themes

Reported by: tobifjellner Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.5
Component: Themes Keywords: needs-design needs-screenshots dev-feedback
Focuses: ui, javascript, administration, rest-api, coding-standards Cc:


Today (in WP 5.5) in order to delete a theme I don't use, I need to navigate to Appearance → Themes, then click on "Theme Details" that is only visible when a theme has focus and in the splash dialog, finally, hit "Delete".

Since the Health Check reminds users to remove themes they don't use, we systematically set people off looking for how to delete unused themes without finding (and then writing nervous posts in various help forums).

Let's add a more discoverable way!
On the "Themes" page, we could add a button at the top of the page (after the "Search installed themes" dialog) "Delete unused themes".
When you hit that button, you get a list of all your themes. Your current theme (and its parent theme, where applicable) would be inaccessible and "greyed out". All other themes would have selection boxes. At the top of the list there should be a two buttons: "Select all themes recommended for deletion" and "Delete selected themes".

Hmm. May words. Perhaps someone with suitable skills could draft a mock-up?

Attachments (1)

#51832.patch (4.6 KB) - added by 9primus 8 months ago.
Hello everyone. This is my patch for deleting multiple themes .Unfortunately it delete not all file in last version of wordpress. Plese , give me feedback about my patch

Download all attachments as: .zip

Change History (11)

This ticket was mentioned in Slack in #forums by tobifjellner. View the logs.

10 months ago

#2 @9primus
9 months ago

  • Focuses ui javascript administration rest-api coding-standards added

Hello tobifjellner!) I think I can implement your enhancement. See you soon here.

This ticket was mentioned in Slack in #core by 9primus. View the logs.

8 months ago

#4 @paaljoachim
8 months ago

  • Keywords needs-screenshots added


Please upload a screenshot and perhaps also an animated gif when ready. Thanks.
As it would give us a visual idea what it looks like.

8 months ago

Hello everyone. This is my patch for deleting multiple themes .Unfortunately it delete not all file in last version of wordpress. Plese , give me feedback about my patch

#5 @9primus
8 months ago

  • Keywords dev-feedback added

It seems this function from my patch not delete all files, please give me feedback:

function Delete($path)
    if (is_dir($path) === true)
                $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST);

        foreach ($files as $file)
                        if ($file->isDir() === true)

                        else if (($file->isFile() === true) || ($file->isLink() === true))

        return rmdir($path);

    else if ((is_file($path) === true) || (is_link($path) === true))
        return unlink($path);

    return false;
Last edited 8 months ago by 9primus (previous) (diff)

This ticket was mentioned in Slack in #core by sergey. View the logs.

8 months ago

#7 @SergeyBiryukov
8 months ago

  • Milestone changed from Awaiting Review to 5.8

Hi @9primus, thanks for the patch! Moving to the milestone for visibility and review.

#8 @poena
4 months ago

  • Milestone changed from 5.8 to Future Release


I was not able to apply the patch.
I am not able to help answer your question but I can give you some small pieces of feedback and links to resources.

You do not need to include the changes to package-lock.json in the patch.

Do not leave unused, commented out code in the patch.

Make sure that the code is secure.
Here are some resources for learning about security:

Follow the WordPress coding standards.

Follow the naming conventions:

Make sure that all the text is wrapped in translation functions.

Because there is not enough time to refresh and test the patch for this enhancement before the 5.8 feature freeze I am moving it to future release.

#9 @SergeyBiryukov
4 months ago

In addition to the above comment, the patch should use existing core functionality as much as possible, for example the delete_theme() function, instead of trying to reimplement it in another place.

Some screenshots with the patch applied would also be helpful.

#10 @SergeyBiryukov
2 months ago

#53796 was marked as a duplicate.

Note: See TracTickets for help on using tickets.