What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Changing a WordPress theme through phpMyAdmin is a direct database-level fix for situations where the admin dashboard is unavailable, a theme update has caused a fatal error, or a broken custom theme prevents the site from loading. Instead of logging into WordPress, you update the stored theme settings in the site’s database so WordPress loads a different installed theme.
This method is useful, but it requires care because an incorrect database value can keep the site broken or point WordPress to a theme folder that does not exist. The safest approach is to back up the database first, confirm the exact folder name of the theme you want to activate, then update the relevant template and stylesheet entries in the WordPress options table.
As an Amazon Associate I earn from qualifying purchases.
When to Change a WordPress Theme via phpMyAdmin
Changing a WordPress theme through phpMyAdmin is most useful when you cannot reach the WordPress admin area to switch themes normally. In a healthy site, the safer route is always Appearance > Themes, because WordPress can validate the theme, run its usual checks, and update related settings cleanly. Database editing is a recovery method for situations where the dashboard is unavailable, broken, or blocked by a theme-related fatal error.
A common case is a white screen, critical error message, or HTTP 500 error that appears immediately after activating or updating a theme. If the active theme contains incompatible PHP code, depends on a missing plugin, or was only partially uploaded, WordPress may fail before you can log in. Updating the theme values in the database lets you force WordPress to load a known working theme, such as a default Twenty Twenty-style theme already installed on the server.
#1 Best Overall
This method is also useful after a migration or restore where the database points to a theme folder that does not exist in wp-content/themes. For example, the database may still reference my-old-theme, but the files were not copied to the new server. In that case, WordPress cannot load the active theme correctly. Setting the database values to an installed theme folder name can bring the site back online long enough to finish the migration or reinstall the preferred theme.
Situations where this approach makes sense
- The admin dashboard will not load after a theme activation, update, or file edit.
- A theme directory is missing from wp-content/themes but is still listed as active in the database.
- A custom or premium theme is causing fatal errors and you need to switch to a default theme without using wp-admin.
- A staging or migrated site has mismatched files and database values, causing WordPress to look for the wrong theme folder.
- You are locked out by a broken theme function that interferes with login, admin pages, or front-end rendering.
Use phpMyAdmin carefully because you are editing live WordPress configuration values directly. A small typo in the wrong row can create a new problem or make troubleshooting harder. The theme values must match the folder name of an installed theme exactly, including hyphens and capitalization as stored on the server. If the replacement theme is not present in wp-content/themes, WordPress still will not be able to load it.
It is also worth understanding that this change only switches the active theme reference. It does not install missing theme files, repair broken PHP, restore customizer settings, or replace page builder templates. After the site loads again, you should log in to WordPress, confirm the active theme under Appearance > Themes, check the front end, and then decide whether to repair, reinstall, or remove the faulty theme.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Before You Start: Back Up the Database and Identify the Theme Folder
Before editing anything in phpMyAdmin, create a fresh database backup. Changing the active WordPress theme in the database usually involves only two rows, but a typo, wrong database selection, or accidental edit can take the site offline. A backup gives you a clean restore point if the change does not work as expected.
In your hosting control panel, open phpMyAdmin, select the WordPress database, and use the Export tab to download a copy. For most sites, the Quick export method with SQL format is enough. If your host provides a separate backup tool, you can use that as well, but make sure the backup includes the database used by the WordPress installation you are about to edit.
Confirm the correct theme folder name
WordPress stores the active theme using the theme’s folder name, not the display name shown in the dashboard. For example, the theme displayed as “Twenty Twenty-Four” uses the folder name twentytwentyfour. If you enter the wrong value in the database, WordPress may fail to load the theme properly.
To find the folder name, connect to the site using your hosting file manager or an FTP/SFTP client and open:
Recommended Free Tools
- wp-content/themes/
Inside that directory, you should see one folder for each installed theme. Choose a theme folder that definitely exists on the server. If you are switching away from a broken custom theme, a bundled WordPress default theme is usually the safest target, such as twentytwentyfour, twentytwentythree, or twentytwentytwo, depending on what is installed.
Rank #2
Check whether the site uses a child theme
If the current site uses a child theme, WordPress may store different values for the parent theme and child theme. The template value normally points to the parent theme folder, while the stylesheet value points to the active child theme folder. When switching to a standard default theme, both values are usually set to the same folder name, such as twentytwentyfour.
| Database option | What it usually contains | Example |
|---|---|---|
| template | Parent theme folder | twentytwentyfour |
| stylesheet | Active theme or child theme folder | twentytwentyfour |
Also confirm the table prefix before making changes. Many WordPress sites use wp_options, but some installations use a custom prefix such as abc_options. If there are mulle databases or multiple WordPress installs on the same hosting account, check the site’s wp-config.php file for the database name and table prefix. This helps ensure you update the correct options for the correct site.
Open phpMyAdmin and Select the Correct WordPress Database
After you have a database backup and the correct theme folder name, the next step is to open phpMyAdmin from your hosting control panel and make sure you are working in the right WordPress database. This matters because many hosting accounts contain more than one database, especially if you have staging sites, old WordPress installs, subdomains, or mulle websites under the same account. Editing the wrong database will not change the site you are trying to fix, and it can accidentally affect another installation.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesIn most hosting dashboards, phpMyAdmin is available from a section named Databases, MySQL Databases, or Advanced. In cPanel, for example, you can usually open phpMyAdmin directly from the Databases area. Managed WordPress hosts may place it inside a site-specific tools panel, often under labels such as Database Access, DB Admin, or phpMyAdmin. Once phpMyAdmin opens, you should see a left-hand sidebar listing one or more databases.
Before clicking around tables, confirm which database belongs to the WordPress site you want to edit. The most reliable way is to check the site’s wp-config.php file through your host’s file manager or an FTP/SFTP client. In that file, look for the database name in the line that defines DB_NAME. It will look similar to define( 'DB_NAME', 'example_database' );. The value inside the second set of quotes is the database you need to select in phpMyAdmin.
- DB_NAME identifies the WordPress database to open in phpMyAdmin.
- DB_USER identifies the database user, which can help distinguish similar installations but is not the database name.
- $table_prefix identifies the table prefix, such as
wp_,wpx7_, or another custom prefix.
After selecting the matching database in phpMyAdmin, look at the tables that appear in the main panel. A typical WordPress database includes tables such as wp_options, wp_posts, wp_users, and wp_postmeta, although the prefix may be different. If your wp-config.php file shows $table_prefix = 'abc_';, then the options table will be named abc_options rather than wp_options. This prefix is especially relevant on older sites, security-hardened installs, or multisite-related environments.
If you see several databases with similar names, compare both the database name and the table prefix before making any changes. You can also open the options table and check values such as siteurl and home to confirm the domain matches the site you are repairing. Once you have selected the correct database and identified the correct options table, you are ready to locate the rows that control the active theme.
Find the template and stylesheet Values in the wp_options Table
After selecting the correct WordPress database in phpMyAdmin, the next step is to locate the two option rows that control which theme WordPress loads: template and stylesheet. These values are stored in the wp_options table, although the table prefix may be different on your site. For example, if your installation uses a custom prefix, the table may be named abc_options, site_options, or something similar instead of wp_options.
In phpMyAdmin, look in the left-hand database table list and click the options table for the WordPress installation you are editing. Once the table opens, use the Search tab or the filter box, depending on your phpMyAdmin version, to find rows where option_name equals template and stylesheet. These rows are usually near each other if you browse the table by option name, but searching is safer because the options table can contain hundreds or thousands of entries.
What the two values mean
The template value tells WordPress which parent theme folder to use for theme files. The stylesheet value tells WordPress which theme folder to use for styles and, in the case of a child theme, the child theme directory. On a normal non-child theme setup, both values are usually identical. For example, if the active theme folder is twentytwentyfour, both template and stylesheet will typically contain twentytwentyfour.
| option_name | option_value | Purpose |
|---|---|---|
| template | twentytwentyfour | Loads the parent theme directory |
| stylesheet | twentytwentyfour | Loads the active theme stylesheet directory |
If the site uses a child theme, the values may be different. For example, template might be twentytwentyfour, while stylesheet might be my-child-theme. This means WordPress loads parent theme files from /wp-content/themes/twentytwentyfour/ while using the child theme in /wp-content/themes/my-child-theme/. Do not guess these names from the theme’s display name in the dashboard; use the exact folder names found in wp-content/themes.
How to locate the rows with SQL
If browsing the table is slow, you can use the SQL tab in phpMyAdmin to find both rows at once. Replace wp_options with your actual options table name if your database uses a different prefix.
SELECT option_name, option_value FROM wp_options WHERE option_name IN (‘template’, ‘stylesheet’);
The result should show two rows. Review the current option_value entries before editing anything. If one or both rows are missing, confirm that you selected the correct database and options table. In a standard single-site WordPress install, these rows should exist in the main options table. In a multisite installation, each site has its own numbered options table, such as wp_2_options, so make sure you are editing the table for the affected site rather than the network’s main site.
At this stage, you are only identifying the active theme values, not changing them yet. Keeping the current values visible or copied into a temporary text file makes it easier to reverse the change if the replacement theme does not load as expected.
Free tools Windows power users keep installed
One-click scans. No signup required.
Update the Active Theme Values to a Default or Installed Theme
After locating the template and stylesheet rows in the WordPress options table, update both values to the folder name of a theme that already exists in wp-content/themes. The value must be the directory name, not the display name shown in the WordPress dashboard. For example, use twentytwentyfour, not “Twenty Twenty-Four.” If the folder name is misspelled, uses the wrong capitalization on a case-sensitive server, or points to a theme that is not installed, WordPress may continue showing an error or load without the expected theme files.
Rank #4
In phpMyAdmin, click Edit next to the template row. In the option_value field, replace the current value with the target theme folder name, then save the row. Repeat the same process for the stylesheet row. For most normal themes, these two values should match. For instance, switching to the Twenty Twenty-Four theme usually means setting both rows to twentytwentyfour.
| Option name | Example value | What it controls |
|---|---|---|
| template | twentytwentyfour | The parent theme directory WordPress loads |
| stylesheet | twentytwentyfour | The active theme directory used for styles and templates |
If you are switching to a child theme, the values are different. Set template to the parent theme folder and stylesheet to the child theme folder. For example, if the parent theme folder is twentytwentyfour and the child theme folder is my-child-theme, the template value should be twentytwentyfour while stylesheet should be my-child-theme. Only use this setup if the child theme folder is present and its style file correctly declares the parent template.
- Use a default WordPress theme if you are recovering from a broken or missing custom theme.
- Use an installed custom theme only if you have confirmed its folder exists on the server.
- Do not enter the theme’s display title, author name, ZIP filename, or full server path.
- Update both rows in the same table and database, especially on hosts with multiple WordPress installations.
Some phpMyAdmin setups also allow inline editing. If you use inline editing, double-check that the change is saved before leaving the table view. phpMyAdmin may show a success message, or the updated value may appear immediately in the row list. If your WordPress table prefix is not wp_, the table may be named something like site_options, wpx7_options, or another custom prefix followed by options; the option names remain template and stylesheet.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →For multisite networks, changing these rows in one options table affects only that specific site, not every site in the network. Each site has its own options table, such as wp_2_options or wp_3_options. Make sure you edit the table for the affected site. After saving the new values, leave phpMyAdmin open until you have tested the front end and admin area, so you can quickly correct the entries if the selected theme folder was not valid.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Clear Caches and Verify the Site Loads Correctly
After you update the template and stylesheet rows in the WordPress database, do not assume the change is visible immediately. WordPress, your hosting platform, a caching plugin, a CDN, and even your browser may still serve files generated by the previous theme. Clearing these cached layers helps you confirm whether the database edit worked and whether the new active theme can load without errors.
Clear the common cache layers
Start with the cache closest to WordPress, then move outward. If you can still access the WordPress admin area, open the settings page for your caching or performance plugin and purge all cache. This may apply to plugins such as WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache, SG Optimizer, or similar tools. If the admin area is unavailable, you can usually clear plugin cache by using your hosting file manager or FTP to remove cache files from plugin-specific folders under wp-content/cache/. Be careful to delete only cache contents, not plugin folders or theme folders.
- Plugin cache: Purge all cached pages, minified CSS, minified JavaScript, and object cache if your plugin provides those controls.
- Host cache: Use your hosting control panel to clear server cache, page cache, or LiteSpeed/Varnish cache if enabled.
- CDN cache: If the site uses Cloudflare, Bunny CDN, or another CDN, purge the affected URL or perform a full cache purge during testing.
- Browser cache: Test in a private window, use a hard refresh, or open the site in a different browser to avoid viewing stale assets.
Once caches are cleared, visit the front end of the site first. Check the home page, a single post or page, the login page, and any critical template-driven areas such as WooCommerce product pages, archives, or custom post type pages. If the site loads with the replacement theme, the database values are being read correctly. If the layout looks unstyled, broken, or partially loaded, inspect whether the selected theme folder exists in wp-content/themes/ and whether the theme has a valid style.css file.
Confirm the active theme in WordPress
If you can access the dashboard, go to Appearance > Themes and confirm that the expected theme is marked as active. For a block theme, also check Appearance > Editor if available. For a classic theme, review menus, widgets, and theme-specific settings, because switching themes may change widget areas, menu assignments, header images, or customizer settings. The site may be technically fixed but still require visual cleanup.
Best Value
| What you see | What to check next |
|---|---|
| White screen or fatal error | Enable debugging, check the PHP error log, and confirm the replacement theme is compatible with the site’s PHP and WordPress versions. |
| Old theme still appears | Purge plugin, host, CDN, and browser caches again, then confirm the database prefix and edited rows were correct. |
| Unstyled or missing layout | Verify the theme folder name exactly matches the template and stylesheet values, including capitalization on case-sensitive servers. |
| Dashboard works but front end fails | Temporarily disable cache and optimization plugins, then retest with a default theme such as twentytwentyfour. |
If the replacement theme loads correctly, leave it active long enough to regain access and repair the original theme, update plugins, or restore missing files. Avoid immediately switching back to the broken theme until you know what caused the failure. If the site still does not load after using a known installed default theme, the problem may not be the active theme value; check plugin conflicts, corrupted core files, PHP version mismatches, or server-level errors before making further database changes.
Frequently Asked Questions
What values do I need to change in phpMyAdmin to switch the WordPress theme?
In the WordPress database, open the options table, usually named wp_options, and look for the rows named template and stylesheet. Set both option_value fields to the folder name of the theme you want to activate, such as twentytwentyfour. The folder name must match the theme directory exactly as it appears in wp-content/themes.
Should template and stylesheet always have the same value?
For a regular theme, both values should be the same theme folder name. For a child theme, stylesheet should be the child theme folder, while template should be the parent theme folder. If these are set incorrectly, WordPress may load a blank page or fail to apply the expected theme files.
How do I know which WordPress database to edit in phpMyAdmin?
Check the wp-config.php file for the DB_NAME value, which tells you the exact database used by the site. This matters on hosting accounts with mulle WordPress installs or staging sites. Also confirm the table prefix, because it may be something other than wp_, such as site_options or customprefix_options.
Can I use this method if I cannot access the WordPress admin dashboard?
Yes, changing the theme in phpMyAdmin is useful when a broken theme causes a fatal error, white screen, or locked admin area. Switch to a default WordPress theme that is already installed on the server, such as Twenty Twenty-Four. If the default theme is not present in wp-content/themes, upload it first using FTP or your hosting file manager.
What should I do after changing the theme values in the database?
Clear any caching plugins, server cache, CDN cache, and browser cache before testing the site. Then load the homepage and wp-admin to confirm the site is accessible. If the site still fails, recheck the exact theme folder names and restore your database backup if needed.
Bottom Line
Changing a WordPress theme through phpMyAdmin is a practical recovery method when the dashboard is inaccessible, a theme update breaks the site, or you need to quickly switch back to a default theme. The key is to edit the correct rows in the wp_options table—usually template and stylesheet—using the exact folder name of an installed theme.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchBefore making changes, confirm the correct database, take a backup, and avoid editing unrelated values. After saving, clear caches, load the site in a private browser window, and log in to WordPress to verify everything works before making further adjustments.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




