Whether you’re a seasoned WordPress developer or just getting started, sooner or later, you’re going to run into errors. When that happens, it’s important to know where your WordPress error logs location so you can debug and fix the issue.
You may be confused about how do I check WordPress error log files. We will show you where to find your WordPress error log file and how to interpret the information inside.
What is an Error Log?
An error log records your website’s error messages and when they occur. If you turn on the debug mode in WordPress, these messages are stored in a file for later inspection.
You can use your WordPress error log as a troubleshooting tool to find plugins, themes, or code that may be causing problems. Afterward, you can find a solution to these WordPress errors.
Keeping an eye on the error logs will help you fix problems like “screen death” in WordPress, invalid JSON errors, PHP errors, and “Sorry, you can’t access this page”. Right now, you are wondering where I can find WordPress error logs?
Let’s examine where to look for and how to check your WordPress error logs. The first step is to turn on debug mode in WordPress. You can do this with code or through a plugin. Here are the steps you need to take.
How to Enable WordPress Debug Mode with a Plugin
WordPress does not log any errors by default because debugging is turned off. When you still have access to your WordPress site, you can use a plugin to enable debug mode. Your first step will be to install the WP Debugging plugin on your WordPress site.
Installing the plugin automatically activates WordPress debug mode, and all error messages on your site are now logged.
How to Enable WordPress Debug Mode with Code?
WordPress also allows you to activate debug mode through code. It is for you if you’re an experienced WordPress user or having trouble accessing your WordPress admin area. Your next step is to edit the wp-config.php file using your WordPress hosting control panel’s file manager or FTP client.
Once you’ve opened the file, look for the text that says, “That’s all, stop editing! Happy blogging.”.
You should add the following code just before this line:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
WordPress Error Logs: How to Find and Access
Now that you have turned on debug mode in WordPress, You may wonder how do I check WordPress error log? Your WordPress error logs will record any error messages that appear on your website from now.
The first time you see your logs, they will be empty. To save the error messages to the log file, you will need to relocate the problem again on your site. In particular, you should review any posts or pages causing an error again.
In the next step, you will need to connect to your website using an FTP client or the file manager included in your WordPress hosting control panel. If you’ve never used FTP before, you might want to look at a youtube tutorial on how to upload files to WordPress using FTP.
Navigate to the /wp-content/ folder once you have connected. You’ll find a file called debug.log inside the folder. Here you’ll find a record of every mistake, notice, and warning WordPress has ever logged.
You must download, view, or edit this file to see what’s inside the file. Next, review the error messages and the time and date of the occurrence. You can use this information to figure out what’s wrong with your website and how to fix it.
WordPress Error Logs: How to Fix Issues
When you check the WordPress error logs, you can see the error message recorded when there was a problem. Please note that the times displayed are UTC, not your local time.
The error message may not be clear to most people, but it’s a good place to start when determining what went wrong. If you take note of the error message and code associated with the error, you may be able to fix the problem.
You can also get help from the official WordPress forums, the WordPress support team at your web host, or the support area for the plugin or the support section associated with the plugin or theme you’re having trouble with.
Disabling the WordPress Debug Mode
You should turn off debug mode once you’ve resolved the problem with your WordPress site. Leaving it on may cause your website to slow down and leak information you don’t want to get out, which may compromise your security.
If you have enabled debug mode through a plugin, you can disable the WP Debugging plugin from the Plugins » Installed Plugins menu.
You could edit the wp-config.php file as you did before if you used code to turn on debug mode.
In your code, you will need to set the WP_DEBUG and WP_DEBUG_LOG lines to ‘false’
The Takeaway
That’s today’s roundup about finding and accessing WordPress error logs. As this guide shows, activating and accessing WordPress error logs is easy if you have access using the plugin and your hosting control panel. It’s important to understand how to activate the debugging mode so you can read logs in case you run into problems.
We hope this tutorial helped you learn where your WordPress error logs are and how to check them.