Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Are you actually having jQuery on your frontpage and ask this because you don't know wether or not to remove it? And bear in mind that your question can tend (not that it was meant to) to be highly subjective. Imagine someone who dislikes jQuery but prefers another javascript library - wordpress.stackexchange.com/faq -- anyway, you probably want to checkout the questions already given and to refine your question to make it more concrete. –  hakre Nov 19 '10 at 20:28
add comment

5 Answers

up vote 3 down vote accepted

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.

share|improve this answer
    
It's the other way around: jQuery is loaded and used by Wordpress for the admin UI; it may or may not be used by the theme, depending on if it is incuded by the theme designer. –  songdogtech Nov 18 '10 at 21:39
    
@songdogtech: I think that's what Raj was suggesting Mark... And hi, nice to see you here mate... ;) –  t31os Nov 18 '10 at 23:17
    
Yes, I meant to say that the inclusion of jquery is done by the theme and not WordPress. WordPress does ship with its own copy of WordPress that may be used by wordpress themes. –  rsman Nov 19 '10 at 2:21
    
WordPress ships with a copy of WordPress? I'm sure that wasn't intentional either, hehe... ;) –  t31os Nov 19 '10 at 11:49
    
Oops. Thats what no sleep does to you. :P –  rsman Nov 19 '10 at 13:44
show 2 more comments

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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?

share|improve this answer
add comment

If you're concerned about jQuery load time, use Google as a CDN: WordPress › Use Google Libraries « WordPress Plugins

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.