Я часто використовую цей сніппет на своїх сайтах для більш чистого коду та покращення PageSpeed, адже чим менше завантажується ресурсів – тим швидше користувач отримає відповідь від серверу.
remove_action('wp_head', 'print_emoji_detection_script', 7); //removing emoji remove_action('wp_print_styles', 'print_emoji_styles'); remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); remove_action( 'admin_print_styles', 'print_emoji_styles' ); remove_action( 'wp_head','feed_links', 2 ); // feed links remove_action( 'wp_head','feed_links_extra', 3 ); remove_action( 'wp_head', 'rest_output_link_wp_head', 10 ); remove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 ); remove_action( 'wp_head', 'wp_shortlink_wp_head'); //remove short link remove_action( 'wp_head', 'rsd_link'); // remove rsd link remove_action( 'wp_head', 'wlwmanifest_link'); // remove manifest remove_action('wp_head', 'wp_generator'); //remove generator string function my_deregister_scripts(){ wp_deregister_script( 'wp-embed' ); } add_action( 'wp_footer', 'my_deregister_scripts' ); //deregister wp_embed remove_action( 'wp_enqueue_scripts', 'wp_enqueue_classic_theme_styles' ); //and unused styles