OMGF parses a page's HTML for stylesheets loading Google Fonts using the Google Fonts API: https://fonts.googleapis.com/css or https://fonts.googleapis.com/css2.
Some themes and/or plugins add Google Fonts using different methods, e.g.
- Using @import and/or @font-face statements in a CSS stylesheet,
- Using @import and/or @font-face statements in inline <style> blocks,
- Using Web Font Loader,
- Using Early Access fonts not available (yet) through the regular Google Fonts API.
This section of OMGF Pro’s user manual zooms in on each of the available options and clarifies how it influences OMGF Pro’s Google Fonts Processing and Detection behavior. Each chapter also includes an example of a scenario when this feature should be used.
Advanced Processing (Pro) options
Let’s take a closer look at each of the available options and find out whether you should enable this option for your WordPress site.
Process Inline Styles
While OMGF scans for <link>
elements, this option scans for inline (wrapped in <style>
blocks) @import
statements pointing to fonts.googleapis.com
and @font-face
statements pointing to fonts.gstatic.com
.
Process Local Stylesheets
While Process Inline Styles scans for both @font-face
and @import
statements in your HTML document, Process Local Stylesheets scans for @font-face
and @import
statements inside any stylesheets loaded by your themes and plugins.
Process WebFont Loader
WebFont Loader is a library created by Google and Typekit which allows asynchronous loading of Google Fonts (and other webfonts.) OMGF Pro handles various ways to detect if this library is being used. Some of which are:
- Check if
webfont.js
is present in the page source, - Check if WebFont Loader’s configuration is present anywhere, usually called
WebFontConfig
or simplyWebFont
Process Early Access
Google’s Early Access fonts are openly available beta version of font files.
The usage of these fonts should be considered ‘exotic’. I.e. if your WordPress site is written in a Middle Eastern or Asian language you might be using a beta font.
For English (or any other European language, e.g. Spanish, French or German) it’s probably safe to keep this option disabled.
Which Advanced Processing features should I enable?
The easiest way to figure this out, is turning all of the options on first. Then head into your site's frontend, open up Developer Tools' Network/Requests tab and check if no requests to the Google Fonts API are listed. If you still find some, this is probably due to an exotic implementation, or an iframe. Read this to verify this.
Then disable each option one by one, and after disabling an option, reload your frontend by pressing CTRL/CMD + SHIFT + R. This assures that your site is loaded with a fresh cache.
When an external request appears, re-enable the option you just disabled. That's it! 🙂