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?
Leave a Reply
You must be logged in to post a comment.
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?
You must be logged in to post a comment.
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.
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.
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?
If you’re concerned about jQuery load time, use Google as a CDN: WordPress ⺠Use Google Libraries « WordPress Plugins
WP doesn’t add it.
If you’re not loading jQuery yourself, odds are that your theme and plugins probably will. You want jQuery if it’s around.