How to change the active WordPress theme from phpMyAdmin in cPanel
If your site stops opening after you update or switch the theme, you can roll back to a default theme from phpMyAdmin without logging in to /wp-admin. This method helps when you see a white screen, a fatal PHP error, a theme that broke after an update, or a dashboard you can no longer reach.
Take it slow: you will edit two database values. Before changing them, export a copy so you can return to the previous state if something does not work as expected.
Before you start
- Have access to cPanel for the account where the site is installed.
- Identify the site folder, usually
public_htmlor the domain folder. - Have the folder name of an already installed default theme ready, for example
twentytwentyfourortwentytwentythree. - If you are not sure which database the site uses, open
wp-config.phpfor reference only and copy theDB_NAMEvalue.
Steps
- Log in to cPanel and open phpMyAdmin from the databases section.
- If you need to confirm the right database, first open File Manager, go to the site folder, and check
DB_NAMEand$table_prefixinsidewp-config.php. - In the left panel of phpMyAdmin, select the database that matches
DB_NAME. - Export the database before making changes: use Export, SQL format, and save the file on your computer.
- Find the table that ends in
_options. The prefix can vary, for examplewp_options,nh_options, or a custom one. - Inside that table, find the
templaterow and thestylesheetrow in theoption_namecolumn. - Edit the
templaterow and replace itsoption_valuewith the exact folder name of the default theme, for exampletwentytwentyfour. - Edit the
stylesheetrow and set the same folder name, for exampletwentytwentyfour. - Save each change and open the site in a private window to confirm it loads.
- If the site opens, log in to
/wp-admin/and use Appearance → Themes to choose or repair the theme you want to use.
Final verification
- The site stops showing the white screen or fatal error and loads again.
- The
templateandstylesheetrows point to the same installed theme folder. - You can access
/wp-admin/and see the default theme active. - From Appearance → Themes you can activate another theme without the site breaking again.
Common errors
- The site is still blank after saving → the folder name does not match or that theme is not installed → check the exact name of an existing folder in
wp-content/themes/and use it in both rows. - You cannot find the
wp_optionstable → your installation uses another prefix → look for the table that ends in_optionsinside the correct database. - No default theme is installed → download an official theme and upload it to
wp-content/themes/with File Manager before editing the rows. - The problem persists with a clean theme → the cause may be a plugin → disable plugins from phpMyAdmin and try again.
Recommended reading
Still need help?
If this guide didn’t solve your issue, our team can help you via ticket.