After you receive a fatal error warning on your WordPress admin, follow our guide to correct it and regain access to your site.
It is rather disappointing and can happen that due to a fatal error in WordPress you cannot get into the admin area of your site. This error appears in the form of a white screen with red letters: ‘A fatal error occurred while the application was running.’
The causes of this error can be plugin and theme conflicts, software incompatibility, server misconfigurations or faulty code.
Even as the term ‘fatal errors’ would suggest that they would be deadly serious, there are simple solutions to them. This guide will help show several ways to get back into your WordPress admin as well as how to handle the World’s worst WordPress problem: the white screen of death.
We’ll cover:
- Staring at Files and Settings on Your Site
- Logging in with FTP and getting in to wp-config. php
- Defining WP_DEBUG
- How to Edit the wp-config.php file to Show Errors
- Unsafe Plugins and Themes It is advisable not to keep any plugins and themes installed on the browser because it provides hackers with an opportunity to infiltrate and control the browser.
- Resetting the Theme
- Making changes to the browser where you are clearing the cache and cookies.
- Developing further the thesis From Old and Unused Software
- Common Coding Errors
- Depending on the duration of WordPress usage or when using WordPress, one may feel the need to clear the WordPress database.
- Seeking Extra Help
Navigating to Your Site Files and Configurations
The first troubleshooting tasks involve getting into files and settings, so it will work perfectly fine even when you attempt to navigate your site files as well as settings after the application has been downloaded.
This can be done either by going to file manager or through your web hosting cpanel or ftp details. Almost all of the managed WordPress hosts also include an option to access these files from within your control panel as well.
If the hosting dashboard does not allow Browse files, then you have to look into the FTP details. If you do not find it for the hosting account, you need to contact the support service of the host provider.
Accessing the Site through the FTP to Search and Modify wp-config.php
Once you have gotten access to the files of your site, find the directory which contains the wp-config. plugin or a theme under the ‘wp-content’ directory in WordPress or any other PHP file under the main directory of WordPress. It is preferably to open it with a text editor of some sort since it is really just a text file.
It also includes WordPress-specific settings, including credentials needed to connect the database for the application. It will let you work with this file for diagnosing fatal mistakes in case you are making changes in this file.
- Defining WP_DEBUG
If you want to get more details on the fatal error, you have to open wp-config. php and add the following code before the final line:To know more information that is related to the fatal error, open wp-config. php and add the following code before the final line:php and add the following code before the final line:
- Define( ‘WP_DEBUG’, true );
No this will not turn on debug mode; this will provide real error messages to us. You have to make sure that should be turned to false after debugging in order not to display the information on a live site.
How to edit wp-config.php to show errors
Leaving WP_DEBUG on will provide you with more details of errors; apart from that, you can tweak with wp-config.php to trigger the errors in the event that you will not be in a position to access any PHP logs or debug details.
Add the following lines before the closing PHP tag:You need to add the following lines before the end PHP tag:
- ini_set(‘display_errors’,’On’);
- ini_set(‘error_reporting’, E_ALL );
With these extra lines, any error that is fatal to PHP will be displayed on the page rather than the white page telling about an error.
Disabling Plugins and Themes
The very common cause that can be encountered is with the help of having the wrong or conflicting plugin or theme on the website. If for any one or the other reason you are unable to access the admin dashboard, then the only viable option left is to disable the plugins.
This can be done by accessing the File Manager or your FTP access and locating the plugin folder of your WordPress site at /wp-content/plugins/ and renaming plugin folders to disable the plugins for now.
For example, rename a folder from ‘akismet’ to ‘akismet-off’. Go round your site and see if the fatal errors still appear when you are going around it. If they do, then undo the name change and disable plugins until you can identify the nasty add-on.
The other common solution for the short term is to change your theme to the default theme, for instance, to twenty-first theme. For instance, change the name of the current active theme folder residing in /wp-content/themes/ and you are using a default theme, and then try to see whether the problem exists or not.
Read: How to make your WordPress website faster with CDN
Resetting the Theme
Another way to try is to select no theme so that the current page does not contain settings and styles that are a problem for the test.
Navigate to /wp-content/themes/[your-theme]. Search for the functions. php file and style. The CSS files and then proceed and clear the various contents that may be stored inside them. Then on each page, replace the code with: After that
On each page, replace the code with:On each page, replace the code with:
*/
This will eliminate whatever new code was added to the element and cause the conflict on the most recent changes.
Free and open spaces pdf, roaming the relative folder on the server, and cleaning up the cache and cookies.
Some PHP errors are fatal, and they include hut, server cache issues, and also when cookies are filled to the FULL capacity on the browser.
Log into your hosting control panel and spend some time deleting all the cached files related to your WordPress site. If there is any Content Delivery Network involved, then clear that cache also.
I also have the option of deleting the temporary cache files and directories: /wp-content/cache/ or /wp-content/uploads on my own.
To solve browser cookie errors, all site data and cookies related to your domain will have to be cleared using the preferred browser. Furthermore, you should also flush your DNS cache before running a security scan. Close it, then try to reopen the browser and attempt to reload the page when all the cache files are deleted.
Addressing the problem of out-of-date software, it is possible to solve out-of-date software by updating the said software.
Some of the other contributing factors to the occurrence of fatal errors include an outdated WordPress version, installed plugins, themes, or even the PHP language.
Access your account in WordPress, and from the Dashboard, select the option that is called Updates. Click on Check Again if there is more news that can be sought and fetched. If there are more than one update, turn on the network, download and install each update successively, and check whether after installing the update the site is responding okay or not.
If you are unable to access your WordPress site dashboard, then please visit www.wordpress.org., and in my case, download the newest version of WordPress manually and, with the help of FTP, upload new WordPress core files. If your server’s PHP version is out of date, ask your hosting provider to update it for you.
Related: Advanced WordPress Development Techniques for Pro Developers
Fixing Common Coding Errors
When you have made a change within the last few days that led to a PHP coding error, then you will want to rollback that change or fix it for fatal errors.
scrutinize only the updates in the wp-content/plugins/ folder or child theme code tweaks for the existence of wrong PHP syntax. Don’t forget possible issues with some of the recent changes made in those functions; temporarily comment out these changes. php or header.php or style. the CSS files of the basic styles or the themes that are added to the website and check whether the fatal errors are solved or not.
In particular, it is desirable to return to hooks and filters in the code of a custom plugin because these sections provoke most of the conflicts after WordPress or a plugin update.
Related: Top 5 WordPress Developer Tools for Efficient Website Building
Resetting the WordPress Database
If the fatal error cannot be fixed by any of the procedures mentioned earlier, then the last resort is to reset the WordPress database. This will delete all content that is currently on this page as well as the changes that you made; however, clearing up the data corruption or issues related to extensions may occur rarely.
The best way to do that would be to use phpMyAdmin, or if you are running the site on the hosting service’s server, to use the tools that the hosting service is providing. It is recommended that one should create a backup of their current database before proceeding with the deletion process so that it will not result in loss of data. In the third step, make a new empty database along with a new username and password for the WP config.php file information.
As you will observe if you visit your site at the moment, WordPress is still set up as a new installation with all the default parameters on. While re-installing the plugins and content, avoid doing what has been said to be a problem that you have.
Related: Tips To Boost Your Enterprise WordPress Site with Advanced Strategies
Seeking Extra Help
With the help of the above troubleshooting, you should be able to regain access to rectify the cause of fatal errors as described above. Nevertheless, solving some server settings issues or being engaged in some hardcore coding challenges occasionally requires the services of WordPress developers to debug and try to find solutions, especially when dealing with highly complex sites.
Now, if you feel that you may be absolutely lost while trying to patch a problem that is unique to a certain plugin or theme, forums will assist. Therefore, I always turned on WP_DEBUG, the full fatal error message, and the recent activities done to gain more assistance.
By following a very systematic error-solving technique, it is almost possible to rectify almost all the fatal errors, thereby regaining access to your WordPress dashboard. This is one area that many people tend to ignore, and that can be risky because updates and backups can help avoid so many fatal mistakes that will close your site.
Follow us on Facebook and Twitter for more WordPress tips and solutions.