Last active
August 26, 2018 18:52
-
-
Save Willem-Siebe/3f6bff80b01973a21467 to your computer and use it in GitHub Desktop.
Remove CSS and JS from Jetpack plugin, see http://wordpress.org/support/topic/plugin-jetpack-by-wordpresscom-unnecessary-java-script-call for JS and https://wordpress.org/support/topic/remove-the-css and http://css-tricks.com/snippets/wordpress/removing-jetpack-css/ for CSS.
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
| // Remove CSS and JS from Jetpack plugin, see https://gist.github.com/Willem-Siebe/3f6bff80b01973a21467. | |
| function wsis_remove_jetpack_assets() { | |
| // devicepx-jetpack.js, used to optionally load retina/HiDPI versions of files (Gravatars etc) which are known to support it, for devices that run at a higher resolution. | |
| wp_dequeue_script( 'devicepx' ); | |
| } | |
| add_action( 'wp_enqueue_scripts', 'wsis_remove_jetpack_assets', 20 ); | |
| // Remove CSS file, from version 3.2 of Jetpack | |
| add_filter( 'jetpack_implode_frontend_css', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remove CSS is method from version 3.2 of Jetpack, see also https://www.twirlingumbrellas.com/wordpress/remove-deregister-jetpack-contact-form-styles/.