• Resolved publicradio

    (@publicradio)


    I have seen several tutorials on how to remove Jetpack CSS from your site, but I need to remove inline CSS which is only added when the corresponding block is present.

    In this case, I am adding the Jetpack Slideshow block to a page, which adds an inline script with the ID jetpack-block-slideshow-inline-css.

    How do I dequeue/deregister/remove this inline CSS from my page?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there!

    I added the Jetpack Slideshow to a test site, and it only added a stylesheet with the id jetpack-block-slideshow-css. I’m probably missing something.

    Could you share a link to the page that has this so I can take a closer look?

    If you don’t feel comfortable sharing it publicly, you can reach out via this page. Make sure to include a link to this thread as well.

    Thread Starter publicradio

    (@publicradio)

    Hi, thanks for the reply, and sorry I didn’t see it until now. After trying a lot of things, this turned out to be the winner:

    add_filter('get_footer', function(){
    wp_dequeue_style( 'jetpack-block-slideshow' );
    }, 9999);

    The ‘9999’ is crucial to get it to actually disappear. Now, if only I could get it to also disappear from the backend (block editor), then my blocks there would look closer to the way they do on the front.

    Bruce (a11n)

    (@bruceallen)

    Happiness Engineer

    Hi @publicradio

    The hook which styles the Block editor is do_action( ‘enqueue_block_editor_assets’ ) but that could cause other unintended impact. You can see more here:

    https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hi there, @publicradio,

    I’m going to mark this thread as solved. If you have any further questions or need more help, you’re welcome to open another thread here. Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Disable block inline CSS’ is closed to new replies.