Do you wish to Set Up Error Logs of WordPress in WP-Config? The wp-config file in WordPress is useful debugging tool for helping you to find and fix the errors. In this article, we will show you how to set up WordPress error logs in the wp-config file so read the whole article carefully.
Why and When You Require to Set up WordPress Error Logs in WP-Config
The wp-config.php file is a WordPress configuration file that includes necessary WordPress settings. These settings tell your website how to connect to your WordPress database, which database table prefix to use, and develops authentication keys to make your WordPress site more secure.
Aside from default WordPress settings, wp-config file can also be used for defining various other parameters.Wp-config file can enable WordPress debugging mode and save WordPress error logs.
This guides you to find WordPress errors by finding the plugin that are causing them. You can then find a solution for those WordPress errors.
Let’s see how to enable and setup WordPress error logs in wp-config file.
Setting WordPress Error Logs in WP-Config File
- Edit your wp-config.php file. You can also access it by connecting to your site via File Manager app or FTP client in cPanel.
You will see wp-config.php file in the root directory of your website. Just open the file in any text editor and add the following code:
define( ‘WP_DEBUG’, true );
- It is possible that this code is present in your wp-config.php file and is set to false. Just change it to true.
- This line will turn on WordPress debug mode. But the drawback of using this debugging itself is that you will see WordPress errors and warnings inside your admin area as well as on front page of your website.
- If you want errors to be logged, then you will also need to add the following code in your wp-config.php file at below the WP_DEBUG line.
define( ‘WP_DEBUG_LOG’, true );
At last save your changes and upload your wp-config.php file back to your site.
Reviewing Your WordPress Error Logs
For this Visit your WordPress site and access the pages that were in errors or warnings. Using a FTP client or file manager app in your WordPress hosting cPanel connect to your website. Once connected, go to /wp-content/ folder and inside it your will see a file called debug.log.
You can also download, view, or edit this file. It will contain all WordPress warnings, errors and notices that were logged.
The wp-config file in WordPress is useful debugging tool that helps in finding and fix the errors. We hope that this article helped you to Set Up wordpress error log wp-config.
In case of any help related to WordPress feel free to contact our wordpress customer service, dial + 1 844 275 0975(Toll-Free). We will help you instantly for resolving all your problems.