This topic is: resolved
- This topic has 4 replies, 1 voice, and was last updated 2 years ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
Community Forums › Forums › StudioPress Themes › Genesis Sample › Remove Google Fonts
Tagged: google fonts
What is the best way to remove Google Fonts from the Genesis Sample Theme?
Comment out this block of code in functions.php at line 74:
wp_enqueue_style(
genesis_get_theme_handle() . '-fonts',
$appearance['fonts-url'],
[],
genesis_get_theme_version()
);
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?
Hi Victor many thanks for this, my code from 3.4.1 (sorry should have mentioned this earlier), the latest version, is slightly different, below shows line 70...92:
function genesis_sample_enqueue_scripts_styles() {
$appearance = genesis_get_config( 'appearance' );
wp_enqueue_style( // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- see https://core.trac.wordpress.org/ticket/49742
genesis_get_theme_handle() . '-fonts',
$appearance['fonts-url'],
[],
null
);
wp_enqueue_style( 'dashicons' );
if ( genesis_is_amp() ) {
wp_enqueue_style(
genesis_get_theme_handle() . '-amp',
get_stylesheet_directory_uri() . '/lib/amp/amp.css',
[ genesis_get_theme_handle() ],
genesis_get_theme_version()
);
}
}
I'm not using amp on the site in question, so could I comment out from line 74...90 and nothing will break, or just line 74...79 only as you are suggesting? I'm presuming commenting out the whole of genesis_sample_enqueue_scripts_styles() is going to cause an error.
I commented out line 74...79 and it worked a treat, all of the google font links in the header have gone, thanks again Victor.
The better way I think, if you want to update the Sample Child Theme in the future, is to use this in a custom PHP file or in a plugin like Snippets.
add_action( 'wp_print_styles', 'cw_dequeue_google_fonts_style' );
function cw_dequeue_google_fonts_style() {
wp_dequeue_style( 'genesis-sample-fonts' );
}
I write articles about blogging, WordPress and building a business online at Mazepress.
© 2026 WPEngine, Inc.