How to disable YouTube (and any other oembed) embeding in the editor

The quick way to disable oEmbeds would be

add_filter( 'pre_oembed_result', '__return_false' );

If you want to disable it for all external links then try:

/**
 * Disable oEmbeds for external links 
 */
add_filter( 'pre_oembed_result', function( $result, $url, $args )
{    
    if( parse_url( home_url(), PHP_URL_HOST ) !==  parse_url( $url, PHP_URL_HOST ) )
        $result = false;

    return $result;

}, 999, 3 );

This is a modification from a more detailed answer I posted here.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)