How to Enable WordPress Error Logs Using wp-config.php

How to Enable WordPress Error Logs Using wp-config.php

 

If you’re a regular WordPress user, you may have heard about wp-config.php and how vital it is for your website. It not only controls the database connection but also helps you find bugs and fix them.

The file consists of a few WordPress settings, which are responsible for making a connection between the site’s data and its database.

But if you want to troubleshoot your site, you require a few difficult steps. Enable WordPress error logs in wp-config.php, which helps you find out the resources generating errors.

You may be wondering if there is something a non-techie person can’t do without coding. Well, you can accomplish such a task by defining two things.

In this tutorial, you’re going to enable WordPress error logs using wp-config.php. I am sure, you have edited the file before.

You can either use an FTP account or directly access cPanel. I prefer cPanel because many web hosting companies don’t offer FTP access due to security reasons.

Use cPanel to Edit wp-config.php

As always, you may be wondering if cPanel looks the same for everyone. Well, every company has its brand value, brand color, and they try their best to maintain those.

So, the design layout may be different, but the overall concept of cPanel remains the same because it’s a software.

Let me walk through the step by step process.

Step 1:

As usual, you need to log into the cPanel account your web hosting has provided. Search for the Files’ section, which consists of the file manager icon.

How to Enable WordPress Error Logs Using wp-config

If you use Bluehost, Siteground, Inmotionhosting, Hostinger, and any of thebest hosting services, you can easily find the file manager.

Step 2:

A few companies allow you to choose the directory you want to open by showing a popup before opening the file manager.

But if you directly see the files and folders, it’s possible that you’re in the home directory. But the content is available in the public_html or root directory.

How to Enable WordPress Error Logs Using wp-config

Click on public_html from the left-hand sidebar.

Step 3:

If you host one website on the server, you can find the wp-config.php file in the root directory. But if you host multiple websites, you need to open the domain’s folder where WordPress installation is residing.

How to Enable WordPress Error Logs Using wp-config

Right-click on the file and choose an Edit option. As always, you can also use the standard Edit option from the main navigation menu of cPanel.

Step 4:

A popup appears for encoding confirmation. Click on the Edit button to continue.

How to Enable WordPress Error Logs Using wp-config

Step 5:

A new tab opens up in the web browser, where you can see codes of the file. You need to copy and paste the code shown below.

define( 'WP_DEBUG', true );

It’s possible that you see the similar code in the file, in which the parameter is false instead of true. The above-shown line enables WordPress to debug mode.

But the problem is you don’t need to see code syntax in your wp-admin area. Now, you need to add another line of code to log in errors.

define( 'WP_DEBUG_LOG', true );

Click on the Save Changes button.

Now if you wish to check the login error, go to the wp-content folder, and you can see a new file “debug.log”, you can download the file and speed up your troubleshooting process.

How to Enable WordPress Error Logs Using wp-config

Wasn’t that Easy to Enable WordPress Error Logs

Now and then people start getting so many errors. And you know that most of the WordPress users are non-techie, and they might fret a lot.

But if you go through each step, you may realize that even a newbie can pull this off. Enabling WordPress error logs using wp-config.php is easy.

Conclusion

You have edited the file a couple of times, but I am sure you haven’t noticed the debug code. Well, now you know what it is and how you can enable it.

Dealing with a WordPress error can be overwhelming if you don’t understand it. And I hope you have understood the concept of enabling error logs.

Check out these top 3 WordPress hosting services:

A2 Hosting
AU$2.90 /mo
Starting price
Visit A2 Hosting
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.8
  • Pricing
    4.0
IONOS
AU$1.49 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
Webdock
AU$1.57 /mo
Starting price
Visit Webdock
Rating based on expert review
  • User Friendly
    3.8
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.3
  • Pricing
    4.3

How to Configure WordPress Page Caching

A savvy website owner understand how important it is to have a website with a qu
less than a minute
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to Secure Your WordPress Website

Millions of websites get hacked every year and many people consider WordPres
less than a minute
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Create a WordPress Child Theme

Customizing your WordPress theme but want to be extremely safe? Don’t worry. W
less than a minute
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester

How to Fix File and Folder Permissions Errors in WordPress

It's so frustrating when you receive an error while updating your website. File
less than a minute
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top