Dprime Local Fonts v1.6.0
Downloads Google Fonts to your server and rewrites every font request to serve them locally. Three ways to add fonts, GDPR friendly, no Google calls after activation.
Installation
- Download the plugin zip from your account at my.dprime.au or from the plugin page.
- In your WordPress admin go to Plugins > Add New > Upload Plugin.
- Choose the zip file and click Install Now.
- Activate the plugin.
- Go to Dprime > Local Fonts in the sidebar to open the settings page. If Dprime Core is not installed, look for Local Fonts as a standalone menu item.
Adding fonts
There are three ways to add fonts. Use whichever fits your workflow. You can mix and match across different font families.
Choosing font weights
When scanning or pasting a URL, the plugin detects which weights are in the request and downloads only those. If a weight is missing from your page builder settings, add it there first then rescan. Unused weights add to your page load without benefit.
How rewriting works
Once fonts are downloaded, the plugin hooks into the WordPress output buffer and replaces every reference to fonts.googleapis.com and fonts.gstatic.com with your local server path. This happens automatically on every page load with no configuration needed.
The generated CSS uses a standard @font-face declaration pointing to your local files. Browsers cache this just like any other CSS. On repeat visits, the font files load from the browser cache rather than your server.
What gets rewritten
- Google Fonts stylesheet link tags in the page head
- @import rules inside style blocks that reference fonts.googleapis.com
- Inline font URLs added by page builder code
What is not rewritten
- Font families that have not been downloaded yet. Add and download them first.
- Hardcoded font URLs inside JavaScript files (uncommon but possible with some third-party plugins).
- Fonts added via the WordPress Customizer if the theme bypasses standard enqueueing.
File locations
All downloaded font files are stored inside your WordPress uploads directory so they are excluded from plugin updates and safe to keep across reinstalls.
wp-content/uploads/dprime-local-fonts/Inside that folder, each font family gets its own subdirectory. For example, Sora Bold would be at:
wp-content/uploads/dprime-local-fonts/Sora/Sora-700.woff2The generated CSS that registers these font faces is output inline in the page head by the plugin. You do not need to edit any files or enqueue anything manually.
Removing fonts
Each font family in the installed list has a Remove button. Clicking it deletes the downloaded files from the server and removes the family from the active list. The database record is cleared and the @font-face declaration is no longer output.
Clearing all fonts at once
The Clear all button at the bottom of the Fonts tab removes every downloaded font file and resets the active list. Use this when rebuilding a site or switching font families entirely. The plugin remains active with no fonts loaded.
Fonts not loading after removal
If you remove a font family that your page builder is still requesting from Google, those requests will go back to Google after removal since there is no longer a local copy to rewrite to. Update your page builder settings to remove the font or replace it before clearing.
Developer filters
Two WordPress filters let you control which font weights are preloaded in the page head as link rel=preload hints.
// Preload only Regular and Bold weights add_filter( 'dp_lf_preload_weights', function ( $weights ) { return [ 400, 700 ]; } ); // Allow up to 6 preload hints in the head add_filter( 'dp_lf_preload_max', function ( $max ) { return 6; } );
Place these in your theme's functions.php or a site-specific plugin. Preloading more fonts than the browser needs on the first render can actually slow down load time, so keep the list focused.
FAQ
Does this work with Breakdance?
Yes. The Scan builder button reads directly from the Breakdance database to find every Google Fonts URL in use. After downloading, the plugin rewrites Breakdance's font output automatically. No Breakdance settings need to change.
Do I need to update fonts when Google releases new versions?
No. The files on your server do not change unless you click Download again. Fonts are static files. Google occasionally updates the variable font format but woff2 files you have already downloaded continue to work indefinitely.
What if the scan misses a font?
The scanner reads from the Breakdance database. If you have added fonts in another page builder, a theme, or via PHP enqueue, the scanner will not see those. Add them manually using the URL field or upload them directly. Once downloaded, the plugin rewrites all matching requests regardless of where they come from.
Does this handle italic and variable fonts?
Yes for italics. When a Google Fonts URL includes italic variants the plugin downloads those woff2 files as well. Variable fonts are supported as woff2 files. If you upload your own variable font file, the plugin stores and serves it the same way as a standard weight file.
Will this affect my Google Fonts consent popup?
Once all fonts are downloaded locally there are no calls to Google, so any consent mechanism specifically for Google Fonts is no longer needed. Check with your consent management plugin to see whether you can disable the Google Fonts entry once local hosting is active.
What happens if I deactivate the plugin?
The rewriting stops and WordPress falls back to the original Google Fonts URLs your page builder outputs. The downloaded font files stay on the server in case you reactivate. Delete them manually from the uploads folder if you want to clean up completely.
Override classes
The plugin admin UI uses stable CSS classes you can target in a custom stylesheet to restyle any element. These classes will not change between versions.
/* Outer page wrapper */ .dp-lf-page { } /* A card section on the admin page */ .dp-lf-section { } .dp-lf-section-head { } /* Installed fonts list */ .dp-lf-font-row { /* a row in the list */ } .dp-lf-font-name { /* font family name */ } .dp-lf-font-weights { /* weight badges wrapper */ } .dp-lf-badge { /* individual weight badge */ } .dp-lf-remove-btn { /* Remove button on each row */ } /* Action buttons */ .dp-lf-scan-btn { /* Scan builder button */ } .dp-lf-download-btn { /* Download button */ } .dp-lf-upload-area { /* drag-and-drop upload zone */ } /* Catalog and results */ .dp-lf-catalog-row { /* a row in catalog search results */ } /* Help tab */ .dp-lf-help { /* help tab outer wrapper */ } .dp-lf-help-section { /* individual help card */ } .dp-lf-help-steps { /* ordered list in help section */ } .dp-lf-help-list { /* unordered list in help section */ }
Add your overrides to a custom stylesheet enqueued after the plugin styles, or to your child theme's style.css. Use the .dp-lf-page class as a parent selector to keep specificity scoped to the plugin page.