{"id":91136,"date":"2023-06-08T01:13:05","date_gmt":"2023-06-08T05:13:05","guid":{"rendered":"https:\/\/www.boldgrid.com\/support\/?p=91136"},"modified":"2023-06-08T01:23:02","modified_gmt":"2023-06-08T05:23:02","slug":"how-to-enable-wp_debug-in-wordpress","status":"publish","type":"post","link":"https:\/\/www.boldgrid.com\/support\/wordpress-tutorials\/how-to-enable-wp_debug-in-wordpress\/","title":{"rendered":"How To Enable WP_DEBUG in WordPress"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<?xml encoding=\"utf-8\" ?><html><body><p>Enabling <code>WP_DEBUG<\/code> is a useful technique for troubleshooting and debugging issues in your Crio <a href=\"https:\/\/www.boldgrid.com\/crio-wordpress-theme-for-business\/\">Pro WordPress theme<\/a> or any WordPress theme or plugin. It allows you to view detailed error messages and warnings that can help you identify and resolve problems with your WordPress website.<\/p>\n<p><em>Here&rsquo;s a step-by-step guide to enabling WP_DEBUG:<\/em><\/p>\n<h3 id=\"accessing-your-wordpress-files\">Accessing your WordPress Files<\/h3>\n<p>To begin, you&rsquo;ll need access to your WordPress website files. There are two common methods for accessing your files:<\/p>\n<ul>\n<li>File Manager: If your web hosting provider offers a file manager, you can access it through your hosting control panel (e.g., cPanel) and locate the WordPress root directory.<\/li>\n<li>FTP (File Transfer Protocol): Use an FTP client such as FileZilla to connect to your website&rsquo;s server and navigate to the WordPress root directory.<\/li>\n<\/ul>\n<h3 id=\"locate-the-wp-configphp-file\">Locate the wp-config.php File<\/h3>\n<p>Once you have access to your WordPress files, locate the <strong>wp-config.php<\/strong> file in the root directory. This file contains essential configuration settings for your WordPress site.<\/p>\n<h3 id=\"backup-your-wp-configphp-file\">Backup your wp-config.php File<\/h3>\n<p>Before making any changes, it&rsquo;s always a good idea to create a backup of your <strong>wp-config.php<\/strong> file. Right-click on the file, select &ldquo;Download&rdquo; (or &ldquo;Download as&rdquo;), and save it to your local computer.<\/p>\n<h3 id=\"edit-the-wp-configphp-file\">Edit the wp-config.php File<\/h3>\n<p>Open the <strong>wp-config.php<\/strong> file using a text editor. You can use a code editor like Notepad++ or a built-in text editor provided by your FTP client or file manager.<\/p>\n<h3 id=\"define-the-wp_debug-constant\">Define the WP_DEBUG Constant<\/h3>\n<p>Within the <strong>wp-config.php<\/strong> file, look for the section that contains other WordPress constants. It typically starts with the line <em>\/* That&rsquo;s all, stop editing! Happy blogging. *\/<\/em>. Just above this line, add the following line of code:<\/p>\n<pre>define( 'WP_DEBUG', true );<\/pre>\n<p>This line enables the <code>WP_DEBUG<\/code> mode in WordPress.<\/p>\n<h3 id=\"save-and-upload-the-wp-configphp-file\">Save and Upload the wp-config.php File<\/h3>\n<p>After adding the <code>define( 'WP_DEBUG', true );<\/code> line, save the <strong>wp-config.php<\/strong> file. If you&rsquo;re using an FTP client, it may prompt you to upload the modified file back to the server. Confirm the upload, overwriting the existing <strong>wp-config.php<\/strong> file.<\/p>\n<h3 id=\"check-for-errors\">Check for Errors<\/h3>\n<p>With <code>WP_DEBUG<\/code> enabled, your WordPress website will display detailed error messages and warnings. If there are any issues or errors on your site, they will now be visible.<\/p>\n<h3 id=\"debugging-with-wp_debug_log\">Debugging with WP_DEBUG_LOG<\/h3>\n<p>By default, <code>WP_DEBUG<\/code> mode displays errors on your website&rsquo;s pages. However, it&rsquo;s often helpful to log the errors in a file for easier analysis. To enable error logging, add the following lines of code after the <code>define( 'WP_DEBUG', true );<\/code> line:<\/p>\n<pre>\r\ndefine( 'WP_DEBUG_LOG', true );\r\ndefine( 'WP_DEBUG_DISPLAY', false );\r\n<\/pre>\n<p>With these lines added, errors will be logged to a file called <strong>debug.log<\/strong>, located in the wp-content directory of your WordPress installation.<\/p>\n<h3 id=\"analyzing-the-debug-log\">Analyzing the Debug Log<\/h3>\n<p>To access the <strong>debug.log<\/strong> file, go back to your WordPress files and navigate to the wp-content directory. Locate the <strong>debug.log<\/strong> file, and you can open it with a text editor to view the logged errors and warnings.<\/p>\n<h3 id=\"disabling-wp_debug-mode\">Disabling WP_DEBUG Mode<\/h3>\n<p>Once you have resolved the issues and completed the debugging process, it&rsquo;s recommended to disable <code>WP_DEBUG<\/code> to prevent error messages from being displayed on your live website. Simply edit the <strong>wp-config.php<\/strong> file again, locate the line <code>define( 'WP_DEBUG', true );<\/code>, and change <code>true <\/code>to <code>false<\/code>:<\/p>\n<pre>define( 'WP_DEBUG', false );<\/pre>\n<p>Save the <strong>wp-config.php<\/strong> file and upload it back to your server.<\/p>\n<p>That&rsquo;s it! You have successfully enabled and configured <code>WP_DEBUG<\/code> in your WordPress website. Remember to use this debugging mode only for troubleshooting purposes and disable it on production websites to avoid displaying error messages to your visitors.<\/p>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Enabling WP_DEBUG is a useful technique for troubleshooting and debugging issues in your Crio Pro WordPress theme or any WordPress theme or plugin. It allows you to view detailed error messages and warnings that can help you identify and resolve problems with your WordPress website. Here&rsquo;s a step-by-step guide to enabling WP_DEBUG: Accessing your WordPress [&hellip;]<\/p>\n","protected":false},"author":1304,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"bgseo_title":"","bgseo_description":"","bgseo_robots_index":"index","bgseo_robots_follow":"follow","footnotes":""},"categories":[764,151],"tags":[],"class_list":["post-91136","post","type-post","status-publish","format-standard","hentry","category-boldgrid-themes","category-wordpress-tutorials"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/91136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/users\/1304"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/comments?post=91136"}],"version-history":[{"count":12,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/91136\/revisions"}],"predecessor-version":[{"id":91153,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/91136\/revisions\/91153"}],"wp:attachment":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/media?parent=91136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/categories?post=91136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/tags?post=91136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}