Changing a WordPress Theme in the Database

Sometimes new changes such as plugins or updates are simply not compatible with your current theme. Often, with this incompatibility, you are unable to enter the admin area to switch the theme. This can leave you in a circular problem as you need to change the theme in order to get into the admin area. In this scenario you will need to change it directly in the database. This article will guide you on how to do that within your WordPress site.

Changing your theme within phpMyadmin

  1. Log into your cPanel interface.
  2. edu wordpress 345 phpmyadmin plLook for the Databases category and click on the phpMyadmin icon.
  3. edu wordpress 345 2 select databaseOnce inside the phpMyadmin look to the left hand sidebar and click on your specific wordpress database.
  4. edu wordpress 345 3 select options tableFrom there, select the wp_options table.
  5. Once the table is opened, look to the tab menu on the screen and click on the Browse tab option. This allows you to browse the columns broken down into pages. Click on the Show All option at the top so it will list all the columns on one page.
  6. edu wordpress 345 4 select columnNext, you will need to locate two rows on the page, the template and the stylesheet. Pick template and click on the Edit link.
  7. This will take you to the edit page where we will change the data for the option_value. In our example, the value is set for the alexandira template. Change this to the default theme name, twentythirteen and click on the Go button at the bottom of the page.
  8. Perform the same procedure on the stylesheet row. When you finish the stylesheet and return to the list, you should see the new theme in the value portion of the list for both. You can now visit your website and see that it is using the default theme. From here you should also be able to log into your wp-admin area.
    edu wordpress 345 before

    edu wordpress 345 after

Learn more about the power of WordPress Themes and how they can simplify your website building and maintenance.

