# Limit the Embed Providers in the Inserter

> Hides the long list of embed blocks (TikTok, Reddit, Kickstarter and dozens more) from the inserter, keeping only the providers you actually use.

- Type: PHP
- Runs: Admin only
- Category: [Block Editor](https://wpide.com/library/category/gutenberg/)
- Tags: embeds, inserter, editor
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/limit-embed-providers/

## Code

```php
// Embed providers to keep in the inserter.
$wpide_kept_embeds = array( 'youtube', 'vimeo', 'twitter', 'spotify' );

add_action( 'enqueue_block_editor_assets', function () use ( $wpide_kept_embeds ) {
    wp_add_inline_script(
        'wp-blocks',
        'wp.domReady(function(){(window._wpLoadBlockEditor||Promise.resolve()).then(function(){var keep=' . wp_json_encode( array_values( $wpide_kept_embeds ) ) . ';(wp.blocks.getBlockVariations("core/embed")||[]).forEach(function(variation){if(keep.indexOf(variation.name)===-1){wp.blocks.unregisterBlockVariation("core/embed",variation.name);}});});});'
    );
} );
```

## Notes

Pasting a URL from a hidden provider still embeds it. Provider names are lowercase, such as youtube, vimeo, twitter, spotify or soundcloud.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Limit the Embed Providers in the Inserter" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
