{"id":3938,"date":"2026-05-26T11:49:00","date_gmt":"2026-05-26T10:49:00","guid":{"rendered":"https:\/\/www.4uhosting.co.uk\/articles\/knowledgebase\/change-a-wordpress-theme-in-the-database\/"},"modified":"2026-08-19T14:00:31","modified_gmt":"2026-08-19T13:00:31","slug":"change-a-wordpress-theme-in-the-database","status":"publish","type":"kb_article","link":"https:\/\/www.4uhosting.co.uk\/articles\/knowledgebase\/change-a-wordpress-theme-in-the-database\/","title":{"rendered":"Change a WordPress Theme in the Database"},"content":{"rendered":"<p>If a broken WordPress theme stops you from accessing the WordPress dashboard, you can change the active theme directly in the database.<\/p>\n<p>This should only be used as a recovery method. If you can still access WordPress, change the theme from <strong>Appearance<\/strong> &gt; <strong>Themes<\/strong> instead.<\/p>\n<p>Before you start, take a database backup.<\/p>\n<ol>\n<li>Open phpMyAdmin from your hosting control panel.<\/li>\n<li>Select the database used by your WordPress site.<\/li>\n<li>Open the table ending in <code>_options<\/code>.<\/li>\n<li>Find the rows named <code>template<\/code> and <code>stylesheet<\/code>.<\/li>\n<li>Edit the <code>option_value<\/code> for <code>template<\/code>.<\/li>\n<li>Enter the folder name of an installed theme.<\/li>\n<li>Save the change.<\/li>\n<li>Edit the <code>option_value<\/code> for <code>stylesheet<\/code>.<\/li>\n<li>Enter the same theme folder name, unless you are activating a child theme.<\/li>\n<li>Save the change.<\/li>\n<\/ol>\n<p>The theme name must match a folder that already exists in <code>\/wp-content\/themes\/<\/code>. For recovery, it is usually best to switch to a default WordPress theme that is already installed.<\/p>\n<p>The database table prefix may not be <code>wp_<\/code>. If your site uses a custom table prefix, look for the table that ends in <code>_options<\/code>.<\/p>\n<p>After saving the change, reload your website and try to log in to WordPress again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If a broken WordPress theme stops you from accessing the WordPress dashboard, you can change the active theme directly in the database. This should&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"template":"","kb_category":[37],"class_list":["post-3938","kb_article","type-kb_article","status-publish","hentry","kb_category-wordpress"],"_links":{"self":[{"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/kb_article\/3938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/kb_article"}],"about":[{"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/types\/kb_article"}],"author":[{"embeddable":true,"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/kb_article\/3938\/revisions"}],"predecessor-version":[{"id":4050,"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/kb_article\/3938\/revisions\/4050"}],"wp:attachment":[{"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/media?parent=3938"}],"wp:term":[{"taxonomy":"kb_category","embeddable":true,"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/kb_category?post=3938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}