Cart

    Sorry, we could not find any results for your search querry.

    Debugging WordPress using WordPress debug log

    With our web hosting packages, you have the option to view the error.log of your website to see any error messages on your website. The WordPress debug log works slightly differently, as it allows you to troubleshoot WordPress-specific errors in addition to general PHP errors.

    In this article, we explain how to enable your WordPress debug log so you can use it to debug your WordPress website.


    You can enable the debug log in your wp-config.php file by adding a few lines. Before doing so, make a backup of your wp-config.php file so you can easily restore it if necessary. It is also possible to enable debug mode using a plugin if you do not have access to the website files but do have access to your WordPress dashboard.

    To do this, open the File Manager in your control panel and navigate to the folder where your WordPress website is located. In most cases, this is the www folder. You will find all your WordPress files here. 

    edit file


    Open the wp-config.php file by clicking ‘Edit’ and add the following lines just above the lines /* That's all, stop editing! Happy publishing. */:

    define( 'WP_DEBUG', true);
    define( 'WP_DEBUG_LOG', true);
    define( 'WP_DEBUG_DISPLAY', false );

    Then close the file by clicking Save in the bottom-right corner.

    save file


    Below, we explain exactly what each line does:

    • WP_DEBUG enables debug mode. You can disable it again by replacing ‘true’ with ‘false’.
    • WP_DEBUG_LOG ensures that logs are stored in /wp-content/debug.log. You can therefore find and open the debug.log file in the /wp-content/ folder to review your errors.
    • WP_DEBUG_DISPLAY ensures that you can see the errors on your website. This is enabled by default when you only activate WP_DEBUG. Especially in the case of a live site, you will want to disable this, which is why it is useful to disable this option directly with this line. If you do want to see the errors on the site, you can replace ‘false’ with ‘true’, or omit the line.

     

    Need help?

    Receive personal support from our supporters

    Contact us