How to Enable WP_DEBUG in WordPress - Featured Image

How to Enable WP_DEBUG in WordPress

by Sorin Marta

If you are seeing a 500 error on your site or if you are witnessing the error page from WordPress that says that something went wrong on your site.

It means that some error prevents the site from loading, and you need to find out what the error is to fix it.

There are a few ways to see the errors triggered on your site. But the easiest of them all is to enable WP_DEBUG.

And here is how you do that.

Showing errors on the page

1 – You have to access the files of your site. You can do that via FTP using a client like FileZilla or your hosting provider’s administration panel.

I would guide you more on that, but I would have to know which hosting provider you are hosted by.

But if you are not sure how to access the files, you can always shoot them a support request, and they will guide you to where the files are 🙂

2 – When you can see the files, you have to look for a file called wp-config.php, and you need to edit the file.

3 – Now you need to look for a line of code that has the following snippet on it:

PHP
define( 'WP_DEBUG', false );

In some instances, it may also have this comment on top of it, but that’s only in the newer versions

PHP
/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the documentation.
 *
 * @link https://wordpress.org/documentation/article/debugging-in-wordpress/
 */

4 – Change the false part of the first snippet and set it to true

5 – Refresh the page where you got the error message, and now you should see the error messages on the page

Conclusion

Now you can see the error messages, so you should be able to see where they are coming from.

!

If you face any issues or questions, don't hesitate to contact us

You may also like

  1. How to Change the WordPress Permalinks - Learn how to change WordPress permalinks for improved SEO and user experience. Learn the steps, tips, and best practices in this comprehensive guide.

  2. How to Get the User ID in WordPress - If you need to get a WordPress user's ID you can follow this guide and learn the how you can do that in both dashboard and code.

  3. How to Enable WP_DEBUG in WordPress - WordPress will hide any kind of errors generated on your site. Learn how to disable that behaviour and how to set WordPress to show errors.

  4. How to Redirect a Post to an External Page in WordPress - Guide on redirecting WordPress posts to external sites using the 'Page Links To' plugin, detailing installation and setup.

  5. How to Send Slack Messages from WP Fusion - Looking to get notified when a new customer signs up? Or perhaps you need to get notified when a customer gets assigned with a tag by WP Fusion.

  6. Leveraging Membership Sites for Community Building - Unlock the power of membership sites to build vibrant communities, fostering connections and engagement in a tailored online space.

  7. Effective Content Strategy for WordPress Sites - Master your WordPress site's success with our guide on creating a winning content strategy, from audience research to effective promotion.

Comments

There are no comments yet. You can be the first to let us know your thoughts!