Skip to main content
added 24 characters in body
Source Link
murcoder
  • 99
  • 1
  • 1
  • 13

is there a filter for removing style-tags from the <head></head> area in wordpress?

I already achieved towant remove link-tags by using this wordpress filter and some regex:

add_filter( 'style_loader_tag', 'removeGoogleLinks');

But how to remove style tags like that onefor instance:

<head>
     <style>
        @import url('https://fonts.googleapis.com/css?family=Chilanka&display=swap');
    </style>
</head>

I already achieved to remove link-tags by using this wordpress filter and some regex:

add_filter( 'style_loader_tag', 'removeGoogleLinks');

I guess i havbe to use wp_headwp_head somehow but I'm not sure how to use this as filter?

add_filter( 'wp_head',  $removeGoogleFontStyle); 

public function removeGoogleFontStyle($content){
   //Filter googleapi styles with regex but
   //how to use this funtion/filter?
} 

is there a filter for removing style-tags from the <head></head> area in wordpress?

I already achieved to remove link-tags by using this wordpress filter and some regex:

add_filter( 'style_loader_tag', 'removeGoogleLinks');

But how to remove style tags like that one:

<head>
     <style>
        @import url('https://fonts.googleapis.com/css?family=Chilanka&display=swap');
    </style>
</head>

I guess i havbe to use wp_head somehow but how to use this?

add_filter( 'wp_head',  $removeGoogleFontStyle); 

public function removeGoogleFontStyle($content){
   //Filter googleapi styles with regex but
   //how to use this funtion/filter?
} 

is there a filter for removing style-tags from the <head></head> area in wordpress?

I want remove this style for instance:

<head>
     <style>
        @import url('https://fonts.googleapis.com/css?family=Chilanka&display=swap');
    </style>
</head>

I already achieved to remove link-tags by using this wordpress filter and some regex:

add_filter( 'style_loader_tag', 'removeGoogleLinks');

I guess i havbe to use wp_head somehow but I'm not sure how to use this as filter?

add_filter( 'wp_head',  $removeGoogleFontStyle); 

public function removeGoogleFontStyle($content){
   //Filter googleapi styles with regex but
   //how to use this funtion/filter?
} 
Source Link
murcoder
  • 99
  • 1
  • 1
  • 13

Remove style tags from head

is there a filter for removing style-tags from the <head></head> area in wordpress?

I already achieved to remove link-tags by using this wordpress filter and some regex:

add_filter( 'style_loader_tag', 'removeGoogleLinks');

But how to remove style tags like that one:

<head>
     <style>
        @import url('https://fonts.googleapis.com/css?family=Chilanka&display=swap');
    </style>
</head>

I guess i havbe to use wp_head somehow but how to use this?

add_filter( 'wp_head',  $removeGoogleFontStyle); 

public function removeGoogleFontStyle($content){
   //Filter googleapi styles with regex but
   //how to use this funtion/filter?
}