Jump to content

Jetpack: remove External Media from the block editor


Recommended Posts

The Jetpack plugin comes with a number of blocks and editor extensions. One of those features extends the existing Media blocks, and adds an option to find and upload images from Google Photos or Pexels:


While this can be super useful when you use Google Photos or need to find free stock photos for your posts, you may sometimes prefer to only see the default “Media Library” option. but no option to disable this function.

To do so, you can add the following snippet to a functionality plugin on your site:

add this code below wp-config.php

 * Remove Jetpack's External Media feature.
    function () {
        $disable_external_media = <<<JS
document.addEventListener( 'DOMContentLoaded', function() {
    wp.hooks.removeFilter( 'blocks.registerBlockType', 'external-media/individual-blocks' );
    wp.hooks.removeFilter( 'editor.MediaUpload', 'external-media/replace-media-upload' );
} );
        wp_add_inline_script( 'jetpack-blocks-editor', $disable_external_media );


  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recent Achievements

    • Hamlo went up a rank
    • Hamlo went up a rank
    • Hamlo went up a rank
  • Create New...