X

Remove l10n.js javascript in wp 3.1+

With new versions of wordpress you may notice l10n.js within the header of your wordpress theme. I can think of many reasons to leave l10n.js localization library enabled however if you have no need for this and wish to disable it this snippet will do the job. Visit this website for more details



Code Snippet:


add_action( 'init', 'remove_l1on' );

function remove_l1on() {
if ( !is_admin() ) {
wp_deregister_script('l10n');
}
}

Comments  Leave a Reply

  1. The code on the page misses the last }

    1. Thanks Alexey, Didn’t notice that, updated the post.

  2. Hey!

    Could you please explain how to remove jQuery UI, jQuery UI Widget and jQuery UI Tabs as well? As I’m not using them on my website, I’d like to stop them from loading.

    Thanks in advance.

    1. Hi ucarmetin
      Are these part of the theme or plugin?
      you should be able to just use this if the plugin or theme registered things that way.
       
      wp_deregister_script(‘name of script’);

      1. they’re loaded neither by the theme nor any of the plugins i’m using. i’ve come to this conclusion after doing further investigation of the theme and plugin code as well contacting theme developers. anway, i’ll try your suggestion.

        thanks.

        1. If you can let me know some of the plugins you are running I can take a look. Rather then post a list publicly just click the contact link at the bottom of the wpsnipp.com site and send an email ill check things out.

    2. Hi ucarmetin
      Are these part of the theme or plugin?
      you should be able to just use this if the plugin or theme registered things that way.
       
      wp_deregister_script(‘name of script’);

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!