X

Remove l10n.js JavaScript in WP 3.1+

Snippets by IsItWP

Do you want to disable the l10n.js localization library in WordPress 3.1 or above? While the JavaScript library in not necessary for you, we have created a quick code snippet that you can use to remove l10.js JavaScript in WordPress.

Instructions:

All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:

add_action( 'init', 'remove_l1on' );

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

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly add code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: 9 best WordPress accordion plugins and how to create a contact form in WordPress.

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 Cancel reply

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!