Last active
April 26, 2018 17:46
-
-
Save subfission/b6eb8eb3647cb7f47063c11bda68e3cd to your computer and use it in GitHub Desktop.
Disable XMLRPC API & Pingback for Wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| 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