InfoPhilic How to How to Set Up WordPress Error Logs using WP-Config

How to Set Up WordPress Error Logs using WP-Config

Diagnosing WordPress issues can be daunting. Similarly, monitoring of your site’s PHP errors is crucial. At the point when left undetected, PHP errors can lessen execution, squander data transfer capacity, and leave your site defenseless against vindictive assault.

PHP errors usually occur unpredictably and spontaneously and may be triggered by even the slightest changes to your server configuration, database setup, or WordPress files. Monitoring them is something that all responsible WordPress administrators should be doing.

In this article, I will show you how to set up WordPress error logs in the wp-config file.

What is a wp-config file?

The wp-config.php file is a WordPress configuration file that contains imperative WordPress settings. These settings advise your site how to associate with your WordPress database, which database table prefix to utilize, and produces confirmation keys to make your WordPress site more secure.

Aside from default WordPress settings, the wp-config file can likewise be utilized to characterize a few different parameters. It can likewise empower WordPress investigating mode and spare WordPress mistake logs.


This encourages you to discover WordPress errors by distinguishing the modules or contents that are causing them. You would then be able to simply ahead and discover a fix for those WordPress blunders.

How to Set up WordPress Error Logs in WP-Config File?

For this, you need to edit your wp-config.php file, which locates in the root directory of your website.

Before the line that denotes, ‘That’s all, stop editing! Happy blogging’, Paste the following code:

define( 'WP_DEBUG', true );

NOTE: Sometimes, the code is already present in your file but is set to false. In this case, you have to change it with true.

  • The code will enable debug mode in WordPress.
  • To keep the error to be logged, you will also need to add the following code to your wp-config.php file just below the WP_DEBUG line.
define( 'WP_DEBUG_LOG', true );
  • Save your Changes.
  • Now upload your wp-config.php file back to your website.
  • Now, visit your WordPress site and access the pages that were resulting in errors or warnings.
  • Later on, connect your website using an FTP client or file manager app on your WordPress hosting cPanel.
  • Once connected, go to /wp-content/ folder, here you will find a file called debug.log. This file consists of all WordPress errors, warnings, and notices that were logged.

You are done, this is how you can easily enable debug mode on your WordPress site and keep your website with zero errors.

Amit Malewar
Amit Malewar has been the tutorial writer since 2013. His passion for helping people in all aspects of technology flow through the expert coverage he provides. In addition to writing for InfoPhilic, Amit loves to read and try new things.

Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.


Please enter your comment!
Please enter your name here



Get almost 100% PageSpeed on Newspaper theme

The newspaper theme is the most popular premium theme for a self-hosted WordPress blog. The theme is developed by team tagDiv. You can buy...

How to Remove jQuery Migrate in WordPress?

Learn how to remove jQuery Migrate from your WordPress site.

How to Delete Multiple Images in WordPress Media Gallery

Hey, guys, today, one of my friends asked me a question, How can I delete Multiple Images in WordPress? I replied, "It's very simple." Yeah,...

WP Super Cache Plugin: Best Settings & Configuration Guide

A cache plugin serves static contents to the visitor, which improves page load speed. There are so many cache plugins available in the WordPress plugin...

How To Reduce Admin-Ajax Server Load In WordPress

To increase better user experience, we always end up by increasing site speed. After clicking a website link seems like a simple thing. But...


Astra Theme

Looking for a WordPress theme that's fast, elegant & customizable? Meet Astra! It's customizer powered, SEO friendly and compatible with major page builders.