Skip to content

Instantly share code, notes, and snippets.

@Lovor01
Created July 1, 2021 15:58
Show Gist options
  • Save Lovor01/4cb1cfd819e21327b12b98860a22d779 to your computer and use it in GitHub Desktop.
Save Lovor01/4cb1cfd819e21327b12b98860a22d779 to your computer and use it in GitHub Desktop.
// https://stackoverflow.com/questions/54203925/remove-embedded-stylesheet-for-gutenberg-editor-on-the-back-end
add_filter( 'block_editor_settings' , 'remove_guten_wrapper_styles' );
public function remove_guten_wrapper_styles( $settings ) {
unset($settings['styles'][0]);
return $settings;
}
@yaroslav-borodii
Copy link

Updated working code on 7 June 2023.

It wasn't work for me because unset doesn't shift keys in array. This is working solution.

add_filter( 'block_editor_settings' , 'remove_guten_wrapper_styles' );
public function remove_guten_wrapper_styles( $settings ) {
    array_shift( $settings['styles'] );

    return $settings;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment