# Stop Turning Pasted URLs Into Embeds

> Keeps links pasted on their own line as plain links instead of turning them into embedded videos, tweets or posts.

- Type: PHP
- Runs: Run everywhere
- Category: [Disable Features](https://wpide.com/library/category/disable-features/)
- Tags: disable, embeds, content
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/disable-auto-embeds/

## Code

```php
add_action( 'init', function () {
    global $wp_embed;

    if ( $wp_embed instanceof WP_Embed ) {
        remove_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 );
        remove_filter( 'widget_text_content', array( $wp_embed, 'autoembed' ), 8 );
        remove_filter( 'widget_block_content', array( $wp_embed, 'autoembed' ), 8 );
    }
} );
```

## Notes

Embed blocks added on purpose in the block editor still work.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Stop Turning Pasted URLs Into Embeds" 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/
