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.

I am developing a site that must be HTTPS secure and Wordpress is loading <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> at the very top of my page, before <html> and giving me an insecure error. I cannot find where this is being loaded from to prevent it from loading.

Unfortunately I cannot show the site as it's a federal credit union site and it would be against our contract agreement for me to present this site publicly before it is complete.

Here's a screenshot of the issue via Chrome web dev tools. http://oi50.tinypic.com/wjtchi.jpg

share|improve this question
3  
it's your theme or a plugin, core WordPress and default themes don't do that. –  Milo Mar 20 '13 at 21:08
    
I have deactivated all my plugins to see if that would fix it and it did not. The site is built on a custom framework and I have nothing in there that would load that library. I think it's some sort of inherited wp_enqueue_script issue. –  Anthoney Carter Mar 20 '13 at 21:15
1  
not sure what you mean by inherited wp_enqueue_script issue. WordPress loads it's own version of jQuery from the includes folder, so your theme is doing something somewhere. –  Milo Mar 20 '13 at 21:20
1  
Agree with Milo. If your plugins are eliminated, it can only be your theme. try switching to a standard theme (twentysomething). Does the problem go away? Of course it does. –  vancoder Mar 20 '13 at 21:46

1 Answer 1

up vote -1 down vote accepted

When I build themes, I also like to make the WordPress header as clean as possible and then reconstruct it to my own liking. The code below is excessive for your question, but it might help you with other 'WordPress inserted code' in the future. The key snippet of code you are looking for is

wp_deregister_script('jquery'); 
wp_register_script('jquery', '', '', '', true);

Put this in your functions.php file.

My whole WordPress header cleanup:

/* =Clean up the WordPress head
------------------------------------------------- */

    // remove header links
    add_action('init', 'tjnz_head_cleanup');
    function tjnz_head_cleanup() {
        remove_action( 'wp_head', 'feed_links_extra', 3 );                      // Category Feeds
        remove_action( 'wp_head', 'feed_links', 2 );                            // Post and Comment Feeds
        remove_action( 'wp_head', 'rsd_link' );                                 // EditURI link
        remove_action( 'wp_head', 'wlwmanifest_link' );                         // Windows Live Writer
        remove_action( 'wp_head', 'index_rel_link' );                           // index link
        remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );              // previous link
        remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );               // start link
        remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );   // Links for Adjacent Posts
        remove_action( 'wp_head', 'wp_generator' );                             // WP version
        if (!is_admin()) {
            wp_deregister_script('jquery');                                     // De-Register jQuery
            wp_register_script('jquery', '', '', '', true);                     // Register as 'empty', because we manually insert our script in header.php
        }
    }

    // remove WP version from RSS
    add_filter('the_generator', 'tjnz_rss_version');
    function tjnz_rss_version() { return ''; }
share|improve this answer
    
Thanks, @Marc! The wp_deregister_script worked perfectly. I am not using any of Wordpress' theme stuff, writing my own head, header, content, footer, etc. So I was confused why it was loading that jQuery library. –  Anthoney Carter Mar 21 '13 at 15:23
1  
@AnthoneyCarter once again, if it's sourced from code.jquery.com it's not WordPress that's responsible. this is simply deregistering jquery which was registered elsewhere by the theme or a plugin. furthermore, you will break things if you use a plugin that requires jQuery. doing this is not recommended, use at your own risk. –  Milo Mar 21 '13 at 18:55

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.