Title: wp_maybe_disable_xmlrpc_pingback_for_environment
Published: August 20, 2026

---

# wp_maybe_disable_xmlrpc_pingback_for_environment( string[] $methods ): string[]

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_maybe_disable_xmlrpc_pingback_for_environment/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_maybe_disable_xmlrpc_pingback_for_environment/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_maybe_disable_xmlrpc_pingback_for_environment/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_maybe_disable_xmlrpc_pingback_for_environment/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_maybe_disable_xmlrpc_pingback_for_environment/?output_format=md#changelog)

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

Removes the pingback XML-RPC method in non-production environments.

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

 `$methods`string[]required

An array of XML-RPC methods, keyed by their methodName.

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

 string[] Modified array of XML-RPC methods.

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

    ```php
    function wp_maybe_disable_xmlrpc_pingback_for_environment( $methods ) {
    	if ( wp_should_disable_pings_for_environment() ) {
    		unset( $methods['pingback.ping'] );
    	}

    	return $methods;
    }
    ```

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

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_maybe_disable_xmlrpc_pingback_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.

  |

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