0

I am editing the theme Peggi (https://themeforest.net/item/peggi-a-multipurpose-wordpress-children-theme/22094659) over a child theme to make it GDPR compliant. I managed to remove all external resources like google fonts, except one:

<link href="https://fonts.googleapis.com/css?family=Open+Sans:400%7CRoboto:400%7CFira+Sans:500" rel="stylesheet" property="stylesheet" media="all" type="text/css" >

This link has not been enqueued via wp_enqueue_style and I cannot find it anywhere in the code. I do not know where this line of code comes from. I need to remove it anyway.

Is there a possibility to remove it within functions.php of my child theme anyhow? Javascript is not a solution as it fires after the page is loaded; it has to be removed within PHP.

Thanks!

1 Answer 1

0

This looks like google font imports via the theme options, are you sure that this font is not selected anywhere inside the theme's options, a page template, a plugin or the themes' functions.php file? It MUST be in one of those locations. If you can't find it, use this (you gotta find out the handle for this, and there are different ways to do so, for example like this)

EDIT: Dequeue_style probably won't work, as this is not a proper stylesheet being enqueued (which you can verify by checking the handles of enqueued stylesheets as described above). Focus on finding out where it comes from, it must be one of the options above; and simply remove it from there. You may also check the mentioned possible sources for the parent theme. So, what I would do is:

Check both the functions.php file of the parent and the child theme for google font imports.

Check page templates of both for google font imports (check if the font is present on all or just on specific pages, this could help you in limiting your search).

Inactivate plugins one by one and check if the style is still present or not.

2
  • It is not a theme setting as I have already dequeued the font import from the theme. But your answer made me search the database for the string and I found it inside a table that has been created by a plugin which has been deleted long time ago. But the table stayed and the content of that table even was printed to the frontend. Thanks for your help mate!
    – toneyt
    Sep 2, 2020 at 7:20
  • no worries, glad could help!
    – DevelJoe
    Sep 2, 2020 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.