Skip to content

Instantly share code, notes, and snippets.

@tdmrhn
Last active February 19, 2025 09:35
Show Gist options
  • Save tdmrhn/0c62c149f2cdbe543584fb926a6b6952 to your computer and use it in GitHub Desktop.
Save tdmrhn/0c62c149f2cdbe543584fb926a6b6952 to your computer and use it in GitHub Desktop.
Deregister Plugin Scripts for Widgets
<?php
//
// Godaddy
//
add_action('enqueue_block_editor_assets', function () {
global $wp_customize;
if (! $wp_customize) {
return;
}
wp_deregister_script('GoDaddy\WordPress\Plugins\Launch\PublishGuidepublish-guide-script');
}, 100);
//
// Jetpack
//
add_action('enqueue_block_editor_assets', function () {
global $wp_customize;
if (! $wp_customize) {
return;
}
wp_deregister_script('jetpack-blocks-editor');
}, 50);
//
// CoBlocks
//
add_action('enqueue_block_editor_assets', function () {
global $wp_customize;
if (! $wp_customize) {
return;
}
wp_deregister_script('coblocks-editor');
}, 50);
//
// Kadence
//
add_action('enqueue_block_editor_assets', function () {
global $wp_customize;
if (! $wp_customize) {
return;
}
wp_deregister_script('kadence-components');
}, 50);
//
// Editor Block Outline
//
add_action('enqueue_block_editor_assets', function () {
global $wp_customize;
if (! $wp_customize) {
return;
}
wp_deregister_script('editor-sidebar');
}, 50);
//
// TranslatePress
//
add_action('enqueue_block_editor_assets', function () {
global $wp_customize;
if (! $wp_customize) {
return;
}
wp_deregister_script('trp-block-language-restriction');
}, 50);
//
// Optinmonster
//
add_action('enqueue_block_editor_assets', function () {
global $wp_customize;
if (! $wp_customize) {
return;
}
wp_dequeue_script('optinmonster-gutenberg-sidebar-settings');
}, 50);
//
// Mailoptin
//
add_action('enqueue_block_editor_assets', function () {
global $wp_customize;
if (! $wp_customize) {
return;
}
wp_deregister_script('mailoptin-disable-email-plugin-sidebar');
}, 50);
//
// Embedpress
//
add_action('enqueue_block_editor_assets', function () {
global $wp_customize;
if (! $wp_customize) {
return;
}
wp_deregister_script('embedpress_documents_viewer_script');
}, 50);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment