Featured image credit: Security Choice
It can be frustrating. You spend lots of time and energy creating and developing your WordPress website only to find it broken. It could have broken for lots of reasons: a corrupted file or a misconfigured or improperly working plugin or theme. You can also have a database error.
The first thing you should do is not panic, no matter how much you may want to. Panic will likely only exacerbate the problem. Instead, take a nice deep breath and follow the guidelines listed here. Though before you do, be sure to back up your site just in case you make things worse. Another benefit of backing up your site (and regularly doing so) is that if something breaks in the future, you can simply restore your site to what it was.
Disable Plugins and/or Themes
Sometimes a WordPress plugin can cause a site to break. To check if this is your problem, you should disable all your WordPress plugins. You can do this through the WordPress Dashboard, but if you cannot access this, you have other options. If you have access to cPanel and are comfortable using it, you can disable plugins by renaming the plugin folder in the File Manager. Alternatively, you can use FTP to rename the plugin folder.
If after disabling all plugins, your site works, then one-by-one reactivate the plugins in the Dashboard until you find the one that is causing the problem. When you have found the culprit, you can either try reinstalling the malfunctioning plugin, or you can remove it from your site.
Similarly, a WordPress theme can cause a site to break, especially if you have customized it. Like with plugins, you can disable a WordPress theme, either through the Dashboard or by disabling access to it. If this is your problem, simply reinstall the original theme.
Repair the WordPress Database
Your WordPress sits is basically a database, with all your content sitting in what are called tables. Databases can become corrupted for a number of reasons, but you can repair it in two ways.
First, download the WordPress configuration file (wp-config.php) using FTP, and with a text editor insert the following statement before the if ( !defined(‘ABSPATH’) ) statement:
define(‘WP_ALLOW_REPAIR’, true);
Afterward, save the file and upload it to your site using FTP. Then, load http://yourwebsite.com/wp-admin/maint/repair.php, replacing yourwebsite.com with the address of your website. A dialog will display asking you whether you want to repair the database or repair and optimize the database. Choose either one, and after it repairs the database, remove the WP_ALLOW_REPAIR from your configuration file and re-upload it.
Alternatively, if you have access to cPanel and are comfortable using it, you can use phpMyAdmin to select all the tables in the database. Then, select Repair from the dropdown menu.
Reinstall WordPress
If all else fails, you can reinstall WordPress. But this should be a last resort.
First, if you have not already done so, back up everything. Then, export your content from the Dashboard. If you cannot access the Dashboard, download your entire wp-content folder. Before re-installing the software, you should delete the entire current installation. You can do this by using FTP or the cPanel File Manager. After reinstalling WordPress, import your old content.
Get Help
There is no shame in asking for help to fix your broken WordPress site. After all, your business is running a site, not repairing it. Be sure to look at what support options WordPress currently has. And when you do fix your site, be sure to check out our different services, such as giving your site a nice new design or discussing web strategy to optimize it a bit more.