ExperimentsSite speed
Moving jQuery to the footer made the page paint faster, then broke its layout
In short
First paint dropped under 3 seconds, but a slider started late and moved the page, so the overall score went down.
What I did
On a restaurant client's site I moved the jQuery script from the top of the page to the bottom, so the page could show something sooner. First contentful paint improved to 2.7 seconds. But the homepage slider depended on jQuery and now started late. When it started, it pushed the layout around: layout shift went from 0 to 0.135.
Where
A restaurant website, May 2026
What changed
The overall speed score went down, so I reverted the change. The layout shift went back to 0.
Did it work
It backfired
What you should do
If you move scripts to make a page faster, check layout shift as well as load time. Watch the page load on a phone and look for anything that jumps.
How long it took
About an hour, including the revert
jQuery is a common JavaScript library many WordPress themes rely on. Layout shift measures how much the page jumps around while it loads.
Why it matters
Google measures both speed and stability. Moving a script can help one and hurt the other. Here the slider needed jQuery the moment the page started, so delaying it made the slider appear late and push everything down.
How to check your own site
- Run PageSpeed Insights before and after each change and compare all the numbers, not just one.
- Pay special attention to sliders, carousels and pop-ups.
At a glance
ResultIt backfired
Effort to copyAbout an hour
Type of businessRestaurant and food
SubjectSite speed
2.7 sfirst paint after the change
0 to 0.135layout shift
Revertedthe overall score went down
| Status | Done |
|---|---|
| Hypothesis | Loading jQuery at the end of the page will speed up first paint without side effects. |
| Measured by | First contentful paint, layout shift and overall mobile score |
What this changed in how I work
A speed fix that moves the page is not a fix. I now test every script change for layout shift before I keep it.
End of Lab entry No. 036
- No WordPress speed setting could fix the homepage, because it was a JavaScript app8 Nov 2026
- The biggest speed win was hidden icon and font files that my caching plugin did not touchIt worked24 Oct 2026
- Sending the hero image preload as a server header cut load time by about a secondIt worked23 Oct 2026
