OMGF PRO was written with performance and ease of use in mind. It uses the Google Fonts Helper API to automatically cache the fonts your theme and plugins use to minimize DNS queries and speed up your WordPress website.
HOW DOES IT WORK?
After installing the plugin, select the optimization mode: Manual (default) or Automatic.
If you choose Manual, you can simply configure OMGF PRO to work the way you want and run its detection mechanism on an address of your choice.
In automatic mode, OMGF PRO runs unnoticed in the background and records all inquiries made to fonts.googleapis.com or fonts.gstatic.com. When a webpage loads for the first time, it redirects these requests to its own download API and copies the fonts to your server. Then it generates a stylesheet for your fonts including the formats EOT, TTF, WOFF and WOFF2 to ensure maximum cross-browser compatibility!
When the fonts are downloaded and the stylesheet is generated, it rewrites any URL (pointing to fonts.googleapis.com or fonts.gstatic.com) to the locally hosted variant.
Please note that while I’m trying to make configuring this plugin as simple as possible, the concept of hosting a file locally or optimizing Google Fonts for Pagespeed Insights or GT Metrix has proven confusing for some people.
OMGF PRO FEATURES: –
- Automatically replace registered/enqueued Google Fonts in wp_head() with local copies,
- Automatically remove registered/enqueued Google Fonts from wp_head(),
- Manage Optimized Google Fonts,
- Preload above the fold fonts,
- Don’t load certain fonts or entire stylesheets.
- Leverage the font-display (swap) option,
- Serve fonts from CDN,
- Use OMGF with security through obscurity plugins.
- Automatically remove/replace all Google Fonts throughout the entire document/page
- Also supports WebFont Loader (webfont.js) and Early Access Google Fonts.
- Combine all Google Fonts (made by your theme and/or plugins) stylesheets into one file
- Deduplicate Google Fonts stylesheets
- Reduce loading time and page size, by forcing the used subset(s) for all Google Fonts requests
- Remove Resource Hints (preload, preconnect, dns-prefetch) pointing to fonts.googleapis.com or fonts.gstatic.com.