Blog

Solved – Unable to Load Theme by Specified Key Error in Magento 2

You have been seeing this error lately. It says “unable to load theme by specified key“.

 

Let’s understand what is the cause of this, and how to fix this?

The cause of Unable to load theme by specified key error

The root of this error is:- You are having one or more theme deleted in your code, but not fully deleted in related table(s) in your site’s Database.

There are two common scenarios when you encounter this error.

  • The first one is when you migrate Magento version 1 to Magento version 2, and the theme you were using did not support Magento version 2.
  • The second one is when you delete your theme not thoroughly.

Either way, you would be advised to fix the error by one simple way.

 

Solution:

In order to fix this error, you have to remove the row of the theme with the key in the error log in the core_config_data table.

You can either do this via SSH or SQL Admin tools.

Using SSH

For those of you who are more experienced and want to get things done fast, use SSH.

  • Open a Terminal Emulator such as PuTTY. Log in to your SQL account.
  • Then input:
    delete from core_config_data where path = 'design/theme/theme_id' and value = '<your key>';
  • Note: <your key> here is the key in the error log. With the example above, <your key> is 4.

 

  • Then flush cache.

Using PHPMYADMIN

Select the database, Then Run below command in the SQL:

delete from core_config_data where path = 'design/theme/theme_id' and value = '<your key>';

Then flush cache.

That’s it.

Comment below giving feedback.

Happy Learning !!

Thank You !!

One thought on “Solved – Unable to Load Theme by Specified Key Error in Magento 2

  1. I had this error playing with multiple databases on development. Simply running setup:upgrade solved my issue, might even just been a cache mismatch

Leave a Reply

Your email address will not be published. Required fields are marked *