Title: wp_maybe_disable_outgoing_pings_for_environment
Published: August 20, 2026

---

# wp_maybe_disable_outgoing_pings_for_environment()

## In this article

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

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

Removes outgoing ping callbacks in non-production environments.

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

Hooked to `do_all_pings` at priority 1 so it runs before the default priority 10
callbacks. Does not remove `do_all_enclosures`.

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

    ```php
    function wp_maybe_disable_outgoing_pings_for_environment() {
    	if ( wp_should_disable_pings_for_environment() ) {
    		remove_action( 'do_all_pings', 'do_all_pingbacks' );
    		remove_action( 'do_all_pings', 'do_all_trackbacks' );
    		remove_action( 'do_all_pings', 'generic_ping' );
    	}
    }
    ```

[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#L3464)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3464-L3470)

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

| Uses | 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.

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

Removes a callback function from an action hook.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_maybe_disable_outgoing_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%2Ffunctions%2Fwp_maybe_disable_outgoing_pings_for_environment%2F)
before being able to contribute a note or feedback.