Skip to content

Instantly share code, notes, and snippets.

@allysonsouza
Last active May 24, 2023 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allysonsouza/8a4d09d4366bcf475bf62fae97cd22b4 to your computer and use it in GitHub Desktop.
Save allysonsouza/8a4d09d4366bcf475bf62fae97cd22b4 to your computer and use it in GitHub Desktop.
Error Reporting Level for WordPress
<?php
/**
* Plugin Name: Error Reporting Level
* Description: Sets the error reporting level for your WordPress install. View more on: https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
* Plugin URI:
* Version:
* Author: Allyson
* Author URI: https://allysonsouza.com.br
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* cURL install as mu-plugin: curl -O https://gist.githubusercontent.com/allysonsouza/8a4d09d4366bcf475bf62fae97cd22b4/raw/1a3eec6367d9f0fc852691f0283c12aa18319ebf/error-reporting-level.php && mv error-reporting-level.php ./wp-content/plugins/mu-plugins/
*/
*/
// Disable Notices, Strict and Deprecated
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
// Disable only Deprecated
// error_reporting(E_ALL & ~E_DEPRECATE);
@allysonsouza
Copy link
Author

Install it as a must-use-plugin, in /mu-plugins directory and set the error_reporting() function according to what level of reporting do you need for your WordPress install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment