3

I had an awkward problem when i want to delete my theme, it gaves me this message: deletion failed, the theme requested does not exist wordpress.

I can delete it from ftp manually but for client i want it to be deleted just from dashboard. Is any one have an idea how to resolve this error.

enter image description here

P.S. the theme works fine without any error.

2
  • 1
    Can you verify that the permissions on your theme directory (and files) are 644 or more permissive? Also ensure that the theme header in the comments at the top of your theme's style.css is intact and properly formatted. If you changed some of this header information or the theme's directory while the theme was active, you may need to deactivate the theme (and possibly reactivate it). I imagine it's possible that multiple themes with the same header information might confuse WordPress, as well.
    – bosco
    Sep 30, 2016 at 0:28
  • @bosco I checked the style.css header and all eems great even i change them with other theme information, and then i tested it in a new wordpress and i had the same problem. The problem is on local too, so it's not from 644 permission i guess. Sep 30, 2016 at 10:53

3 Answers 3

7

I found what cause this problem, the theme folder shouldn't have any space if you had two words or more on it for example if your theme's name is : twenty sixteen it should be written without space in one word twentysixteen.

So all i had to do is make my theme's name in one word and my theme was deleted normally from the dashboard.

I hope it will help someone else.

1
  • 1
    It's not just spaces. If a theme has dots in the name it also seems to fail. For example, WordPress won't delete a theme in a directory named theme-1.2.3, but it will delete a directory named theme-1_2_3
    – joemaller
    Mar 28, 2017 at 18:52
1

This can also happen if the Theme is moved out of the /themes folder, for example in to a sub-folder.

2
  • 1
    I've never had a Theme Name: match with the actual folder name of the theme. Like similar or whatever, sure, but never an exact match. Feb 11, 2021 at 3:29
  • 1
    After some further testing, I realise my earlier post was wrong. The behaviour was due to the theme being in /themes/temp folder. Moving it back up fixed the problem - it was nothing to do with the naming in the theme editor. Thanks for pointing out the error. Changing the theme name in style.css just changes what WP shows in the Theme Manager. It doesn't have to match the folder name in the filesystem.
    – Grindlay
    Feb 12, 2021 at 14:33
0

Ok, I had the same issue and it started from the FTP prompt when trying to delete a theme. // Note I am doing this on my local environment, not a production site

1st step was to add

define('FS_METHOD', 'direct');

Which then started the Deletion failed: The requested theme does not exist error

screenshot of error

But this is how to solve the whole issue altogether and you don't need the code

define('FS_METHOD', 'direct');

You need to edit the httpd.conf file depending on your setup. Here is how I did it using xampp edit /opt/lampp/etc/httpd.conf

    <IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.  
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User nobody
Group nogroup
</IfModule>

Where the User nobody add your username there example User myuser and restart apache and boom! Hope this helps someone out there with an issue that was taking me hours and a lot of headaches.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.