Skip to content

Instantly share code, notes, and snippets.

@subfission
Last active April 26, 2018 17:46
Show Gist options
  • Select an option

  • Save subfission/b6eb8eb3647cb7f47063c11bda68e3cd to your computer and use it in GitHub Desktop.

Select an option

Save subfission/b6eb8eb3647cb7f47063c11bda68e3cd to your computer and use it in GitHub Desktop.
Disable XMLRPC API & Pingback for Wordpress
/**
Disable XMLRPC API in Wordpress
This line of code does effectively the same thing as
this plugin: https://wordpress.org/plugins/disable-xml-rpc/
NOTE: If you are using JetPack plugin, this will not work.
Add these lines to the functions.php file:
**/
add_filter(‘xmlrpc_enabled’, ‘__return_false’);
// Disable X-Pingback to header
add_filter( 'wp_headers', 'disable_x_pingback' );
function disable_x_pingback( $headers ) {
unset( $headers['X-Pingback'] );
return $headers;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment