SOLVED: Duplicate <link rel="preconnect"> for fonts.gstatic.com printed once per template

To reproduce: Use any page with multiple Bricks templates, such as a header, footer, page template, and sections. View the page source and count the tags — you will see one per loaded template.

I was trying to figure out what was causing it, and after spending a lot of time on it using Claude, Claude says the root cause is in includes/assets.php. Around that line, add_action( ‘wp_head’, function() { echo ‘’; }, 7 ); is called inside a function that runs per template. Since it uses an anonymous closure each time, WordPress registers it multiple times with no deduplication.

Thanks for the report. We were able to replicate this issue :v:

We’ve addressed this in Bricks 2.4-rc (release candidate), now available for manual download from your Bricks account.

Please read the changelog entry before testing, and let us know if you experience any issues. Release candidates are not recommended for production sites.