The 512KB Club part 2: Going below 100KB

WordPress released the first beta for 6.1, including the all-new default theme, Twenty Twenty Three, and on a whim I decided to try it out and see if I can squeeze a few extra bytes after my first attempts at optimization. I’m happy to report that this site is now around 93 KB uncompressed and 20 KB compressed! This is a huge leap from just days ago, when the compressed size of the size was 97 KB.

The Twenty Twenty Three theme brings a new concept of “styles” that act as sub-themes; they are also defined in JSON files instead of CSS, which is probably what makes it so much smaller by default. What weighs it down are once again the bunch of custom fonts it brings along, most notably Source Serif Pro at 418KB. Additionally, there are also a number of weird requests to CSS files that are not there – this is probably just a bug that will be resolved before WordPress 6.1 is released, but for now, these 404 errors only add up to the page load time. Edit: those extra requests to CSS files that were 404ing have been resolved in Beta2.

Once again, I started with a child theme. For some reason, the dequeue hack did not work on this theme’s fonts, but the theme.json file makes it easy to simply erase the whole “fontFace” array. This removed those heavy fonts, but for the non-existent styles, I once again had to turn to wp_dequeue_style – luckily, it worked:

function my_dequeue_fonts() {
add_action( 'wp_enqueue_scripts', 'my_dequeue_fonts', 11 );

The final results after this round of optimizations:

20.7/93.7KB and 527ms to LCP – simply mind-blowing results.