php-wordpressHow to disable PHP warnings in WordPress?
To disable PHP warnings in WordPress, you can add the following code to your wp-config.php
file:
error_reporting(0);
@ini_set('display_errors', 0);
This will suppress all PHP warnings and errors from being displayed on the WordPress site.
Code explanation
error_reporting(0);
- This line sets the error reporting level to 0, which will suppress all warnings and errors.@ini_set('display_errors', 0);
- This line sets the display_errors setting to 0, which will prevent any errors from being displayed on the WordPress site.
Helpful links
More of Php Wordpress
- How to use get_header in WordPress using PHP?
- How to increase the upload limit in WordPress using PHP?
- How to get the current URL in WordPress using PHP?
- How to add a shortcode in WordPress?
- How to send an email using PHP in WordPress?
- How to create a snippet in WordPress using PHP?
- How to run an SQL query in WordPress using PHP?
- How to use the WordPress REST API with PHP?
- How to redirect to another page in WordPress using PHP?
See more codes...