- Client
- US B2B company
- Years
- 2024–2026
- Work
- Custom themes, Speed, Support
- Stack
- WordPress, ACF, Pantheon, Contact Form 7
The task
A corporate site on a custom theme, hosted on Pantheon. I had worked on it since 2024: new page templates, cards and tab components, a privacy policy template, Google Tag Manager.
In 2026 the team asked for a better PageSpeed score, mostly on mobile. The design and the forms had to stay exactly as they were.
What I did
- Put the critical CSS of the first screen inline and loaded the main 235 KB stylesheet without blocking the page. On inner mobile pages, where deferring caused a flash of unstyled content, the stylesheet stayed blocking.
- Moved the main script, the chat widget and other third-party scripts to the first interaction (scroll, tap, key press). The burger menu and the submenus got small fallbacks, so they work before that script arrives.
- Contact Form 7 and reCAPTCHA load only on pages that have a form, and only when the visitor starts using it.
- Preloaded the hero image on mobile and fixed the layout shift in the mobile hero.
- Removed a caching plugin that fought with Pantheon’s own page cache.
How it went
All of it was done in a separate performance branch, checked on desktop and mobile, and merged only when the menus, forms and tracking worked the same as before. A few ideas, like deferring all CSS on desktop, were rolled back because they made the menu appear late.
Result
The first screen no longer waits for the big stylesheet and the scripts, the mobile hero stays in place while the page loads, and the forms still work with spam protection.
Have a similar task?
Tell me what is broken or what you need. I will reply with questions or a rough plan, usually within a day.
Write to me