Font Speed Fix
WordPress plugin: preload local WOFF2 fonts with descriptor-preserving swap and a stampede-safe scan lock
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/sirajahmadzai/font-speed-fix/archive/refs/heads/main.zipA WordPress plugin that fixes slow font loading. It preloads your local WOFF2 fonts, forces font-display: swap everywhere without breaking font descriptors, removes external Google Fonts requests when you ask it to, and uses a stampede-safe scan lock so concurrent scans never double up.
Built from real Core Web Vitals engineering at PeakSpire.
What it does
- Local WOFF2 preloading: finds WOFF2 files referenced by your theme and plugins, then emits
<link rel="preload" as="font" type="font/woff2" crossorigin>tags early in<head>so the browser fetches fonts before CSS finishes parsing. This directly attacks Largest Contentful Paint. - Descriptor-preserving swap: rewrites
@font-facerules to add or forcefont-display: swapwhile keeping the family name, weight, style, and stretch descriptors intact, so fallback metrics and layout stay predictable. - Google Fonts removal: optional mode that strips enqueued Google Fonts requests and their preconnect hints, so all rendering uses your local, preloaded files.
- Stampede lock: the asset scan runs under a mutual-exclusion lock with stale detection. Cache-warmer bots, parallel page loads, and CLI jobs cannot trigger overlapping scans or duplicate option writes.
Benchmark context
The plugin approach was validated against a field benchmark of 97 Ottawa-area business websites. Median mobile performance score was 65.5, with local-font preloading and descriptor-safe swap among the highest-yield fixes for text-heavy LCP elements. Read more at peakspire.ca.
Quick start
- Install the plugin:
- Download the zip from this repository and upload it under Plugins, Add New, Upload Plugin, or
- Install from the WordPress.org plugin directory once the submission is approved.
- Activate Font Speed Fix in Plugins.
- Open Settings, Font Speed Fix and click Scan for fonts. The scanner locates local WOFF2 files and
@font-facerules on your site. - Review the detected fonts, keep preload enabled, and save.
- Test a cached page and view source: you should see preload tags in
<head>andfont-display: swapin your font CSS.
No build step, no external requests, no tracking.
Requirements
- WordPress 6.0 or newer
- PHP 7.4 or newer
Files
font-speed-fix.php— main plugin: scanner, preloader, swap rewriter, Google Fonts removal, stampede lockuninstall.php— cleans up options on uninstallreadme.txt— WordPress.org readme (changelog, FAQ)assets/icon-256.png— plugin icon
License
GPL-2.0-or-later. See LICENSE. The license text was not bundled with the original plugin directory; it has been added to this repository from the canonical GNU copy.
Links
- PeakSpire: https://peakspire.ca/
- WordPress.org plugin page: pending review (submitted October 31, 2025); link will be added once approved