Purpose: To identify and troubleshoot errors within your WordPress site.
Method:
- Access
wp-config.php: Locate this file in your WordPress root directory. - Enable Debugging: Add or modify the following line before
/* That's all, stop editing! Happy blogging. */:PHPdefine('WP_DEBUG', true); - Check for Errors: Visit your website and look for detailed error messages.
- Disable Debugging: Once you’ve resolved the issue, change
WP_DEBUGback tofalse.
Note: Enabling debugging can expose sensitive information, so it’s crucial to disable it after troubleshooting.
Additional Tip: For more granular control, consider using WP_DEBUG_LOG to log errors to a file instead of displaying them on the screen.
Example:
PHP
define(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true);