Have you ever lost access to your WordPress site? You may see several different errors, a Critical Error in WordPress, an HTTP 500 Error, weird CSS on pages. If you have a Critical Error on your page or the HTTP 500 Error, you can also diagnose that within the error_log file within your cPanel. You may also lose access to your wp-admin dashboard to change the theme as well.
This guide will walk you through changing your theme from the database, similarly to fixing a blank screen in WordPress.
To start, you want to locate your database. This can be found within the wp-config.php file or within your Installatron instance for the site:
You'll then want to navigate to PHPMyAdmin (I'm using cPanel in this instance).
Within the database, you'll want to move to the wp_options table and locate the template and stylesheet. They typically are within the same lines as each other.
Next, you'll want to locate the theme you'd like to change to. This is found in the wp-content/themes folder of the install. Any of the WordPress themes like twentytwentyone or twentytwentytwo will work. WordPress will default to these themes when working on an error.
Back in PHPMyAdmin, you can double click on the previous theme name and change it to the new theme.
Click out of the box and do the same for the template/stylesheet rows. Once changed your site should start to load again and you can begin to troubleshoot from there!