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 get the current URL in WordPress using PHP?
- How to increase the upload limit in WordPress using PHP?
- How to redirect to another page in WordPress using PHP?
- How to send an email using PHP in WordPress?
- How to run an SQL query in WordPress using PHP?
- How to create a menu in WordPress using PHP?
- How to use get_header in WordPress using PHP?
- How to check the PHP version in WordPress?
- How to create a snippet in WordPress using PHP?
See more codes...