How to enable WP_DEBUG at Hostinger

Enable the WordPress debugging tool to troubleshoot and resolve website errors on your Hostinger hosting plan

Updated 2 weeks ago

The WordPress debugging mode helps you identify, track, and understand errors occurring on your website. This guide explains how to enable error debugging and configure error logs using the Hostinger File Manager.

Before you start

  • This guide applies to web, cloud, and agency hosting.
  • For WordPress websites on agency hosting, you must first enable wp-config.php editing.
    • Go to hPanel → Websites.
    • Click Dashboard next to the website.
    • On the sidebar, go to Files → File Manager.
    • Locate the Editing permission option an, if locked, click on the toggle to unlock it.
    • It is recommended to lock it again after making the changes.

Step 1 – Access the wp-config.php file

  1. Open the file manager for your website.
  2. Navigate to the public_html directory of your domain.
  3. Locate the wp-config.php file within the folder structure.
    Hostinger file manager showing public_html path and wp-config.php highlighted

Step 2 – Enable WP_DEBUG

  1. Right-click the wp-config.php file and select Edit.
  2. Search for the line containing WP_DEBUG:
    define( 'WP_DEBUG', false );
  3. Change the value from false to true:
    define( 'WP_DEBUG', true );

    Hostinger file editor showing wp-config.php with define('WP_DEBUG', true); highlighted

  4. If this line does not exist in the file, add the following code block directly above the line that reads
    /* That's all, stop editing! Happy publishing. */
  5. Save the changes to the file.

Log website errors privately

To keep track of historical error data without displaying technical error messages publicly to website visitors, you can enable error logging and disable the error display.

  1. Open the wp-config.php file for editing.
  2. Add the following lines directly below the line that enables WP_DEBUG:
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Ans save the changes.

The website configuration will now record all background errors silently without disrupting the visitor experience. The generated error log file is automatically saved as debug.log inside the wp-content directory.

Additional resources