{"id":1251,"date":"2017-03-17T20:01:25","date_gmt":"2017-03-17T14:31:25","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1251"},"modified":"2026-09-12T18:09:39","modified_gmt":"2026-09-12T12:39:39","slug":"change-wordpress-themes-backend","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/change-wordpress-themes-backend\/","title":{"rendered":"How to Change a WordPress Theme from the Backend"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are situations where we may not be able to access the WordPress admin panel due to various issues, such as a broken theme, plugin conflicts, or login problems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In such cases, we can change the active WordPress theme directly from the backend using <strong>MySQL\/MariaDB<\/strong>. This can be done through <strong>phpMyAdmin<\/strong> or the MySQL\/MariaDB command line.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, we will explain how to change the active WordPress theme from the backend.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before proceeding, make sure you have:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A WordPress installation.<\/li>\n\n\n\n<li>SSH access to the server, or access to phpMyAdmin.<\/li>\n\n\n\n<li>MySQL\/MariaDB command-line access, if required.<\/li>\n\n\n\n<li>The theme that you want to activate must already exist under:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>wp-content\/themes\/<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Access the WordPress Database<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Log in to the server through SSH, or access the WordPress database using <strong>phpMyAdmin<\/strong> or the <strong>MySQL\/MariaDB command line<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before making any database changes, it is recommended to take a backup of the WordPress database.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Identify the Theme<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In this example, we are going to activate the <code>twentysixteen<\/code> theme.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure the corresponding theme directory exists:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp-content\/themes\/twentysixteen<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to activate a different theme, replace <code>twentysixteen<\/code> with the appropriate theme directory name.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Update the WordPress Theme<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following queries against the WordPress database:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">UPDATE wp_options SET option_value = 'twentysixteen' WHERE option_name = 'template';<br><br>UPDATE wp_options SET option_value = 'twentysixteen' WHERE option_name = 'stylesheet';<br><br>UPDATE wp_options SET option_value = 'twentysixteen' WHERE option_name = 'current_theme';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If your WordPress database uses a custom table prefix, replace <code>wp_options<\/code> with the appropriate table name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if the table prefix is <code>wpabc_<\/code>, use:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">UPDATE wpabc_options SET option_value = 'twentysixteen' WHERE option_name = 'template';<br><br>UPDATE wpabc_options SET option_value = 'twentysixteen' WHERE option_name = 'stylesheet';<br><br>UPDATE wpabc_options SET option_value = 'twentysixteen' WHERE option_name = 'current_theme';<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Verify the Website<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After executing the queries, access the WordPress website and verify that the new theme is active.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the website is using caching, clear the relevant WordPress, server, or CDN cache before testing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Changing the WordPress theme directly from the backend is useful when the WordPress admin panel is inaccessible. By updating the relevant values in the <code>wp_options<\/code> table, we can activate an existing theme without accessing the WordPress dashboard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Always make sure that the theme directory exists under <code>wp-content\/themes\/<\/code> and take a database backup before making direct database changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Can I change the WordPress theme without accessing the WordPress admin panel?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. The active theme can be changed directly through the WordPress database using phpMyAdmin or the MySQL\/MariaDB command line.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Where are WordPress themes stored?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress themes are normally stored under:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp-content\/themes\/<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. What should I replace <code>twentysixteen<\/code> with?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>twentysixteen<\/code> with the <strong>theme directory name<\/strong> of the theme you want to activate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">UPDATE wp_options SET option_value = 'astra' WHERE option_name = 'template';<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Related Article<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-do-wordpress-website-migration-from-domain-to-subdomain\/\">How to do WordPress website migration from domain to subdomain &#8211; Pheonix Solutions<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-reset-the-wordpress-password-in-mysql\/\">How to reset the WordPress password in Mysql &#8211; Pheonix Solutions<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Have a technology challenge or looking for the right solution for your business? Our team can help you with&nbsp;<strong>cloud, DevOps, development, infrastructure, design, and more<\/strong>. Feel free to reach out to our experts&nbsp;<a href=\"https:\/\/pheonixsolutions.com\/contact\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction There are situations where we may not be able to access the WordPress admin panel due to various issues, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[167],"class_list":["post-1251","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-wordpress-2","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-kb","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1251"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1251\/revisions"}],"predecessor-version":[{"id":11728,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1251\/revisions\/11728"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}