add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'wp-block-library-theme' );
wp_dequeue_style( 'wc-block-style' ); // WooCommerce block styles
}, 100 );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
remove_action( 'wp_head', 'wp_oembed_add_host_js' );
add_action( 'wp_enqueue_scripts', function() {
if ( ! is_user_logged_in() ) {
wp_deregister_style( 'dashicons' );
}
} );
add_filter( 'woocommerce_enqueue_block_assets', '__return_false' );
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
wlwmanifest.xml
, rsd
, generator
:remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'wp_generator' );
add_filter( 'rest_enabled', '__return_false' );
add_filter( 'rest_jsonp_enabled', '__return_false' );
❗ Cẩn thận nếu bạn dùng block editor, plugin SEO, hoặc theme cần REST API → không nên tắt hoàn toàn, có thể chỉ giới hạn.
Đã làm rồi:
add_filter( 'wp_resource_hints', '__return_empty_array', 99 );
Bạn muốn tắt | Gợi ý / Plugin |
---|---|
Thứ gì đang load thừa | Dùng plugin Query Monitor hoặc Asset CleanUp |
Tối ưu script & defer | Dùng plugin như Perfmatters, Flying Scripts, WP Rocket |
Bỏ jQuery nếu không cần | Có thể thay thế bằng Vanilla JS nếu bạn tự code theme |