How can we help?

If you are looking for support for our PokaTheme, this is the place!

Home Forums PokaTheme support How to load google fonts locally instead of CDN


  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by admin.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #17847

    Hey there,

    using PK 4.04,

    Currently Google fonts are loaded from their CDNs

    <link rel=”preconnect” href=””&gt;
    <link rel=”preconnect” href=”; crossorigin>
    <link rel=’dns-prefetch’ href=’//’ />
    <link rel=’stylesheet’ id=’poka-fonts-css’ href=’; type=’text/css’ media=’all’ />

    How can ew change this default behavior so that it’s being loaded from a local (first-party) resource and not from a remote resource?

    Thanks for your insights!


    Hi Jean-Sebastien,

    To do this, you first need to overwrite through the functions.php of your child theme the poka_dns_prefetch() function and you also have to use WordPress function wp_dequeue_style() to dequeue the “poka-fonts” stylesheet.

    Then you should add some CSS inside the style.css file inside your child theme to include the fonts you have locally.

    This requires a bit of CSS and PHP knowledge. Of course you can always send us an email at for custom functionalities like this one.



    Hey, thanks for the guidelines!

    Problem with overwriting poka_dns_prefetch() function: in setup-theme.php, the function is defined without the usual if ( ! function_exists( ‘poka_dns_prefetch’ ) ) { on top of it,
    so I cannot redeclare the function in the child functions.php.

    Have I another choice but modifying the setup-theme.php and adding if ( ! function_exists( ‘poka_dns_prefetch’ ) ) { so I can redeclare the finctions in the child theme?



    Hi Jean-Sebastien,

    Unfortunately you are right, we missed to add the function_exists() check for this one, this will be fixed for sure in the next theme release.

    For now, you could use the following PHP snippet in your child theme functions.php to totally remove the stuff that the function poka_dns_prefetch() adds to the site.

    	function() {
    		remove_action( 'wp_head', 'poka_dns_prefetch', 1 );

    Let me know if this works for you.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.