How to change the active WordPress theme from phpMyAdmin in cPanel

Category: WordPress

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_html or the domain folder.
  • Have the folder name of an already installed default theme ready, for example twentytwentyfour or twentytwentythree.
  • If you are not sure which database the site uses, open wp-config.php for reference only and copy the DB_NAME value.

Steps

  1. Log in to cPanel and open phpMyAdmin from the databases section.
  2. If you need to confirm the right database, first open File Manager, go to the site folder, and check DB_NAME and $table_prefix inside wp-config.php.
  3. In the left panel of phpMyAdmin, select the database that matches DB_NAME.
  4. Export the database before making changes: use Export, SQL format, and save the file on your computer.
  5. Find the table that ends in _options. The prefix can vary, for example wp_options, nh_options, or a custom one.
  6. Inside that table, find the template row and the stylesheet row in the option_name column.
  7. Edit the template row and replace its option_value with the exact folder name of the default theme, for example twentytwentyfour.
  8. Edit the stylesheet row and set the same folder name, for example twentytwentyfour.
  9. Save each change and open the site in a private window to confirm it loads.
  10. 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 template and stylesheet rows 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_options table → your installation uses another prefix → look for the table that ends in _options inside 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.

Still need help?

If this guide didn’t solve your issue, our team can help you via ticket.