{"id":2003,"date":"2018-12-17T09:49:00","date_gmt":"2018-12-17T09:49:00","guid":{"rendered":"https:\/\/www.htmlgoodies.com\/uncategorized\/5-simple-techniques-to-debug-a-wordpress-site\/"},"modified":"2021-10-06T16:59:06","modified_gmt":"2021-10-06T16:59:06","slug":"5-simple-techniques-to-debug-a-wordpress-site","status":"publish","type":"post","link":"https:\/\/www.htmlgoodies.com\/cms\/5-simple-techniques-to-debug-a-wordpress-site\/","title":{"rendered":"5 Simple Techniques to Debug a WordPress Site"},"content":{"rendered":"
WordPress has dominated the Internet as a well-known content management system (CMS), powering more than 30% of total websites today<\/a>. One of the main reasons that people prefer WordPress is because of its easy-to-use interface and functionalities.<\/p>\n The core developers behind WordPress have also made the debugging or troubleshooting easier for users, the way they’ve done with other features. Just by adding or removing a number of lines of code, users can enable the debugging easily.<\/p>\n If you are a WordPress developer, you certainly know about the basic WordPress debugging techniques to work on theme and plugin errors. However, these things can be difficult for you, if you are not a tech whiz. You will then need help of developers to debug the errors for you.<\/p>\n This article seeks to help you easily debug WordPress without having to talk to any developers. But, before you learn about these techniques, let’s first learn about the most common types of errors that can occur in your WordPress site.<\/p>\n Having said that, following are the top 5 WordPress debugging techniques that come to your rescue.<\/p>\n WP_DEBUG, a PHP constant, allows you to trigger the debug mode for the entire WordPress website. By default, the WP-DEBUG is assumed to be false, and is switched to true in wp-config.php file to help WordPress users in development process.<\/p>\n When you enable the WP_DEBUG, it will show all the PHP errors, notices, as well as warnings on the screen.<\/p>\n You can also see the notices related to deprecated functions used on your site. It will then indicate new functions which should be used rather than the deprecated functions.<\/p>\n One thing you should take care of is not to use WP_DEBUG or other debugging tools on a live website. These tools are usually created for testing and staging installs.<\/p>\n There are two companions of WP_DEBUG, named WP_DEBUG_LOG and WP_DEBUG_DISPLAY.<\/p>\n The WP_DEBUG_LOG aims to manipulate all the errors and save them to debug.log file in the wp-content directory. This allows you to check or review the notices and errors in future whenever you need.<\/p>\n On the other hand, the WP_DEBUG_DISPLAY controls whether to display debug messages in HTMP of pages or not. By default, it is set to true which means that it will display errors and warnings whenever they’re generated. If you set it to false, the errors will get hidden.<\/p>\n WordPress allows you to install any plugin on your site as per the functionality needed. Same goes for debugging as well. There are plenty of WordPress debugging plugins out there which you can use for your site. We have curated some of the best<\/p>\n WordPress plugins available<\/a>\u00a0for you.<\/p>\n It is recommended that you use these plugins right after building your website.<\/p>\n Sometimes, both the WordPress and PHP can’t find some of the errors. For instance, if your website script goes beyond the maximum run time, there will be no PHP error. But, your system might show an \u2018Internal Server Error.’ It can be because of an error that caused it at the server, which might be a result of your previous debugging.<\/p>\n In such cases, you will need to check the error log to find whether or not your PHP code or any part of WordPress installation caused any unique error.<\/p>\n When you set up your blog, consult your web host provider or check web hosting settings and know the location in which logging is stored. Usually, it can be found under the logs folder.<\/p>\n It is a debugging add-on that helps you in analyzing the website to find errors, network problems, design flaws, and interaction of functions.<\/p>\n\n
1. WP_DEBUG<\/h2>\n
define( 'WP_DEBUG', true );\r\ndefine( 'WP_DEBUG', false ); <\/code><\/pre>\n
2. WordPress debugging plugins<\/h2>\n
\n
3. Server Error Logs<\/h2>\n
4. Firebug<\/h2>\n