Black Friday Sale! Get up to $30 off GP Premium! Learn more ➝

[Support request] Search bar vs Autoptimize setting

Home Forums Support [Support request] Search bar vs Autoptimize setting

Home Forums Support Search bar vs Autoptimize setting

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #222242
    John

    Tom,

    The unfolding search bar stopped working on my site.
    Changing Autoptimize setting “Force JavaScript in <head>?” (Load JavaScript early) to unchecked made it work again.

    Seen anything like that elsewhere?

    #222335
    Ramesh Srinivasan

    Update: Pls ignore my post.. Didn’t make notice of “Force JavaScript in <head>” setting in your original post. Will go get a cup of coffee and come back πŸ™‚

    Hi,

    I use Autoptimize and don’t face this problem. Can you list the JavaScript optimization setting you’re using?

    Here are my settings.

    Optimize JavaScript Code – Enabled (of course πŸ™‚
    Force JavaScript in <head> – Disabled
    Also aggregate inline JS? – Disabled
    Exclude scripts from Autoptimize- (Default settings)
    Add try-catch wrapping? – Disabled

    #222344
    John

    I followed Tom’s settings advised on https://generatepress.com/fastest-wordpress-theme/ but as mentioned unckecked forced header to get the search bar to work.
    (thus, if other see the problem, Tom may want to update his suggested settings)

    #222345
    Tom
    Lead Developer
    Lead Developer

    Hi John,

    Hard to tell without seeing it, but can you try adding jquery.js to the ignored list?

    #222417
    John

    Tried adding jquery.js to “Exclude scripts” list. Checking the forced header leads to non-working search bar πŸ™
    The site is https://coe.qualiware.com

    #222524
    Tom
    Lead Developer
    Lead Developer

    Very strange, but after some thought, forcing JS to the head isn’t a good idea for speed. As the option says, it makes it render blocking all to prevent JS errors.

    If there’s no JS errors without forcing it to the head, you’re better off keeping that option unchecked.

    I’ll update the article πŸ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.