Title: wp_is_fatal_error_handler_enabled
Published: May 7, 2019
Last modified: August 20, 2026

---

# wp_is_fatal_error_handler_enabled(): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#description)
 * [Return](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#changelog)

Checks whether the fatal error handler is enabled.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#description)󠁿

A constant `WP_DISABLE_FATAL_ERROR_HANDLER` can be set in `wp-config.php` to disable
it, or alternatively the [‘wp_fatal_error_handler_enabled’](https://developer.wordpress.org/reference/hooks/wp_fatal_error_handler_enabled/)
filter can be used to modify the return value.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#return)󠁿

 bool True if the fatal error handler is enabled, false otherwise.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#source)󠁿

    ```php
    function wp_is_fatal_error_handler_enabled() {
    	$enabled = ! defined( 'WP_DISABLE_FATAL_ERROR_HANDLER' ) || ! WP_DISABLE_FATAL_ERROR_HANDLER;

    	/**
    	 * Filters whether the fatal error handler is enabled.
    	 *
    	 * **Important:** This filter runs before it can be used by plugins. It cannot
    	 * be used by plugins, mu-plugins, or themes. To use this filter you must define
    	 * a `$wp_filter` global before WordPress loads, usually in `wp-config.php`.
    	 *
    	 * Example:
    	 *
    	 *     $GLOBALS['wp_filter'] = array(
    	 *         'wp_fatal_error_handler_enabled' => array(
    	 *             10 => array(
    	 *                 array(
    	 *                     'accepted_args' => 0,
    	 *                     'function'      => function() {
    	 *                         return false;
    	 *                     },
    	 *                 ),
    	 *             ),
    	 *         ),
    	 *     );
    	 *
    	 * Alternatively you can use the `WP_DISABLE_FATAL_ERROR_HANDLER` constant.
    	 *
    	 * @since 5.2.0
    	 *
    	 * @param bool $enabled True if the fatal error handler is enabled, false otherwise.
    	 */
    	return apply_filters( 'wp_fatal_error_handler_enabled', $enabled );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/error-protection.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/error-protection.php#L108)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/error-protection.php#L108-L140)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#hooks)󠁿

 [apply_filters( ‘wp_fatal_error_handler_enabled’, bool $enabled )](https://developer.wordpress.org/reference/hooks/wp_fatal_error_handler_enabled/)

Filters whether the fatal error handler is enabled.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#related)󠁿

| Uses | Description | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

| Used by | Description | 
| [wp_register_fatal_error_handler()](https://developer.wordpress.org/reference/functions/wp_register_fatal_error_handler/)`wp-includes/error-protection.php` |

Registers the shutdown handler for fatal errors.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_is_fatal_error_handler_enabled/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_is_fatal_error_handler_enabled%2F)
before being able to contribute a note or feedback.