Coolest Guides on the Planet

coolest guides on the planet

Coolest Guides On The Planet

  • Home
  • macOS
  • WebDev
  • All Posts
  • Contact

De-register De-queue WordPress Loaded Scripts & Styles

April 27, 2014 1 Comment

You can de-register and de-queue WordPress loaded javascripts and CSS styles by passing them into the wp_print_scripts function. This can help with fewer server requests if the scripts are no longer required or if a conflict is occurring.

So for example if I wanted to remove the WordPress Twenty Twelve default mobile menu javascript you would use:

//Remove 2012 Mobile Javascript
function de_script() {
    wp_dequeue_script( 'twentytwelve-navigation' );
    wp_deregister_script( 'twentytwelve-navigation' );
}

add_action( 'wp_print_scripts', 'de_script', 100 );

You just need to know what name was used to register and enqueue it.

Cats: WordPress

Tags

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls

Donate a Beer to the Coolest Guides

Get Beaver Builder Now!

Copyright © 2022· Neil Gee - All Rights Reserved - Hosted by Runcloud

Copyright © 2022 · gee on Genesis Framework · WordPress · Log in