Title: wp_should_disable_pings_for_environment
Published: August 20, 2026

---

# apply_filters( ‘wp_should_disable_pings_for_environment’, bool $should_disable, string $environment_type )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/wp_should_disable_pings_for_environment/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_should_disable_pings_for_environment/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_should_disable_pings_for_environment/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_should_disable_pings_for_environment/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_should_disable_pings_for_environment/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_should_disable_pings_for_environment/?output_format=md#wp--skip-link--target)

Filters whether pings should be disabled for the current environment.

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

Returning false re-enables pings in non-production environments.
Returning true 
disables pings even in production.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_should_disable_pings_for_environment/?output_format=md#parameters)󠁿

 `$should_disable`bool

Whether pings should be disabled. Default true for non-production environments, 
false for production.

`$environment_type`string

The current environment type as returned by [wp_get_environment_type()](https://developer.wordpress.org/reference/functions/wp_get_environment_type/).

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

    ```php
    return apply_filters( 'wp_should_disable_pings_for_environment', $should_disable, $environment_type );
    ```

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

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

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

Determines whether pings should be disabled for the current environment.

  |

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

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

## User Contributed Notes

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