# Cách loại bỏ js và css mặc định wordpress

```php
<?php
// Bước 1:
add_action( 'wp_enqueue_scripts', 'mfnch_enqueue_styles', 101 );
function mfnch_enqueue_styles() {
	wp_deregister_script('jquery-ui-widget');
	wp_deregister_script('wp-embed');	
}
// Bước 2:

https://github.com/WordPress/WordPress/blob/master/wp-includes/script-loader.php
?>
```

```php
<?php
// Bước 1:
add_action( 'wp_enqueue_scripts', 'mfnch_enqueue_styles', 101 );
function mfnch_enqueue_styles() {
	wp_deregister_script('jquery-ui-widget');
	wp_deregister_script('wp-embed');	
}
// Bước 2:
https://github.com/WordPress/WordPress/blob/master/wp-includes/script-loader.php
?>
Tổng hợp những file hay cần loại bỏ:
wp_enqueue_style( 'homecss', CHILD_THEME_URI .'/assets/css/home.css','', false, 'all' );
wp_enqueue_style( 'basemb', CHILD_THEME_URI .'/assets/css/basehome.css', '', false, 'all' );
wp_enqueue_style( 'layoutmb', CHILD_THEME_URI .'/assets/css/layouthome.css', '', false, 'all' );
wp_deregister_script('jquery-ui-tabs');
wp_enqueue_script( 'tabsjs', CHILD_THEME_URI .'/assets/js/tabs.js', array('jquery'), false, true );
wp_dequeue_script('jquery-plugins');
wp_enqueue_script( 'pluginsjs', CHILD_THEME_URI .'/assets/js/plugins.js', array('jquery'), false, true );
wp_dequeue_script('jquery-scripts');
wp_enqueue_script( 'scriptsjs', CHILD_THEME_URI .'/assets/js/scripts.js', array('jquery'), false, true );
wp_dequeue_style('contact-form-7');
wp_dequeue_style('gglcptch');
wp_dequeue_style('mfn-animations');
wp_dequeue_style('mfn-jquery-ui');
wp_dequeue_style('mfn-jplayer');
wp_deregister_script('jquery-ui-widget');
// wp dequeue script
wp_deregister_script('wp-embed');
wp_deregister_script('admin-bar');
wp_deregister_script('contact-form-7');
wp_deregister_script('jquery-animations');
wp_deregister_script('jquery-jplayer');
wp_deregister_script('jquery-mfn-parallax');
wp_deregister_script('jquery-smoothscroll');
// Loại bỏ file js mặc định thừa
wp_deregister_script('jquery-ui-mouse');
wp_deregister_script('jquery-ui-accordion');
// Stop loading wp-emoji-release.min.js in your WordPress site
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
```
