Remove Unused CSS & JavaScript in WordPress

Find the Unused CSS / JavaScript Files

Remove Unused CSS & JavaScript in WordPress

Remove unused CSS and JavaScript with Asset Cleanup

Remove Unused CSS & JavaScript in WordPress
Remove Unused CSS & JavaScript in WordPress

Remove unused Javascript in using code

/*** We will Dequeue the jQuery UI script as example.** Hooked to the wp_print_scripts action, with a late priority (99),* so that it is after the script was enqueued.*/function wp_remove_scripts() {// check if user is adminif (current_user_can( ‘update_core’ )) {return;}else {// Check for the page you want to targetif ( is_page( ‘homepage’ ) ) {// Remove Scriptswp_dequeue_style( ‘jquery-ui-core’ );}}}add_action( ‘wp_enqueue_scripts’, ‘wp_remove_scripts’, 99 );

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Muhammad Rauf.

Muhammad Rauf.

Innovative tech mind with 15 years of experience working as a computer programmer. Capable of working with a variety of technology and software solutions…