Jeremy Herve Avatar

That’s me. And my blog. In English and in French.


Jetpack: remove External Media from the block editor

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.

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

/**
 * Remove Jetpack's External Media feature.
 *
 * @see https://wordpress.org/support/topic/remove-external-image-sources-from-add-media-2/
 */
add_filter(
	'jetpack_tools_to_include',
	function ( $tools ) {
		$index = array_search( 'external-media/external-media.php', $tools, true );
		if ( $index ) {
			unset( $tools[ $index ] );
		}
		return $tools;
	}
);

Reactions on the Fediverse and on the ATmosphere

Continuez votre lecture / Keep reading

Discover more posts about or look at some of the posts suggested below.

Jeremy Herve
Jeremy Herve

WordPress, TV Series, music, kids, and board games. I think that’s probably the best way to define me in a few words. 🙂

I work at Automattic where I lead a team building tools for bloggers and creators. I talk a lot about WordPress things, but also about all things open source in general.

I post in English and in French.

I live in Brittany, France, so you’ll also find me sharing pictures from our beautiful region from time to time.

1,241 posts
194 followers