-
-
Save jgorinjac/3c26ef3c77e10ba1d0f0f38f3c18bda9 to your computer and use it in GitHub Desktop.
Freemius - WordPress Head Cleanup
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
| <?php | |
| // Disable emoji. | |
| remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
| remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
| // Cleanup RPC. | |
| remove_action( 'wp_head', 'rsd_link' ); | |
| remove_action( 'wp_head', 'wlwmanifest_link' ); | |
| // Cleanup oembed. | |
| remove_action( 'wp_head', 'wp_oembed_add_discovery_links' ); | |
| remove_action( 'wp_head', 'wp_oembed_add_host_js' ); | |
| // Remove WP generator meta. | |
| remove_action( 'wp_head', 'wp_generator' ); | |
| // Disable XML RPC | |
| add_filter( 'xmlrpc_methods', function ( $methods ) { | |
| unset( $methods['pingback.ping'] ); | |
| return $methods; | |
| } ); | |
| // Disable RESTful API. | |
| add_filter('json_enabled', '__return_false'); | |
| add_filter('json_jsonp_enabled', '__return_false'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment