· Tutorial ·

How to activate debug mode in Wordpress

Activate debug mode in Wordpress

The debug mode is a WordPress tool that can be very useful, in order to obtain the error messages that your website made in WordPress is giving you.

To activate this mode, you must edit the wp-config.php file that is in the root folder of your web page (/data/web). You can edit this file through the File Manager offered by the SWPanel (you can also access it by FTP or SSH).

1- Enter the dashboard of the hosting service where you host your WordPress looking for it in the SWPanel:

enter image description here

2- Access the file manager by clicking on Moves about the service -> File Manager:

enter image description here

3-Locate the wp-config.php file inside the hosting service folders (/datos/web/wp-config.php):

enter image description here

4- Place the mouse over the three dots to the right of the wp-config.php file and click on Edit file:

enter image description here

5- In the file editor that will open, look for the following line:

**define( 'WP_DEBUG', false );**

And change the word false to true leaving as a result:

 **define('WP_DEBUG', true);**

To finish, click the Save Changes button:

enter image description here

6- Now if we access the web page with any browser we will see that we have the debug mode activated and it will show us the errors on the screen.

enter image description here

Activate debug mode in Wordpress, but without showing errors publicly

In case you want to activate the debug mode, but do not want the errors to be seen publicly, you must carry out the same steps, but after modifying the value from "false" to "true" you have to add the following lines right below:

**define( 'WP_DEBUG_LOG', true );**

**define( 'WP_DEBUG_DISPLAY', false );**

**@ini_set( 'display_errors', 0 );**

enter image description here

Once this is done, instead of showing the errors on the web page itself, they will be saved in a log (debug.log) inside the folder wp-content which is located in the root directory of the page (/datos/web/wp-content/debug.log).