WordPress Error Log: Your 6-Step Guide to Enabling, Accessing, and Troubleshooting Errors

When a WordPress error brings down your website, it’s heart-stopping.

But what if there’s no error code? What’s causing the problem, and how can you fix it?


GIPHY

You need to access your WordPress error log for the full lowdown so you can leap into action and get fixed up.

Let’s get started.

And feel free to skip ahead to our step-by-step tutorial on accessing and using WordPress error logs if you already know the basics.

What Is a WordPress Error Log?

A WordPress error log records your website’s error messages so you can diagnose faults. You can use this log in WordPress Debug Mode to troubleshoot faulty plugins, themes, or code that might cause errors. Think of it as a guide that explains what to look for when your WordPress website experiences difficulties.

Your log doesn’t always tell you how to fix errors, but it tells you the types of errors you have and which areas need your attention.

Here’s an example of what you might find when you open the WordPress debug.log file:

wordpress debug log

When Do You Need WordPress Error Logs for Troubleshooting?

Although WordPress.org is one of the most powerful content management systems, it’s prone to many common errors – and sometimes even fatal errors. For instance, you might find your site starts to slow down unexpectedly, or you can’t access your dashboard.

WordPress doesn’t always tell you why your site crashes or locks you out. Sometimes, you might see an error message giving some details:

Or other times, you might see the white screen of death or a simple error code:

It’s here when you ideally need the help of a WordPress error log. For example, if you see the frustrating (and pretty vague) Critical Error message, the WP error log can tell you if it’s a specific plugin compatibility issue.

It’s also worth using the error log in case you need to contact a WordPress developer for help because it gives experts context before they dive deep into troubleshooting mode.

It’s also a good idea to bring up the error log even if you notice a theme or plugin acting strangely or your website seems slower than usual.

Although you can switch off plugins one by one to find out if any are causing site issues, it’s sometimes faster to open up the error log and get a straight answer.

Your 6-Step Guide to Using WordPress Error Logs

Ready to use WordPress error logs?

First, make sure you backup your website in case you make any mistakes. There’s nothing worse than making an innocent change to an internal file only to find it locks you completely out of your dashboard. When fixing errors, even tiny changes can add fuel to the fire.

Go ahead and set up automated backups. They save you a lot of time and stress in the future.

Remember, if you don’t feel comfortable or confident following these steps, or you simply don’t have the time, you can call in an expert to take care of your error logs.

How to enable error log in WordPress and troubleshoot your site

StepIn brief
0. Avoid the other steps by hiring the best WordPress expertsCall a StateWP developer if you’d prefer expert help understanding WordPress error logs
1. Turn on WordPress Debug ModeUse the WP Debugging plugin or log into your site with an FTP client and edit wp-config.php with new code (details in our guide)
2. Make sure the WordPress errors log isn’t publicCheck that your wp-config.php file includes the line “define( ‘WP_DEBUG_DISPLAY’, false );” to keep errors private
3. Recreate the errorMake the error appear on your log by re-triggering the problem (e.g., by accessing your website from your browser)
4. Find and access your WordPress error logLog into your FTP or cPanel account and access debug.log for a list of errors generated
5. Find the error and troubleshoot solutionsLook through your error log for clues to what caused the problem, or save the log and keep it for experts to decipher
6. Disable your error log and switch off Debug ModeDeactivate your error log via plugin or change the code in wp-config.php (details in our guide)

Preliminary tip: Avoid the 6-step process by hiring WordPress experts

Although our guide helps you understand how to access and understand error logs, there’s still a chance you might not know what to do next.


GIPHY

Error logs can seem confusing and might not tell you exactly what to do to resolve problems. Therefore, consider contacting an expert WordPress developer who can guide you.

Whether you raise a request through Proto (our WordPress dashboard) or contact us via email, StateWP aims to address and fix WordPress issues within a day of you raising them.

Now onto the steps for doing it yourself:

Step 1: Turn on WordPress Debug Mode

WordPress Debug Mode generates error logs and records problems whenever they occur. You can use this feature to check the dates and times when errors arise.

You must enable Debug Mode by either using a WordPress plugin or editing your website’s code.

Let’s start with a plugin.

Assuming your error isn’t preventing you from accessing your WordPress dashboard, head to the “Plugins” section of your sidebar.

We recommend you search for and use WP Debugging, which lets you debug without coding.

Download the plugin from the link provided while logged into WordPress. Or, if you access it through plugin search, click “Download” and then “Activate” once it’s ready.

Don’t change any plugin settings yourself unless you wish to – we recommend you leave it to work its magic.

Alternatively, to access and edit your WordPress site’s code, you must use an FTP (File Transfer Protocol) client. This program helps you make changes to your site when you don’t have access to WordPress, e.g., when you can’t log into your dashboard due to an error.

We recommend you download Filezilla, a free, user-friendly program where you can access error log files in minutes.

Alternatively, Cyberduck is also free and just as easy to use.

Once downloaded, ensure you have permission and credentials from your web host to access your site via FTP.

Log into your site with the credentials. You should see a list of folders and files like so:

Here, you need to find a file called “wp-config.php,” usually in your root folder (“public_html”). You can edit this configuration file via your default text editor.

Right-click the file and download it to your local drive so you have a backup. Then, right-click and select “Edit.”

You should now see a code list. Look for “WP_DEBUG” in the list using the CTRL + F keys on PC or the CMD + F keys on Mac.

