Google Font display swap in Autoptimize?

Autoptimize 2.5.1 (out earlier this week) does not have an option to enforce font-display on Google Fonts just yet, but this little code snippet does exactly that;

function add_display($in) {
  return $in.'&display=swap';

Happy swapping (or fallback-ing or optional-ing) :-)

9 thoughts on “Google Font display swap in Autoptimize?

    1. frank Post author

      This advanced stuff Roy, better wait for the next major Autoptimize release which will likely have “font-display” as option for Google Font optimization.

  1. Pingback: How I Speeded Up This WordPress Site - Open Source Software Freelancer

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.