Skip to main content
drupalreleases
Release: Drupal 11.4.9 — Update released for Drupal core (11.4.9)! Release: Better Exposed Filters 7.2.0 — Minor update available for module better_exposed_filters (7.2.0). Release: Bootstrap 8.x-3.43 — Minor update available for theme bootstrap (8.x-3.43). Release: Svg Image 3.2.5 — Minor update available for module svg_image (3.2.5). Release: Book 3.0.8 — Minor update available for module book (3.0.8). Release: Tagify 2.0.5 — Minor update available for module tagify (2.0.5). Release: Editoria11y Accessibility Checker 3.0.11 — Minor update available for module editoria11y (3.0.11). Release: Events Log Track 5.0.1 — Minor update available for module events_log_track (5.0.1). Module Revived: @font-your-face 4.3.0 — Module fontyourface updated after 7 months of inactivity (4.3.0). Security Coverage: Open Y Branch Selector — Module openy_branch_selector now has official Drupal security advisory coverage.

Media replace in media_library_widget

3 sites No security coverage Drupal 10–11
View on drupal.org

This module adds a "Select new" button to existing media items in the Media Library field widget, allowing editors to replace media directly without first removing it. This preserves the item's position within the field and simplifies the workflow for updating media.

Media replace in media_library_widget adds a Select new
button to existing items in Drupal's Media Library field widget. Editors can
replace a media item directly from the Media Library without removing it
first, while preserving its position in the field.

Features

Drupal's Media Library allows editors to select, add and remove media items
from entity reference fields. However, replacing an existing item normally
requires removing it first and then selecting a new one. This module provides
a direct replacement workflow.

  • Adds a Select new button to every existing media item in supported Media Library widgets.
  • Opens the Media Library in a modal dialog when the button is clicked.
  • Replaces the original media item after the editor selects a new item.
  • Preserves the original field position and item delta.
  • Restricts the replacement selection to the media bundles allowed by the field.
  • Uses Drupal AJAX and the Media Library opener API.
  • Works with Drupal's standard media_library_widget.
  • Also integrates with the media_library_media_modify_widget when the Media Library Media Modify module is installed.
  • Respects normal entity access, field access and form validation.

This module is useful when editors frequently update images, documents or
other media attached to content and need to keep the existing field order
unchanged. Typical use cases include replacing a banner image, updating a
document, changing an event image or updating media in a multi-value field.

Post-Installation

After installing and enabling the module, the replacement button is enabled
by default. It is automatically added to fields using supported Media Library
widgets when those fields contain existing media items.

The module does not create new content types, media types, fields or views.
No additional field configuration is required.

The module provides an optional configuration page at:

Administration > Configuration > Media > Media replacement settings (/admin/config/media/media-replace-media-library-widget)

Administrators can use this page to enable or disable the replacement button
globally. The module only displays the button for existing media items;
empty field slots continue to use the normal Media Library workflow.

Additional Requirements

This module requires:

  • Drupal 10 or Drupal 11.
  • The Drupal core Media Library module.

No additional PHP libraries, JavaScript libraries or contributed modules are
required for the core functionality.

No additional module is required. The module can optionally be used together
with

Media Library Media Modify

when advanced media editing or the
media_library_media_modify_widget is needed.

Similar projects

Drupal core's Media Library provides the standard workflow for adding,
selecting and removing media items from entity reference fields. This module
complements that functionality by adding a direct replacement action for
existing items.

The

Media Library Media Modify

module focuses on editing or modifying media items in context and provides
additional widget options. This project focuses specifically on replacing an
existing media reference while preserving its position in the field.

Supporting this Module

This project is maintained as community-contributed Drupal software. There is
currently no external funding page or sponsorship program for the project.

Community Documentation

Project page:

https://www.drupal.org/project/media_replace_media_library_widget

Community documentation, video walkthroughs and a demonstration site may be
added as they become available.

Additional Information

The replacement functionality was originally developed as part of the
drpl_media module and is now available as a standalone project
for Drupal sites that need a focused Media Library replacement workflow.

The module does not modify media entities directly. It only changes the media
reference stored in the field, using Drupal's standard Media Library,
Entity Reference and AJAX APIs.

Depends on

Dependencies of the latest stable release

  • media_library Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Aug 2026
Latest release
3 weeks ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.1 Stable 10–11 Sep 18, 2026
1.0.0 Stable 10–11 Aug 25, 2026