If there are no results, look for the phrase:

“That’s all, stop editing! Happy blogging.”

Paste the following code above that phrase:

define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_LOG’, true );
define( ‘WP_DEBUG_DISPLAY’, false );
@ini_set( ‘display_errors’, 0 );

 

This line activates WordPress Debug Mode and generates error logs.

If you do see “WP_DEBUG” in the list already, change any phrases next to it from “false” to “true” – this switches debug on.

Save the wp-config file and move to the next step.

Step 2: Make sure the WordPress errors log isn’t public

In some cases, activating the error log can result in your website displaying the nature of the problem to anyone who visits your site, like so:

Understandably, you might want to keep this private and simply fix the problem. In which case, head back to wp-config.php and search the following line:

define( ‘WP_DEBUG_DISPLAY’, false );

 

This line tells WordPress not to display error descriptions on your website. If it reads “true,” simply change it to “false,” as seen above.

Step 3: Recreate the error

The error log isn’t a retroactive feature of your WordPress site, so you need to trigger your error again to get it to appear on the list!

Repeat the action if you can remember what you did to provoke the issue. That might have been any from opening up your website to editing a specific page.

That error should now register on said log, meaning all you have to do is find it in FTP.

Step 4: Find and access your WordPress error log

Activating WordPress Debug Mode through a plugin or code generates a new file accessible through FTP: “debug.log.”

You can also access the file through your WordPress hosting company’s dashboard and control panel. Let’s explore the FTP route first.

Get FTP login details from your host, launch your client, and look for debug.log in your root folder (usually the first open folder that appears) or the /wp-content/ folder.

Either right-click and download the file or click to open it. As with wp-config, you should see lines of code:

lines of code

If you have a cPanel account, you can log into your site via your browser or use your web host to view error logs.

Let’s assume you’re using cPanel directly. Log into the tool and head to “File Manager” before selecting “Files.”

You then open a new window similar to what’s available through FTP. Head to “public_html,” your root folder, and open “error_log.”

Here, you see a list of errors and associated date and time data. Let’s move on to how to find errors and understand them.

Step 5: Find the error and troubleshoot solutions

Start by opening error.log either in FTP or cPanel. Your log should break errors down into dates, times, and error messages like so:

In cPanel, you might also find IP addresses logged with certain errors. Essentially, you use error.log to organize errors by date and time.

It’s not always obvious what causes errors that WordPress logs. However, it’s worth familiarizing yourself with some of the most common WordPress errors to fill in the blanks.

For example, you might need to update your PHP version if you have a PHP error (a problem with your website’s scripting language),

Or, if your error log mentions “permissions,” it might mean you’re experiencing the dreaded 403 error.

You don’t have to diagnose errors alone if you’re feeling lost. Naturally, a great place to start with error questions is to head straight to Google – you will always find other people who have experienced the same error code as you.

However, we recommend you check out WordPress’s “Fixing Forum,” where you can ask for help from WP experts directly.

Alternatively, save yourself time and confusion and ask a StateWP developer for help.

We can read error logs and always know the next steps to fixing WordPress problems – this makes us often the fastest option for getting your site back and running.

Simply use your Proto dashboard and raise a service request with our team.

Submit request if there is a wordpress error

We aim to address your issue and fix the fault in 24 hours. Problem solved!

Step 6: Disable your error log and switch off Debug Mode

Leaving Debug Mode running can add more pressure to your website, meaning it can slow things down.

So, if you activated a plugin to enter debug, head to your plugins menu via WordPress and click “Deactivate” under the specific program.

If you debugged through FTP, return to your client and open wp-config. Change the WP_DEBUG lines from “true” to “false” and save the file.

WordPress Error Log: Diagnosis on Demand

WordPress error logs are complicated on the surface but incredibly useful once you know how to use them. After all, you must fix WordPress errors fast – or lose the interest of your visitors.


GIPHY

Activating and deactivating logs is quick and easy with plugins or through an FTP client with practice.

Reading error reports and using them to fix problems is less straightforward but still manageable.

And remember, if your error log makes little sense and you need your site back online, send us the details, and let StateWP do the rest.

We can take care of errors for you no matter when they arise. WordPress error_log not working at all? We can help with that, too!

In the meantime, if you ever have trouble logging into WordPress at all, keep our guide to faulty login fixes handy.

WordPress Error Log FAQs

Let’s close this guide with a few commonly asked questions about the WordPress debug log.

Where can I find WordPress error logs?

You can find and set up WordPress error logs using a debugging plugin or by editing wp-config.php, a file you can access through an FTP program. Use the second option if you can’t log into your WordPress dashboard. We explain how to do this in our complete guide above.

How do I find errors on my WordPress site?
You can sometimes find errors by heading to your website – WordPress often displays error codes and messages explaining what they mean. If no details are visible, you can generate an error log, which breaks down different errors and what might be causing them.
Where does WordPress log errors?

The WordPress debug log, a hidden file in your website’s root folder, contains details of all errors that arise. That means you need to use a plugin to generate code to access the log or edit configurations to make it visible. You can’t see debug or error logs by default, so follow our guide to learn how to switch them on.

Can I delete error_log in WordPress?
Yes, you can clear your WordPress error log simply by logging into your FTP client and deleting error_log. To generate a new error log, follow our guide above to restart debugging mode. You might want to delete your error log if, for example, your log file grows too long or too large to open!
x