Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chuckreynolds/5294247f4770cbe888f4a4bbe5239057 to your computer and use it in GitHub Desktop.
Save chuckreynolds/5294247f4770cbe888f4a4bbe5239057 to your computer and use it in GitHub Desktop.
WordPress Remove Block Suggestions when viewing the Block Directory in WP Admin.
// Remove Block Suggestions in wp-admin Block Directory
function chuckdev_remove_block_directory() {
wp_add_inline_script(
'wp-block-editor',
"wp.domReady( () => wp.plugins.unregisterPlugin( 'block-directory' ) )"
);
}
add_action( 'admin_enqueue_scripts', 'chuckdev_remove_block_directory' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment