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.
The code on the page misses the last }
Thanks Alexey, Didn’t notice that, updated the post.
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.
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’);
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.
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.
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’);