Challenge
Royal Dental Clinics’ website is a large WordPress and Elementor build: treatment pages rich in video, multiple clinic-location landing pages, booking forms, chat widgets and analytics tags. It looked right, but on mobile it was slow — field data showed the largest contentful paint around six seconds and server response around two seconds, and some treatment pages were far worse. A video-heavy root-canal page scored 26 in a mobile Lighthouse test, with the main thread blocked for about four seconds.
A rebuild was the obvious suggestion and the wrong one. The clinic’s team maintains the site in Elementor; replacing it would have traded a speed problem for a content-operations problem.
Engineering approach
- Diagnose before optimising. We traced each slow metric to a cause: HTML not cached at the edge, the hero image lazy-loaded behind JavaScript so the largest paint waited for scripts, LiteSpeed Guest Mode reloading the first page view, roughly 800 KB of render-blocking CSS, and as many as eight or nine YouTube embeds on a single page hydrating after load.
- Change the site through one versioned plugin. All front-end fixes live in a single must-use plugin with a version marker in the HTML, so every release can be identified on the live site, verified and rolled back — and the clinic’s Elementor editing workflow is untouched.
- Replace video embeds with facades. Elementor video widgets are rewritten to lightweight placeholders that load the real YouTube player only when a visitor clicks play.
- Let the largest paint happen without JavaScript. Hero images and the logo are excluded from lazy-loading and preloaded; Guest Mode’s first-visit reload is switched off; chat and tag-manager scripts wait for user interaction.
- Verify every release on a phone-sized screen. Each change was checked with scripted 390 px browser runs — menus open on first tap, forms still render, brand styling intact — before cache purges went out at both the origin and Cloudflare.
Solution
An iterative series of releases over three weeks, each with a recorded symptom, root cause, fix and verification:
- site-wide YouTube facades and narrowed media “unlock” rules;
- above-the-fold image and logo eager-loading with preload;
- CSS hygiene that keeps LiteSpeed’s optimised CSS from stripping header, menu and background styles for first-time visitors;
- mobile navigation and overlay fixes so menus respond on the first tap;
- consistent headers across the main site and clinic-location pages;
- a separate, lighter configuration for the clinic’s blog, served from the Cloudflare edge cache.
Outcome
Measured in lab Lighthouse tests (simulated mobile) after the video release:
- The root-canal treatment page went from 26 to 69; total blocking time fell from about 4.1 s to 90 ms, largest paint from about 11 s to 7.3 s, and YouTube data transferred on load from about 7 MB to 45 KB.
- The homepage scored 90, with largest contentful paint of 2.2 s.
- Scripted checks confirmed no YouTube network requests before a visitor interacts, and that booking forms, menus and brand styling still worked.
- The blog index, served from the edge cache, measured about 110 ms time to first byte across repeated requests.
The clinic kept its WordPress and Elementor workflow throughout. Read what the clinic says about working with Kamyab in our testimonials.