Upgrading a custom theme through the Dashboard

I can’t seem to upgrade my custom theme. Whenever I try to uploaded a new package, all I get is:

Unpacking the package…
Installing the theme…
Destination folder
already exists. /wp-content/themes/THEMENAME/
Theme install failed.

Read More

I’ve searched and all I can find is people recommending upgrading over FTP. Sadly, I don’t have FTP access right now, but also using FTP appears to be a dirty solution. I can obviously delete and re-install the theme, but that seems very dirty, too.

How can I update a theme through the Dashboard?

Related posts

Leave a Reply

1 comment

  1. It fails because there is already a theme with that name on the server.

    So the obvious solution is to remove the theme before you upload the new version.

    If you’re wanting to use an update mechanism like the theme repo, but on a custom theme, there are udpater classes you can add, such as this one:

    https://github.com/UCF/Theme-Updater

    That particular one uses github as its source, but there are various alternatives that use other sources

    A few notes for anyone else with similar issues, pitfalls of using the backend to install and manage code:

    • Doing this is incredibly bad practice
    • If your host won’t give you FTP access, your host must be pretty awful. I strongly recommend you switch providers.
    • You should not be able to add or install plugins via the dashboard, this indicates those folders are writable and is a massive security risk
    • If you have made a mistake in your theme ( it happens to the best of us ) and the functions.php has a syntax error etc, your site will be dead. You won’t be able to login via the backend to edit the files or upload a new version or switch to a working theme.

    Similar if not identical issues apply to plugins also.