Using the new local fonts in WordPress 6.5, after pushing from Local to WP Engine those local font urls are not being updated to the wpengingpowered domain.
What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc
Add some custom fonts in the new WordPress Font Library.
Use those fonts somewhere in the site.
Push that site to WP Engine.
Check the links by searching for “wp-fonts-local” in the console.
The fonts uploaded to /wp-content/uploads/fonts/ aren’t getting updated after upload. They are still stuck on the .local domain and didn’t notice this until someone without the fonts installed locally called it out.
I’ve tried clearing WP Engine cache, testing in another browser, using a cach-busting url.
The only fix is a search-replace to change the url in the database (I do it via ssh/wpcli).
System Details
Local Version:
9.0.1
Operating System (OS) and OS version:
Mac OS Sonoma 14.4.1
Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.
Have you been pushing with the database included? If you don’t include the database this is expected behavior. If you include the database, this should work, but if you’d prefer not to push the database, the only workaround for now will be to patch these manually as you have been.
We’ve seen some issues crop up with the latest WP release so it could be related. If you roll back to the previous WordPress version does it work normally?
Hey @bryce! I just wanted to let you know I passed this on to our Local devs for review. They’ve been digging in but we don’t have an ETA to provide on a fix. We’ll keep you posted on any developments
Hey Nick and Bryce, I’m not using Local, but was googling around for a solution and stumbled across this post. Managed to solve it and thought I’d pass on what worked for me.
Issue
Wordpress is storing the fonts in the wp_posts table as a JSON object. A search and replace for the plain local urls won’t work. Here’s an example on my local site:
Thanks, @aslamh, that helps. I’ve filed a bug for this but don’t have a timeline for a fix just yet. Local would need to change how it handles find/replace on push and test to account for edge-cases. (It currently searches for //example.local, which misses the escaped JSON string in this case.)
Workarounds for now are to run wp search-replace either on the escaped version as you describe, or on a version of the URL without any prefixed // or \/\/.