debug wordpress

  1. To enable debugging in WordPress, access your website's files using an FTP client or a file manager provided by your web host.

  2. Locate the wp-config.php file in the root directory of your WordPress installation.

  3. Open the wp-config.php file using a text editor.

  4. Find the line that says "/ That's all, stop editing! Happy publishing. /" in the wp-config.php file.

  5. Directly above this line, add the following code: define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );

  6. Save the changes to the wp-config.php file and upload it back to your server if necessary.

  7. By adding the code above, you have enabled debugging in WordPress. The WP_DEBUG constant is set to true, which enables debugging. The WP_DEBUG_LOG constant specifies that errors should be logged to a debug.log file, and the WP_DEBUG_DISPLAY constant ensures that errors are not displayed on the website.

  8. You can now check for any PHP errors or warnings on your site by reviewing the debug.log file located in the wp-content directory.