wp.domReady(() => { // Remove specific non-embed blocks const removeBlocks = [ 'core/verse', 'core/freeform', 'core/archives', 'core/calendar', 'core/tag-cloud', 'core/rss', 'core/latest-comments', 'core/social-links', 'core/tags', 'core/comments', 'core/post-comments-form' ]; // Log available blocks for debugging //console.log('Available blocks:', wp.blocks.getBlockTypes().map(block => block.name)); // Remove specified core blocks removeBlocks.forEach(blockName => { try { const block = wp.blocks.getBlockType(blockName); if (block) { wp.blocks.unregisterBlockType(blockName); //console.log(`Successfully removed block: ${blockName}`); } } catch (error) { console.warn(`Failed to remove block ${blockName}:`, error); } }); // Only remove specific embed variations const removeEmbeds = [ 'facebook', 'instagram', 'scribd', 'tiktok', 'twitter', 'tumblr', 'reddit', 'pinterest', 'smugmug', 'crowdsignal', 'kickstarter', 'mixcloud', 'spotify', 'soundcloud', 'bandcamp', 'flickr', 'wordpress', 'dailymotion', 'imgur', 'issuu', 'wolfram', 'reverbnation', 'cloudup', 'animoto', 'ted', 'bluesky', 'pocket', 'speaker-deck', 'videopress', 'pocket-casts', 'amazon-kindle', 'wolfram-cloud', 'wordpress-tv' ]; wp.blocks.getBlockVariations('core/embed')?.forEach(variation => { if (removeEmbeds.includes(variation.name)) { wp.blocks.unregisterBlockVariation('core/embed', variation.name); //console.log(`Removed embed variation: ${variation.name}`); } }); });