Categories

  • Access & Security 95
  • Administration 171
  • Advertisement 92
  • Audio & Video 66
  • Author & Content 99
  • Comments 96
  • Communication 110
  • Communities & Forums 84
  • Development 47
  • E-Commerce 76
  • Email Management 53
  • Events & Calendars 80
  • Language 25
  • Map & Weather 44
  • Migration & Conversion 28
  • Miscellaneous 254
  • Mobile 15
  • Photos 143
  • Plugins 260
  • SEO & Site Speed 118
  • Social 186
  • Theme Enhancement 169



  • Add this plugin to a List

    You need to be logged in to add this plugin to your list.

    Enable Media Replace

    Add to List

    A free, lightweight and easy to use plugin that lets you replace an image or file in your Media Library by uploading a new file in its place. No more deleting, renaming and re-uploading files! It also removes image backgrounds and upscales small images with AI, one image at a time or in bulk.
    Supported by the friendly team that created ShortPixel 🙂

    🆕 New! Bulk Enhance, AI image upscale and transparent PNG

    • Bulk Enhance – A new page under Media > Bulk Enhance processes many images in one run: remove the background of all your WooCommerce product images, or upscale the small images of your Media Library.
    • AI image upscale – Enlarge a small image 2×, 3× or 4× with AI upscaling, with a preview before you replace it.
    • Transparent PNG – When you remove a background you can now get a PNG with a transparent background, also from a JPG image. The links to the image on your site are updated.
    • Backups and restore – Bulk Enhance backs up every original first, so you can restore a whole run anytime.
    • Runs in the background – A started bulk keeps going after you close the page.

    A real timesaver

    Don’t you find it tedious and complicated to first delete a file and then upload another one with the exact same name every time you want to update an image or other uploaded file in the WordPress Media Library?

    Well, no longer!

    Now you can replace any uploaded file from the Media Library or the Edit Media view, where it should be.

    It’s simple to replace a file

    Replacing media can be done in two ways:

    1. Just replace the file. This option requires you to upload a file of the same type as the file you want to replace. The attachment name remains the same regardless of what the file you upload is called.
    2. Replace the file, use the new file name, and update all links. If you check this option, the old file will be replaced with the name and type of the file you are uploading. All links pointing to the current file will be updated to point to the new file name. Additional options for the folder to put the new file in or the date of the new file are also available on the replace screen.

    The links are also updated in the content saved by page builders such as Elementor, Bricks, Breakdance, Beaver Builder and WPBakery, and the cache of the most popular caching plugins is cleared after a replacement. The plugin is compatible with WP Offload Media and offers a preview of the replaced image.

    Remove the background of any image

    Similar to replacing media, you can remove the background of the images from the Media Library. The image is sent to ShortPixel’s API, the background is removed and the result is shown in a preview. If everything looks good, replace the image with the one that has the background removed. You can choose between:

    • a transparent background for PNG images (JPG images cannot be transparent, so they get a white one);
    • a solid background in the color and opacity of your choice;
    • a transparent PNG, also for JPG images: the image is converted to PNG and the links to it on your site are updated.

    Upscale small images with AI

    Enlarge an image 2×, 3× or 4× with AI upscaling, right from the Media Library. Pick the factor, check the preview, and replace the image with the upscaled version. Images up to 1200 pixels wide can be upscaled.

    Bulk Enhance: many images in one run

    The Media > Bulk Enhance page runs one of two operations over many images:

    • Bulk background removal – Removes the background from all images of your WooCommerce products: featured image, gallery and variations.
    • Bulk image upscale – Makes the small JPG and PNG images of your Media Library larger. You choose the width below which images are upscaled (1200 pixels by default), and each image is enlarged as far as its size allows, up to 4×.

    The originals are copied to a backup folder first, so you can restore them anytime from the same page. The bulk is fastest with the page open, and it can keep going in the background after you close it. When it is done, a filter in the Media Library shows the images that were processed.

    Bulk Enhance needs a ShortPixel API key on an Unlimited plan.

    How much does it cost?

    Replacing media is free, with no limits.

    Background removal and image upscale are done by ShortPixel’s AI and use 8 AI credits per image:

    • The Free plan includes 10 background removals and image upscales, with no API key needed.
    • For more, add an API key from a ShortPixel Unlimited plan: it comes with monthly AI credits and unlocks Bulk Enhance.
    • The ShortPixel Unlimited AI plan has no limit on AI credits.

    The API key is added on the remove background, upscale or Bulk Enhance screen, where you can also see how many AI credits are left this month.

    Show file modification time

    There is a shortcode that takes the file modification date and displays it in a post or on 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 show 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: it is the number after post=.

    If you want more control over the format in which the time is shown, you can use the format option. So [file_modified id=870 format=Y-m-d] would show the date the file was modified but not the time. The format string uses the standard PHP date() formatting tags.

    Other plugins by ShortPixel:

    Get in touch!

    Contribute

    Want to help us improve the plugin? Feel free to submit pull requests via GitHub. Do you have suggestions? Contact ShortPixel here.

    Actions and Filters for Developers

    Add these lines to your theme’s functions.php file, or use a plugin like Code Snippets.

    To switch off the background removal feature:

    `add_filter( 'emr/feature/background', '__return_false' );```
    

    To switch off the image upscale feature:

    `add_filter( 'emr/feature/upscale', '__return_false' );```
    

    To switch off the remote notification system:

    `add_filter( 'emr/feature/remote_notice', '__return_false' );```
    

    To shorten the wait time before redirecting to the media editing screen, specify the wait time in seconds (0 means that redirection is immediate, but may cause problems in certain configurations):

    `add_filter('emr/success/timeout', function () { return 3; });```
    

    To set “Just replace the file” as the default replacing method:

    `add_filter( 'emr/replace/default_type', function() {
    return 'replace';
    

    } );“`

    To set “Replace the file, use the new file name, and update all links” as the default replacing method:

    `add_filter( 'emr/replace/default_type', function() {
    return 'replace_and_search';
    

    } );“`

    To skip the database search and replace after a replacement:

    `add_filter( 'emr/replace/doreplace', '__return_false' );```
    

    To change the default width below which the bulk upscales images (in pixels):

    `add_filter( 'emr/bulk/upscale/threshold', function() { return 800; } );```
    
    Rate This Plugin

    Please Login to Rate this Plugin!

    Function

    Feature

    Support

    0 Votes
    Not Rated Yet

    Wordpress.org Stats

    Ratings4.4
    Votes302
    Downloads15,050,921
    Last Updated7 Days ago
    Published18 years ago

    Report Wrong Category!