If you’re experiencing an error on your site, a great first step is to enable error logging so that you can get more info about what’s going wrong.
Enable via WP Debugging Plugin
The easiest way to enable debugging is to install and activate the WP Debugging plugin.
This plugin activates debugging automatically upon installation.
Next, visit the Tools > WP Debugging menu and enable the option to set WP_DEBUG_DISPLAY to false. This will prevent any error messages from being displayed in the interface or publicly on the site.
Lastly, you can hover your cursor over the Debug Quick Look option in the admin toolbar and click on the View File link to view the debug log.
The debug log will include any errors that have occurred since activating the WP Debugging plugin. For this reason, you may have to trigger the error again to capture it in the log. You can search the log for “independent-analytics” to find any messages that are coming from our plugin.
When you are finished, you can deactivate the WP Debugging plugin, and debugging will be disabled on your site.
Enable via wp-config.php
To enable error logging without installing a new plugin, start by accessing your site via FTP. You can use a standalone app like FileZilla if your hosting account doesn’t include a file manager tool.
Once connected, locate and open the wp-config.php file. At the bottom of the file, add the following three lines of code:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );
This code tells WordPress to enable debugging, save errors to the debug log, and not display any error messages on the site.
Once wp-config.php is saved, you can recreate the same error as before, and the error message will be saved in the debug log. Then, you can download the log from the following location: wp-content/debug.log.
You can use this info to debug the issue yourself or share it with us, and we can help to resolve the error.
After the error is resolved, you can delete the three lines of code added to your wp-config.php file.