{"id":18138,"date":"2019-05-24T13:54:23","date_gmt":"2019-05-24T13:54:23","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=18138"},"modified":"2026-03-10T10:07:16","modified_gmt":"2026-03-10T10:07:16","slug":"wordpress-debug","status":"publish","type":"post","link":"\/my\/tutorials\/debug-wordpress","title":{"rendered":"WordPress debug: What is it, how to enable it, and best practices"},"content":{"rendered":"<p>The WordPress debug mode is a built-in feature that lets you display and log error messages for more accurate troubleshooting. It is crucial for maintaining your website functionality, especially after adding custom code that might be triggering issues.<\/p><p>This tutorial will explain the WordPress debug mode and different ways to enable it. Since these methods suit different troubleshooting tasks, choose one based on your needs.&nbsp;<\/p><p>\n\n\n<div class=\"protip\">\n                    <h2 class=\"featured-snippet title\">What is WordPress debug?<\/h2>\n                    <p> WordPress debug is a built-in feature that lets developers print and list error messages for troubleshooting. You can enable it by activating different PHP global variables like the <strong>WP_DEBUG<\/strong> and <strong>SCRIPT_DEBUG<\/strong>. Alternatively, you can debug WordPress by showing important data like script execution using a plugin.<\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-enable-wordpress-debug-with-code\">How to enable WordPress debug with code<\/h2><p>In this section, we will explain how to enable the WordPress debug mode using four different PHP variables based on your troubleshooting needs.<\/p><h3 class=\"wp-block-heading\" id=\"h-1-enable-wp-debug\">1. Enable WP_DEBUG<\/h3><p>Activating <strong>WP_DEBUG <\/strong>is the most basic way to enable debugging in WordPress. It can check for PHP code issues in different website components, including themes and plugins.<\/p><p>To use the WP_DEBUG global variable, simply change its value in the <a href=\"\/my\/tutorials\/wp-config-php\/\">wp-config.php file<\/a> from <strong>FALSE<\/strong> to <strong>TRUE<\/strong>. Before doing so, ensure you can access your WordPress root folder using a file transfer protocol (FTP) application like <a href=\"\/my\/tutorials\/ftp\/filezilla-ftp-configuration\/\">FileZilla<\/a> or your hosting provider&rsquo;s file manager.<\/p><p>If you use an FTP client, you&rsquo;ll have to download the PHP file, edit it on your computer, and re-upload it to your website.<\/p><p>To simplify the process, we will use <a href=\"\/my\/tutorials\/how-to-use-hostinger-file-manager\/\">Hostinger File Manager<\/a>, which lets you edit <strong>wp-config.php<\/strong> directly in your web browser. Here are the steps:<\/p><ol class=\"wp-block-list\">\n<li>Log in to <strong>hPanel.<\/strong> Navigate to<strong> Websites<\/strong> &rarr; <strong>Dashboard<\/strong> &rarr;<strong> File Manager<\/strong>.&nbsp;<\/li>\n\n\n\n<li>Go to your WordPress <strong>public_html <\/strong>root folder.<\/li>\n\n\n\n<li>Open the <strong>wp-config.php<\/strong> file by double-clicking it.&nbsp;<\/li>\n\n\n\n<li>Find the following line. If you can&rsquo;t locate this entry, manually add it after the <strong>$table_prefix = &lsquo;wp_&rsquo;;<\/strong> line:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">define( 'WP_DEBUG', false );&nbsp;<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Change the value from false to <strong>TRUE<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a577abe2a87d\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a577abe2a87d\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1999\" height=\"1011\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/image2.png\/w=1024,h=1024,fit=scale-down\" alt=\"WP_DEBUG line placed in the wp-config.php file\" class=\"wp-image-115605\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/image2.png\/w=1999,fit=scale-down 1999w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/image2.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/image2.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/image2.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/image2.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/image2.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1999px) 100vw, 1999px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol start=\"6\" class=\"wp-block-list\">\n<li>Click the <strong>disk<\/strong> icon on the top right corner of the editor to save the changes.&nbsp;<\/li>\n<\/ol><p>That&rsquo;s it! If you encounter PHP issues, WordPress will print the error message on the front end.<\/p><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a577abe2c9b2\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a577abe2c9b2\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1460\" height=\"413\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/php-error-message-on-wordpress-front-end.png\/w=1024,h=1024,fit=scale-down\" alt=\"PHP error message on WordPress front end\" class=\"wp-image-115606\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/php-error-message-on-wordpress-front-end.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/php-error-message-on-wordpress-front-end.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/php-error-message-on-wordpress-front-end.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/php-error-message-on-wordpress-front-end.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/php-error-message-on-wordpress-front-end.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1460px) 100vw, 1460px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>WordPress provides additional PHP variables for modifying the debug mode. For example, <strong>WP_DEBUG_DISPLAY<\/strong> hides the error messages on the front end when set to <strong>FALSE<\/strong> to preserve the user experience.<\/p><p>Developers typically use it with <strong>WP_DEBUG_LOG<\/strong>, which lists the PHP issues in the <strong>debug.log <\/strong>file inside the <strong>wp-content<\/strong> directory. Like WP_DEBUG, you add these variables to <strong>wp-config.php<\/strong> above the &ldquo;<strong>That&rsquo;s all, stop editing!<\/strong>&rdquo; line. Your configuration should look like the following code:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">if ( ! defined( 'WP_DEBUG' ) ) {\n\n&nbsp;&nbsp;&nbsp;define( 'WP_DEBUG', true );\n\n&nbsp;&nbsp;&nbsp;define('WP_DEBUG_DISPLAY', false);\n\n&nbsp;&nbsp;&nbsp;define('WP_DEBUG_LOG', true);\n\n}<\/pre><p>Remember that WordPress will log messages that occur after you activate the <strong>WP_DEBUG_LOG<\/strong> variable. If you want to document previous issues, you must manually replicate them.<\/p><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a577abe2e94d\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a577abe2e94d\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1460\" height=\"431\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-debug-log-entries.png\/w=1024,h=1024,fit=scale-down\" alt=\"WordPress debug log entries\" class=\"wp-image-115607\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-debug-log-entries.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-debug-log-entries.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-debug-log-entries.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-debug-log-entries.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-debug-log-entries.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1460px) 100vw, 1460px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p><div class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <strong>Important!<\/strong> If you want to disable the WordPress debug mode, remember to set <strong>WP_DEBUG_DISPLAY<\/strong> and <strong>WP_DEBUG_LOG<\/strong> to <strong>FALSE<\/strong> to prevent these features from running indefinitely and wasting resources.\n            <\/p><\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-2-enable-script-debug\">2. Enable SCRIPT_DEBUG<\/h3><p>By default, WordPress runs minified JavaScript (JS) and CSS core files that hide non-essential features like error messages. While this behavior helps improve load time, it can make troubleshooting trickier since you can&rsquo;t see the detailed information.<\/p><p>To debug core JS and CSS files, enable the dev versions using the<strong> SCRIPT_DEBUG<\/strong> variable. Doing so is especially useful after modifying your website&rsquo;s appearance using these programming languages.<\/p><p>The steps to enable SCRIPT_DEBUG are similar to those for WP_DEBUG. Here&rsquo;s how to do so using Hostinger File Manager:<\/p><ol class=\"wp-block-list\">\n<li>Open your WordPress <strong>public_html <\/strong>root folder.<\/li>\n\n\n\n<li>Double-click the <strong>wp-config.php<\/strong> file to open it.&nbsp;<\/li>\n\n\n\n<li>Find the following line and change the value from <strong>FALSE<\/strong> to <strong>TRUE<\/strong>. If you can&rsquo;t find one, add it before the &ldquo;<strong>That&rsquo;s all stop editing<\/strong>&rdquo; line.<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">define( 'SCRIPT_DEBUG', true );<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Click the <strong>disk<\/strong> icon on the top right to save the changes.&nbsp;<\/li>\n<\/ol><p>Now, if your website encounters core CSS or JavaScript-related issues, it should print error messages. After troubleshooting, remember to disable the variable and reactivate the minified core files to avoid performance issues.<\/p><h3 class=\"wp-block-heading\" id=\"h-3-enable-php-error-log\">3. Enable PHP error log<\/h3><p>PHP has the built-in <strong>error_log() <\/strong>function that lets you log issues related to the scripting language. This feature runs on the server level, meaning it can debug all PHP applications in your hosting environment, including WordPress and its database.<\/p><p>You can enable the PHP logging by editing the <a href=\"\/my\/tutorials\/what-is-php-ini\/\">php.ini<\/a> file. However, several web hosting providers disable this feature due to design and security concerns.<\/p><p>If you use <a href=\"\/my\/wordpress-hosting\">Hostinger managed WordPress plans<\/a>, you can enable this feature via hPanel. Here&rsquo;s how to do so:<\/p><ol class=\"wp-block-list\">\n<li>Log in to <strong>hPanel<\/strong> and head to <strong>Websites <\/strong>&rarr; <strong>Dashboard<\/strong> &rarr; <strong>sidebar<\/strong> &rarr; <strong>Advanced<\/strong> &rarr; <strong>PHP Configuration<\/strong>.<\/li>\n\n\n\n<li>Select the <strong>PHP options<\/strong> tab.&nbsp;<\/li>\n\n\n\n<li>Check the <strong>logErrors<\/strong> box to enable logging. If you want to display the error message on the front end, enable the <strong>displayErrors<\/strong> option. We recommend leaving it unchecked.&nbsp;<\/li>\n\n\n\n<li>Scroll down and hit <strong>Save<\/strong>.&nbsp;<\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"\/my\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"2048\" height=\"600\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><p>You can access the log file by opening the <strong>.log<\/strong> directory within your server&rsquo;s root folder. Here&rsquo;s how to do so on Hostinger File Manager:<\/p><ol class=\"wp-block-list\">\n<li>On your <strong>hPanel <\/strong>dashboard, navigate to the <strong>sidebar<\/strong> &rarr;<strong> Files <\/strong>&rarr; <strong>File Manager<\/strong>.<\/li>\n\n\n\n<li>Click the <strong>Access all files of hosting<\/strong> button.<\/li>\n\n\n\n<li>Open the <strong>.log<\/strong> folder. If you can&rsquo;t find this directory, it might be hidden. To show it, go to the <strong>sidebar<\/strong> &rarr; <strong>Settings <\/strong>and uncheck the <strong>Hide dotfiles<\/strong> box.<\/li>\n\n\n\n<li>Double-click the <strong>error_log_domain_tld<\/strong> file to see all PHP errors on your website, including their timestamps and types.&nbsp;<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-4-enable-wpdb-error-reporting\">4. Enable WPDB error reporting<\/h3><p>To debug your WordPress database, enable <strong>wpdb<\/strong> class&rsquo; <strong>show_errors<\/strong> variable. This setting will print SQL errors on your website, which helps troubleshoot database connection and syntax errors.<\/p><p>Here&rsquo;s how to enable the <strong>WPDB<\/strong> error reporting via Hostinger File Manager:<\/p><ol class=\"wp-block-list\">\n<li>Open your WordPress website&rsquo;s <strong>public_html<\/strong> folder &rarr;<strong> wp-includes<\/strong>.<\/li>\n\n\n\n<li>Double-click the <strong>class-wpdb.php<\/strong> file to open it.&nbsp;<\/li>\n\n\n\n<li>Find the <strong>class wpdb <\/strong>line.<\/li>\n\n\n\n<li>Within its brackets, find the<strong> $show_errors<\/strong> variable and change its value to<strong> TRUE<\/strong> like so:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public $show_errors = true;&nbsp;<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Click the <strong>disk<\/strong> icon to save the changes.&nbsp;<\/li>\n<\/ol><h2 class=\"wp-block-heading\" id=\"h-how-to-enable-wordpress-debug-using-a-plugin\">How to enable WordPress debug using a plugin<\/h2><p>If you&rsquo;re not comfortable working with code, you can enable the WordPress debug mode using a plugin. For example, <a href=\"https:\/\/wordpress.org\/plugins\/wp-debugging\/\" target=\"_blank\" rel=\"noopener\">WP Debugging<\/a> lets you change the value of the WP_DEBUG variable directly from your admin dashboard.<\/p><p>After you <a href=\"\/my\/tutorials\/wordpress\/how-to-install-wordpress-plugins\/\">download and install the plugin<\/a> via the WordPress admin dashboard, follow these steps to enable the debugging mode:<\/p><ol class=\"wp-block-list\">\n<li>Go to the <strong>sidebar<\/strong> &rarr;<strong> Tools<\/strong> &rarr; <strong>WP Debugging<\/strong>.<\/li>\n\n\n\n<li>Check the <strong>Set WP_DEBUG to true <\/strong>box. Optionally, you can set whether you want WordPress to show the issues on the front end and ignore fatal errors.&nbsp;<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a577abe31c45\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a577abe31c45\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1460\" height=\"780\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wp-debugging-settings-in-the-wordpress-admin-area.png\/w=1024,h=1024,fit=scale-down\" alt=\"WP Debugging settings in the WordPress admin area\" class=\"wp-image-115608\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wp-debugging-settings-in-the-wordpress-admin-area.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wp-debugging-settings-in-the-wordpress-admin-area.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wp-debugging-settings-in-the-wordpress-admin-area.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wp-debugging-settings-in-the-wordpress-admin-area.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wp-debugging-settings-in-the-wordpress-admin-area.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1460px) 100vw, 1460px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Click <strong>Save Changes<\/strong>.<\/li>\n<\/ol><p>For a more comprehensive analysis than the default WordPress debugging feature, we recommend <a href=\"https:\/\/wordpress.org\/plugins\/query-monitor\/\" target=\"_blank\" rel=\"noopener\">Query Monitor<\/a>. It shows includes data for troubleshooting database queries, PHP calls, and script executions.<\/p><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a577abe33d2a\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a577abe33d2a\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1460\" height=\"716\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/query-monitor-plugin-user-interface-in-the-wordpress-admin-dashboard.png\/w=1024,h=1024,fit=scale-down\" alt=\"Query Monitor plugin user interface in the WordPress admin dashboard\" class=\"wp-image-115609\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/query-monitor-plugin-user-interface-in-the-wordpress-admin-dashboard.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/query-monitor-plugin-user-interface-in-the-wordpress-admin-dashboard.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/query-monitor-plugin-user-interface-in-the-wordpress-admin-dashboard.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/query-monitor-plugin-user-interface-in-the-wordpress-admin-dashboard.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/query-monitor-plugin-user-interface-in-the-wordpress-admin-dashboard.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1460px) 100vw, 1460px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>After you install the plugin, a menu will appear on your admin bar. Clicking it opens a window that details various data categories, such as:<\/p><ul class=\"wp-block-list\">\n<li><strong>Overview<\/strong> &ndash; shows a summary of your WordPress website loading process, including the number of queries, memory usage, and page generation time.&nbsp;<\/li>\n\n\n\n<li><strong>Database Queries<\/strong> &ndash; lists all the calls WordPress sends to the database when loading a web page, which is useful for checking SQL syntax errors or connectivity issues.<\/li>\n\n\n\n<li><strong>Logs <\/strong>&ndash; contains any error messages from PHP components of your WordPress website that have the <strong>qm\/debug<\/strong> action, like plugins.<\/li>\n\n\n\n<li><strong>Scripts<\/strong> &ndash; displays all JavaScript files that WordPress loads when rendering a web page, including their position, source, and host.&nbsp;<\/li>\n\n\n\n<li><strong>Styles<\/strong> &ndash; contains a list of CSS files WordPress uses to render a web page content, including their handler and position.&nbsp;<\/li>\n<\/ul><p>Several Query Monitor features, like logging, won&rsquo;t work out of the box, and you must add the tracking code manually. The plugin provides a manual in each section to guide you through the setup.<\/p><p>Note that all logged-in users can see the plugin&rsquo;s menu, potentially exposing sensitive information. To hide the debugging information, <a href=\"\/my\/tutorials\/wordpress-hide-admin-bar\/\">hide the WordPress admin bar<\/a> for all accounts except administrators.<\/p><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Need help troubleshooting your website?                <\/p>\n            <\/div>\n            <p class=\"protip__content\"> Hostinger WordPress hosting&rsquo;s <a href=\"\/blog\/wordpress-ai-troubleshooter\/\">AI Troubleshooter<\/a> automatically warns you of any issues on your website. You can easily fix them by clicking the <strong>Fix errors<\/strong> button in hPanel.<\/p>\n                    <\/div>\n        \n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-wordpress-debug-best-practices\">WordPress debug best practices<\/h2><p>These are best practices for an effective and secure troubleshooting process when debugging WordPress.<\/p><p><strong>Avoid showing error messages<\/strong><\/p><p>While error messages help you identify issues, displaying them on the front end might harm user experience.<\/p><p>A default error page also makes your website look less trustworthy. To avoid it, set up a redirect to another page so visitors can continue to navigate your site.<\/p><p>Moreover, some error messages might display parts of your WordPress website code. This might raise a security risk since cyber criminals can use this information to find potential entry points.<\/p><p><strong>Enable the maintenance mode<\/strong><\/p><p>When debugging or troubleshooting issues, it&rsquo;s best to enable <a href=\"\/my\/tutorials\/wordpress-maintenance-mode\/\">WordPress maintenance mode<\/a>. This hides any error messages and redirects visitors to a specific landing page.<\/p><p>Hostinger users can easily enable the maintenance mode from hPanel. Go to <strong>Websites<\/strong> &rarr; <strong>Dashboard<\/strong> &rarr;<strong> WordPress<\/strong> &rarr;<strong> Overview<\/strong>. Then, click on the <strong>Maintenance mode <\/strong>toggle.<\/p><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a577abe36722\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a577abe36722\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1460\" height=\"436\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-maintenance-mode-toggle-in-hpanel.png\/w=1024,h=1024,fit=scale-down\" alt=\"WordPress maintenance mode toggle in hPanel\" class=\"wp-image-115610\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-maintenance-mode-toggle-in-hpanel.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-maintenance-mode-toggle-in-hpanel.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-maintenance-mode-toggle-in-hpanel.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-maintenance-mode-toggle-in-hpanel.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-maintenance-mode-toggle-in-hpanel.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1460px) 100vw, 1460px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Note that this feature redirects users to the Hostinger&rsquo;s default Maintenance page. If you want a custom design, use a plugin like <a href=\"https:\/\/wordpress.org\/plugins\/wp-maintenance-mode\/\" target=\"_blank\" rel=\"noopener\">LightStart<\/a>.<\/p><p><strong>Use WordPress staging area<\/strong><\/p><p>After debugging an error, we recommend testing the solution in a staging environment first before deploying it to the live site.<\/p><p>Hostinger users with the Business or higher plan can easily set up a WordPress staging environment by heading to<strong> hPanel <\/strong>&rarr; <strong>Websites <\/strong>&rarr; <strong>Dashboard<\/strong> &rarr; <strong>WordPress<\/strong> &rarr;<strong> Staging <\/strong>and clicking the <strong>Create staging <\/strong>button<\/p><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a577abe38b2a\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a577abe38b2a\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1460\" height=\"522\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-staging-creation-menu-in-hpanel.png\/w=1024,h=1024,fit=scale-down\" alt=\"WordPress staging creation menu in hPanel\" class=\"wp-image-115611\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-staging-creation-menu-in-hpanel.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-staging-creation-menu-in-hpanel.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-staging-creation-menu-in-hpanel.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-staging-creation-menu-in-hpanel.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/45\/2024\/09\/wordpress-staging-creation-menu-in-hpanel.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1460px) 100vw, 1460px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Alternatively, you can also set up a staging site using a plugin like <a href=\"https:\/\/wordpress.org\/plugins\/wp-staging\/\" target=\"_blank\" rel=\"noopener\">WP Staging<\/a><strong> <\/strong>or <a href=\"\/my\/tutorials\/install-wordpress-locally\/\">install a WordPress environment locally<\/a> on your personal computer using a web stack such as <strong>XAMPP<\/strong>.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>The WordPress debug mode lets developers display and log error messages for easier troubleshooting. To enable it, access your website&rsquo;s root directory and open the <strong>wp-config.php<\/strong> file. Set the <strong>WP_DEBUG<\/strong> and <strong>WP_DEBUG_LOG<\/strong> variables to <strong>TRUE<\/strong>.<\/p><p>To display CSS and JavaScript core file errors, enable the dev version of these programming languages. To do so, open the <strong>wp-config.php<\/strong> file and set the<strong> SCRIPT_DEBUG<\/strong> parameter to <strong>TRUE<\/strong>.<\/p><p>You can also enable PHP&rsquo;s built-in error logging feature by enabling the <strong>log_error()<\/strong> function in the <strong>php.ini<\/strong> file. Alternatively, Hostinger users can easily do so by activating the <strong>logErrors<\/strong> feature in hPanel&rsquo;s <strong>PHP Configuration<\/strong> menu.<\/p><p>To check database issues, set the <strong>$show_errors<\/strong> variable in <strong>public_html\/wp-includes\/class-wpdb.php<\/strong> to <strong>TRUE<\/strong>. If you&rsquo;re uncomfortable editing code, you can enable WP_DEBUG using the <strong>WP Debugging<\/strong> plugin or check the data directly using <strong>Query Monitor<\/strong>.<\/p><h2 class=\"wp-block-heading\" id=\"h-wordpress-debug-faq\">WordPress Debug FAQ<\/h2><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1726157541698\"><h3 class=\"schema-faq-question\">How do I check my WordPress debug mode?<\/h3> <p class=\"schema-faq-answer\">To see if your WordPress debug mode is enabled, open your website&rsquo;s <strong>public_html <\/strong>folder using an FTP client or your hosting provider&rsquo;s file manager. Open <strong>wp-config.php<\/strong> and check if the <strong>define( &lsquo;WP_DEBUG&rsquo;, true) <\/strong>value is set to <strong>TRUE<\/strong>. <strong>FALSE<\/strong> means the debugging is disabled.&nbsp;<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1726157548341\"><h3 class=\"schema-faq-question\">How do I see all the errors in WordPress?<\/h3> <p class=\"schema-faq-answer\">To list all WordPress errors, set the <strong>WP_DEBUG_LOG<\/strong> and <strong>WP_DEBUG<\/strong> variables in <strong>wp-config.php<\/strong> to <strong>TRUE<\/strong>. Alternatively, you can enable the <strong>error_log() <\/strong>function in <strong>php.ini<\/strong>. Hostinger users can do so without coding by activating the<strong> logErrors<\/strong> setting in hPanel&rsquo;s <strong>PHP Configuration<\/strong> menu.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1726157553025\"><h3 class=\"schema-faq-question\">Why is the WordPress debug log not created?<\/h3> <p class=\"schema-faq-answer\">If WordPress doesn&rsquo;t log errors, the <strong>WP_DEBUG_LOG<\/strong> variable is most likely set to <strong>FALSE<\/strong>. In addition, you must set the <strong>WP_DEBUG<\/strong> to <strong>TRUE<\/strong> and <strong>WP_DEBUG_DISPLAY<\/strong> to <strong>FALSE<\/strong>. If you use PHP&rsquo;s <strong>error_log() <\/strong>function, the error log file should be located under the hidden <strong>.log<\/strong> folder.&nbsp;<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>The WordPress debug mode is a built-in feature that lets you display and log error messages for more accurate troubleshooting. It is crucial for maintaining your website functionality, especially after adding custom code that might be triggering issues. This tutorial will explain the WordPress debug mode and different ways to enable it. Since these methods [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/my\/tutorials\/debug-wordpress\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":337,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to enable WordPress debug + troubleshooting","rank_math_description":"Learn what wordpress debug is and 4 ways to enable it: 1. Using WP_DEBUG. 2. Using SCRIPT_DEBUG, 3. Using PHP error log and more.","rank_math_focus_keyword":"wordpress debug","footnotes":""},"categories":[1],"tags":[],"class_list":["post-18138","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"hreflangs":[],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/18138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/users\/337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/comments?post=18138"}],"version-history":[{"count":31,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/18138\/revisions"}],"predecessor-version":[{"id":123117,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/18138\/revisions\/123117"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media?parent=18138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/categories?post=18138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/tags?post=18138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}