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.

ALSO READ

Subscribe to our newsletter

To be updated with all the latest news, offers and special announcements.

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.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

GET STARTED

Start WordPress Blog: Ultimate Guide For Beginners

Here is our step by step guide for beginners to start a WordPress blog.

Top 6 Best WordPress Theme Frameworks

There are many websites themes which are created by using a framework. Likewise, WordPress Theme frameworks also becoming so popular. The framework allows you...

The Most Essential WordPress Plugins

Here, I have listed some excellent plugins which will surely add more features and new functionality to your WordPress blog.

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.

The Ultimate Guide to Harden WordPress Security

Learn how to improve WordPress security. Here are some basic security concepts that will help you to harden WordPress security.

How to Setup CloudFlare Free SSL for WordPress Blog

Google has announced that they will count HTTPS as a ranking factor which means if you using HTTPS you will get a higher position...

DEALS

WPEngine Hosting

GET 5 MONTHS FREE

POPULAR NOW

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...

How to Remove jQuery Migrate in WordPress?

jQuery Migrate greatly simplifies the process of moving older jQuery code to a higher jQuery version by identifying deprecated features. It then restores deprecated...

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...

Best Guide on Removing v=XXXX string from WordPress URLs

You might have noticed strange v=xxxx string in your WordPress URL. This string is comprised of an apparently arbitrary letter and numbers added as a parameter...

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.

How to Display Featured Image Before or After Entry Title in Genesis

Learn how to add featured image to a single post or a page in Genesis child themes. You can set it to display featured...