Even the best WordPress themes can sometimes suffer from errors. You can use WordPress logs to fix problems that arise on your website. Or you can use the logs to find the error, why it has happened and then use this information to correct the error by fixing the file. WordPress logs can track and record the errors in a single file. To complete this, you need three basic steps:

  • Accessing your files through FTP.
  • Edit the wp-config.php file on your website.
  • Locate the WordPress log that is created for your website.

So let's look at how you can create your WordPress log and then access it.

Step 1 – Access the WordPress Files

The first thing that you need to do is to go into the backend of your website and access the site’s files. This can be done in a few ways, however it is best done through the FTP. You will need an FTP client to do this and it is highly recommended that you use FileZilla to complete this task. It is a free option and perfect for accessing website files.

FileZilla is easy to use and all you need to do is to enter the FTP credentials to access the site. These can be provided to you by your website host. Or they can be found on the control panel. The details that you’re looking for include the Host, Username and Password. You can leave the Port field empty.

Step 2 – Edit your wp-config.php File

Now you need to find the file that reads wp-config.php file and then open this up in a text editor to make changes to the file. The file is often found in your root folder. This could be names as root, www or the same as your website’s domain.

When you’ve opened it up, scroll down to the bottom of the page until you see the writing

/* That’s all, stop editing! Happy blogging. */

From there you need to add the following line of code to your file.

define( 'WP_DEBUG', true );

This line will tell your WordPress website to activate the debug mode. This line might already exist in your file, but be set to false. If this is the case, then just change the false to true.

Then, underneath this line, you need to add the following line of code.

define( 'WP_DEBUG_LOG', true );

This will tell your website to keep a log of any errors that happen on your website.

Once the changes have been made you can save the file and reupload this to your website through the FileZilla FTP client.

Step 3 – Locate New Logs

Now you can relocate the new error logs on your website. It is usually in the root folder or within the wp-content folder. And they can be accessed just the same as you have on the wp-config folder.

Final Word: How to Check PHP Error Log on WordPress

No website platform is perfect. If you want to check for errors on your WordPress website, you need to have the PHP error log enabled on your website. Above is the steps to make this possible and how you can access the error log on your WordPress website. You might also be able to get support from you host. Some hosts, like Cloudways have excellent support services.