Thoughts on “Changing a WordPress Theme in the Database

  • Hello…

    I have to thank you…yesterday I got an error, website not working on chrome, on firefox I got a blank white page…with a little search on google, the problem is supposed to be in the header as suggested, but I couldn’t log in to admin area, so I changed the theme to WordPress default theme…once I did it the problem resolved…you saved my day…thank you so much…

  • Hey i created my website on wordpress and by mistakly i deleted all data from public.html folder and then i uninstalled previous wordpress account and created another one from cpanel now i am not able to change my theam and i tried these steps and still my website is not showing any theame.

    • I am new here and the page of phpMyadmin is empty and I wanna select a proper theme to match y insurance business Any help?

  • I tried posting a second ago but i guess it didn’t post.. 

    Ive done what you suggested but it has not changed my issue of not accessing my admin page or website being down.


    my site is www austeremag com

    my website is experiencing this error:

    Fatal error: Cannot redeclare df_magz_custom_header_setup() (previously declared in /customers/1/1/4/ in /customers/1/1/4/ on line 32


    please any help is massively appreciated!!

    • Hello Natasha,

      Sorry for the problem with the theme. You will need to disable the theme that’s being used. You can do that via the database. Once you have the theme cleared, then you should be able to access your site normally again. In order to fix the issue, you will need to contact the theme developer.

      If you have any further questions or comments, please let us know.

      Arnel C.

  • Hmmm.  Template and stylesheet not showing up in wp_options list so there is nowhere to change the default theme. Now what to do? My error message says directory not found. The only way I can acces my WP admin panel is to designate Themes_old in cpanel and then no themes are present in the WP admin panel. When I do that I go from a completely white screen to a white screen with the error message, so I’m assuming it does indeed have to do with theme access. But Template and stylesheet don’t show up in wp-options regardless of whether I use Themes or Themes_old. 

    • Be sure you are looking through the entire wo_options table. The columns are paginated, so in my database I found them on the second page of columns.

    • The above guide should help you accomplish that. Are you having trouble with a specific step?

      Thank you,

  • Thank you so much . Really nice trick. i wested one week to solve this problem. after ref your post imediately i solve this error.

  • Excellent solution and step by step instruction. I was lucky i landed in this post. Saved me a lot of time and rectified the issue instantly. Thanks and appreciate.

  • Excellent advice, got me out of a hole when a subscription to a paid theme expired and it stopped working.

    Followed your instructions and it worked a dream.

  • how to know the name of theme and plugin is used in wordpress website. If any way to know this please tell me.

    • The article above goes over how to find the name of the theme in the database. To find your plugins, look in the wp-content/plugins folder.

  • This worked for me. Although, once you’re in the theme I had to go to the /wp-admin (dashboard) and activate a different theme, and re-activate the theme that I wanted after. There were some lingering issues that it was reading the old theme if I didn’t do it this way.

  • Hello thank you but this is my own problem. i have been trying to solve it. oplease help

    Warning: require(/home/softimpa/public_html/wp-includes/functions.php) [function.require]: failed to open stream: No such file or directory in/home/softimpa/public_html/wp-settings.php on line 72

    Fatal error: require() [function.require]: Failed opening required ‘/home/softimpa/public_html/wp-includes/functions.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/softimpa/public_html/wp-settings.php on line 72

    • Hello Aity,

      The error message “No such file or directory” means that either a path is incorrect or the file is missing. Did you move the installation over from another location? Did you do an update?

      Kindest Regards,
      Scott M

  • I was trying to change from the Ultimatum theme to any of the themes that come with Word press. I tried twenty thirteen, blank canvas, etc. I have tried to change them through the c-panel just as the instructions above have stated and also tried directly through wordpress itself. What I’m not sure of is do I have to put the integration link into the pages or should things roll over because they are in the c-panel. Again, we don’t control the c-panel, but we do have access to it.

  • Thank you TJ, however, I did follow all of the previous comment/suggestions before I contacted your site. Like in my previous comment, I have gone into the Cpanel as well as just wordpress and tried to make changes. As easy as it is for anyone else to do it, it just seems so compicated when I try to. Either I have to take the new theme and “tweek” it to my liking or it doesn’t work at all. All of the main themes are downloaded into the cpanel and when I have followed the instructions previously the new theme doesn’t act correctly. I was under the impression that if all of the files are in the cpanel and the themes are there, I should be able to just change the theme and bam! New theme. What else could I be doing wrong?

    Thank you so much in advance. 

    • Hello Tracy,

      Unfortunately, you’re not giving us any specifics about what you’re doing. How are you making changes to a theme? Are you changing them in the editor? Are you making changes with the WordPress interface? What theme are you referring to? Many custom themes have different interfaces that may affect how they are modified. Please give us some further info in order for us to help you .

      Arnel C.

  • Hello, I have read just about everything there is to read about changing a theme in wordpress. My problem is that our wordpress is connected to a cpanel (not so tough, right) so that I should be able to follow all the steps above and change it to a new theme. It works as far as going to the new theme, however, my question is, do I have to fine tune the new theme? Our Cpanel is run through a company, however, I have access to it, and have been playing around with it. I see that I can change the theme either on the Cpanel or through wordpress. What I don’t see is all the changes happen.

    • Hello Tracy,

      When you make any changes to the theme and you are not seeing changes then your browser may be cached. Please be sure to clear your browsers cache and wordpress cache (if you have a caching plugin enabled).

      Best Regards,
      TJ Edens

  • I followed the steps and it works, however my second problem now is all of the assets are 404, couldn’t read the css, js and images. PLease help.

    I’m using wordpress from GoDaddy.

    • Hello Ricky,

      Thank you for contacting us about 404 errors after changing your theme. We are happy to help, but will need some additional information. Did you try the Common WordPress Troubleshooting Techniques?

      Have you tried changing the permalinks? For example, changing to a different option, then changing back.

      What theme were you installing? What theme did you have before?

      Can you provide a link to the site, so we can view the error?

      Thank you,

  • I never comment because I am a weird sort of person. But you are a life safer. Thank you very much sir. You saved my work.

    I installed a theme which was corrupt and I didnt even have the backup.

    You rock. thanks again.

  • Don’t forget to mention that you will need to use the theme’s ‘text_domain’ as the name, because the actual name won’t work.

  • Thanks a lot.  Helped me out of a jam and got me going again.

    There may be serveral references in the article to “column” when I think what was meant was “row” ?

    • Hello Tray,

      Thank you for your comment. I removed/changed some of the incorrect instances of “column” in the article.

      If you have any more suggestions, let us know.

      Thank you,

Was this article helpful? Let us know!