PHPackages                             short-pixel-optimizer/enable-media-replace - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. short-pixel-optimizer/enable-media-replace

ActiveLibrary[File &amp; Storage](/categories/file-storage)

short-pixel-optimizer/enable-media-replace
==========================================

A free, lightweight and easy to use WordPress plugin that allows you to seamlessly replace an image or file in your Media Library by uploading a new file in its place.

v4.2.2(1mo ago)23028[3 issues](https://github.com/short-pixel-optimizer/enable-media-replace/issues)GPL-2.0PHPPHP &gt;=5.6.0CI failing

Since Jul 19Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/short-pixel-optimizer/enable-media-replace)[ Packagist](https://packagist.org/packages/short-pixel-optimizer/enable-media-replace)[ Docs](https://github.com/short-pixel-optimizer/enable-media-replace/)[ RSS](/packages/short-pixel-optimizer-enable-media-replace/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (6)Versions (40)Used By (0)

Enable Media Replace
====================

[](#enable-media-replace)

This plugin allows you to replace a file in your media library by uploading a new file in its place. No more deleting, renaming and re-uploading files!

A real timesaver
----------------

[](#a-real-timesaver)

Don't you find it tedious and complicated to have to first delete a file and then upload one with the exact same name every time you want to update an image or any uploaded file inside the WordPress media library?

Well, no longer!

Now you'll be able to replace any uploaded file from the media "edit" view, where it should be. Media replacement can be done in one of two ways:

It's simple to replace a file
-----------------------------

[](#its-simple-to-replace-a-file)

1. Just replace the file. This option requires you to upload a file of the same type as the one you are replacing. The name of the attachment will stay the same no matter what the file you upload is called.
2. Replace the file, use new file name and update all links. If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file will be updated to point to the new file name.

This plugin is very powerful and a must-have for any larger sites built with WordPress.

Display file modification time
------------------------------

[](#display-file-modification-time)

There is a shortcode available which picks up the file modification date and displays it in a post or a page. The code is: `[file_modified id=XX format=XXXX]` where the "id" is required and the "format" is optional and defaults to your current WordPress settings for date and time format.

So `[file_modified id=870]` would display the last time the file with ID 870 was updated on your site. To get the ID for a file, check the URL when editing a file in the media library (see screenshot #4)

If you want more control over the format used to display the time, you can use the format option, so `[file_modified id=870 format=Y-m-d]` would display the file modification date but not the time. The format string uses [standard PHP date() formatting tags](http://php.net/manual/en/function.date.php).

Disable background removal
--------------------------

[](#disable-background-removal)

If you don't want to utilize the background removal feature, add `add_filter('emr/feature/background', '__return_false' );` to your functions.php

---

See [Enable Media Replace](http://wordpress.org/plugins/enable-media-replace/) at WordPress.org for more information.

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 52.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~76 days

Recently: every ~67 days

Total

34

Last Release

39d ago

Major Versions

v3.6.3 → v4.0.02022-09-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/4bcfc40ce0fdf840fd28ad727cbdc3fee4a9831e30b8ab1a1ffed7470639ac60?d=identicon)[shortpixel](/maintainers/shortpixel)

---

Top Contributors

[![bschuiling](https://avatars.githubusercontent.com/u/5565072?v=4)](https://github.com/bschuiling "bschuiling (184 commits)")[![pdobrescu](https://avatars.githubusercontent.com/u/1044106?v=4)](https://github.com/pdobrescu "pdobrescu (90 commits)")[![simondud](https://avatars.githubusercontent.com/u/12509668?v=4)](https://github.com/simondud "simondud (35 commits)")[![adrianrss](https://avatars.githubusercontent.com/u/94862625?v=4)](https://github.com/adrianrss "adrianrss (10 commits)")[![ramiy](https://avatars.githubusercontent.com/u/576623?v=4)](https://github.com/ramiy "ramiy (8 commits)")[![giucu91](https://avatars.githubusercontent.com/u/7580330?v=4)](https://github.com/giucu91 "giucu91 (7 commits)")[![alexclassroom](https://avatars.githubusercontent.com/u/11472643?v=4)](https://github.com/alexclassroom "alexclassroom (2 commits)")[![jstask82](https://avatars.githubusercontent.com/u/38891427?v=4)](https://github.com/jstask82 "jstask82 (2 commits)")[![seed-glauco](https://avatars.githubusercontent.com/u/58208985?v=4)](https://github.com/seed-glauco "seed-glauco (1 commits)")[![soulseekah](https://avatars.githubusercontent.com/u/685880?v=4)](https://github.com/soulseekah "soulseekah (1 commits)")[![syntax53](https://avatars.githubusercontent.com/u/6526713?v=4)](https://github.com/syntax53 "syntax53 (1 commits)")[![tmconnect](https://avatars.githubusercontent.com/u/2598781?v=4)](https://github.com/tmconnect "tmconnect (1 commits)")[![brandan-schmitz](https://avatars.githubusercontent.com/u/6267549?v=4)](https://github.com/brandan-schmitz "brandan-schmitz (1 commits)")[![dougaxe1](https://avatars.githubusercontent.com/u/10548206?v=4)](https://github.com/dougaxe1 "dougaxe1 (1 commits)")[![felixvelariusbos](https://avatars.githubusercontent.com/u/8462760?v=4)](https://github.com/felixvelariusbos "felixvelariusbos (1 commits)")[![luistar15](https://avatars.githubusercontent.com/u/1296095?v=4)](https://github.com/luistar15 "luistar15 (1 commits)")[![nirroz93](https://avatars.githubusercontent.com/u/32959392?v=4)](https://github.com/nirroz93 "nirroz93 (1 commits)")[![Presskopp](https://avatars.githubusercontent.com/u/18373563?v=4)](https://github.com/Presskopp "Presskopp (1 commits)")[![RazvanFarte](https://avatars.githubusercontent.com/u/25342387?v=4)](https://github.com/RazvanFarte "RazvanFarte (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/short-pixel-optimizer-enable-media-replace/health.svg)

```
[![Health](https://phpackages.com/badges/short-pixel-optimizer-enable-media-replace/health.svg)](https://phpackages.com/packages/short-pixel-optimizer-enable-media-replace)
```

###  Alternatives

[olivierbon/craft-squeeze

Zip one or multiple craft assets on the fly for frontend user to download.

137.5k](/packages/olivierbon-craft-squeeze)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
