[wp-trac] [WordPress Trac] #63737: Theme update fails, creates duplicate directory after incorrect plugin update attempt
WordPress Trac
noreply at wordpress.org
Thu Jul 24 16:34:02 UTC 2025
#63737: Theme update fails, creates duplicate directory after incorrect plugin
update attempt
-------------------------------------------------+-------------------------
Reporter: leemon | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: Upgrade/Install | Version: 6.8.2
Severity: normal | Resolution:
Keywords: has-test-info has-screenshots | Focuses:
reporter-feedback close |
-------------------------------------------------+-------------------------
Comment (by leemon):
I've been testing this issue further, and it appears the behavior I
described is related to the **structure of the theme's ZIP file**.
I tested the reproduction steps with a default theme (like **Twenty
Twenty-One**), and it **does not** exhibit the bug. When attempting the
incorrect plugin update and then the correct theme update, Twenty Twenty-
One updates as expected, overwriting the existing theme folder.
The key difference I found is how the ZIP files are structured:
* The Twenty Twenty-One ZIP file contains a root folder named
`twentytwentyone`, and all the theme files are **inside** that folder.
* My custom theme's ZIP file, which initially caused the issue, had its
theme files directly at the root of the ZIP, **not inside any containing
folder**.
When I re-zipped my custom theme's files so that they were **inside a
folder named `my-theme`** (matching the theme's slug) at the root of the
ZIP, the issue disappeared. Now, after an incorrect plugin update attempt,
the subsequent theme update works as expected, correctly overwriting the
`wp-content/themes/my-theme` directory.
It seems that the presence of a containing folder within the theme ZIP is
crucial for WordPress to correctly handle the update process, especially
after a failed attempt in the wrong installer. This might indicate an
expectation in the installer's logic that anticipates a single root
directory within the uploaded ZIP for themes.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63737#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list