Deregister unwanted scripts in WordPress


if ( !is_admin()) {
    add_action( 'wp_print_scripts', 'my_init' ); 

    function my_init() {
    	if(is_home() || is_archive() || is_search()) {
        wp_deregister_script( 'l10n' );
        wp_deregister_script( 'jquery' ); }
    }
}
Advertisements

One thought on “Deregister unwanted scripts in WordPress

  1. pfff.. thanks a lot man. you really saved me a lot of time 🙂

    had a plugin messing with a slider at my home page but needed it on singles
    remove_action didnt work so.. lucky i found your site

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s