Skip to content

Instantly share code, notes, and snippets.

@whatjackhasmade
Created June 5, 2017 11:18
Show Gist options
  • Save whatjackhasmade/a9f7f449266215bc35ff2127fd65871e to your computer and use it in GitHub Desktop.
Save whatjackhasmade/a9f7f449266215bc35ff2127fd65871e to your computer and use it in GitHub Desktop.
functions.php - Remove JQuery/Migrate and WP Embed
// Remove jQuery Migrate Script from header and Load jQuery from Google API
function crunchify_stop_loading_wp_embed_and_jquery() {
if (!is_admin()) {
wp_deregister_script('wp-embed');
wp_deregister_script('jquery'); // Bonus: remove jquery too if it's not required
}
}
add_action('init', 'crunchify_stop_loading_wp_embed_and_jquery');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment