Astra integrates seamlessly with Google Fonts, giving you a wide variety of fonts to elevate your website’s design.
However, you might encounter a situation where the Google Fonts list appears blank within the “Typography” tab of the customizer. This indicates that the available Google Fonts aren’t loading properly on your website.
This can happen for a few reasons. This guide provides the information you need to effectively troubleshoot and resolve this issue.
Understanding the Cause: Why Google Fonts Might Not Load
Astra includes a file with a list of all the Google fonts. This file is read when displaying all google fonts in the customizer. Some of the hosting providers have incorrect file permissions which do not allow reading the file. And so the Google Fonts list display empty.
How to Fix Google Fonts Not Loading in Astra
Here’s how to fix it:
1. Check File Permissions:
The first step is to check your file permissions. Astra relies on a specific file to display the Google Font options. Contact your hosting provider and ask them to ensure the file located at wp-content\themes\astra\assets\fonts\google-fonts.json
has the correct permissions. In most cases, this file should have a permission setting of 644.
2. Force wp_filesystem Functions
If checking permissions doesn’t resolve the issue, this step is for advanced users comfortable with code editing.
You can force wp_filesystem to use file_get_* functions by adding a custom code. This will allow displaying all Google Fonts on your site. Add the following constant in your wp-config.php file.
define( 'FS_METHOD', 'direct' );
We hope this document has been helpful. If you have any queries further, feel free to leave a comment below.