WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Contact Form 7] Jquery js files on every page = unneceassary load on server (6 posts)

  1. rxsc
    Member
    Posted 5 years ago #

    Hello!

    Your plugin is great, i spent hours customizing it, making forms and such.

    However, after looking at the headers, it seems it loads Jquery.js, jquery.form.js, and even contact-form-7.js on every page.

    For a big site that is 65 kbish of extra load for no reason except for 2 pages on my site where users will rarely go.

    I know this is a minor thing but is there a way i can custom code those .js files to appear on only my 2 wordpress pages?

    Unless this is default in wordpress............. then i totally messed up here.

    Thanks!

  2. Takayuki Miyoshi
    Member
    Posted 5 years ago #

    @rxsc currently there is no way but I have a plan to make it. In a few months maybe.

  3. rxsc
    Member
    Posted 5 years ago #

    Few months to move a bunch of code? i guess i can wait....

  4. SuperMAG
    Member
    Posted 5 years ago #

    thats the problem with alot of plugins, i just dont know why. i mean almost 10 plugins.

    Temporary Solution:

    For Example:
    so i removed the hook. that insert js and css files to wp head.

    its like add_action('wp_head', 'quoteScripts');
    from the plugin and inserted the code like:

    <script src="http://wrestlingfans.co.cc/wp-content/plugins/comment-form-quicktags/quicktags.js" type="text/javascript"></script><link rel="stylesheet" href="http://wrestlingfans.co.cc/wp-content/plugins/comment-form-quicktags/style.css" type="text/css" media="screen" />

    to the page thats needs that plugin like your contact form.

  5. holteas
    Member
    Posted 4 years ago #

    Is there any update on this? It's working fine on my site, but I'd like to clean up the header a bit and loading jquery on every page is a waste.

  6. Takayuki Miyoshi
    Member
    Posted 4 years ago #

    Yes. You can use WPCF7_LOAD_JS constant for it.

    http://ideasilo.wordpress.com/2009/05/31/contact-form-7-1-10/#WPCF7_LOAD_JS

Topic Closed

This topic has been closed to new replies.

About this Topic