What do I need jQuery for?

What do you think of killing jQuery in the public facing WP site? Isn’t it useless and making for slower page loading? What’s the best way to get rid of it?

Related posts

Leave a Reply

5 comments

  1. jQuery is loaded by the theme that you use and not by WordPress. The theme must be modified to not load jQuery.

    Useless? not sure. It is very useful. Many themes’ UI elements and even design elements may depend on jQuery.

  2. jQuery is a library loaded on demand (either copy bundled with WordPress or from other server).

    To remove it you first have to determine how is it getting added, which is most probably by theme or plugin. Proper way is usage of wp_enqueue_script() function, but many poorly coded themes/plugins can echo it directly and such.

    In case of theme (that you are not going to update) you can simply edit code out. For theme or plugin that must be compatible with future updates you will need to remove script registration from API hooks – best case scenario. Worst case scenario that it won’t be possible without editing files.

  3. It’s up to you whether you want to use jQuery in your site (on the public site) or not. It’s a part of the theme.

    So, it’s your choice. The best way to get rid of it – simply don’t include it in your theme.

    What’s the question here again?