Custom Google Font Lists

This is a Developer Level doc.

If you're unfamiliar with PHP and/or editing files, codes and templates, as well as with resolving possible conflict, please seek help from a professional. Under our Support Policy, we don't provide support for modifications and customization.

Using a filter you can select which Google Fonts are available when selecting fonts in the Customizer. Instead of loading hundreds of options, you can load only the ones you will be using on your website with the help of this PHP snippet:

function myprefix_google_fonts( $array ) {
    return array( 'Open Sans', 'Roboto', 'Source Sans Pro' );
}
add_filter( 'ocean_google_fonts_array', 'myprefix_google_fonts' );

All PHP snippets should be added via a child theme's functions.php file.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.