Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Easily Replace Image and Media Files in WordPress

Keeping your website’s images high-quality and up-to-date is important for a professional and attractive online presence. Whether you’re updating old images or other media files, automating this process can save you time and make your WordPress website look great.

If you’ve never done it before, it can seem a bit tricky. But don’t worry — you’re not alone. At WPBeginner, we’ve helped many users get better at blogging, and we’re here to help you, too.

In this step-by-step guide, we will show you how to easily replace images and media files in WordPress so your site always looks its best.

Easily replace image and-media files in-post image

Why Replace Images and Media Files in WordPress?

Replacing images and media files on your WordPress website, whether they are product photos, featured images, or thumbnails, is important for several reasons.

Here are some reasons why you should care about keeping your media files fresh:

  • Updated content. Fresh and relevant visuals keep your website engaging and current. They can also reflect any changes in your business.
  • Improved user experience. High-quality, up-to-date images enhance user experience. They keep visitors on your site longer and encourage them to explore more pages.
  • SEO (search engine optimization) benefits. Optimizing new media files with relevant keywords can improve their visibility in search engines.
  • Better performance. Replacing outdated or poorly optimized media files with newer, optimized ones can speed up your website. Plus, faster loading times improve the user experience and help search engine rankings.
  • Consistency and branding. Keeping your images and media files aligned with your brand identity helps maintain a professional appearance.

If you have a small business website, then regularly updating and replacing your images and media files shows your audience that your business is active and detail-oriented. This also applies to people running an online store.

Plus, keeping your media library organized and updated makes managing content easier for you and your team.

When you know that all your images and media files are current, optimized, and properly categorized, it becomes easier to find and use the right assets when needed. This saves time and reduces the stress of managing hundreds or thousands of media files.

So you can focus on planning your content and creating high-quality articles for your audience.

With that in mind, we will show you how to easily replace images and media files in WordPress. Here’s a quick overview of the 3 steps we will cover in this guide:

Ready? Let’s get started.

Step 1. Install Search & Replace Everything by WPCode

The first thing you’ll need to do is install and activate the free Search & Replace Everything plugin by WPCode.

Our team created the Search & Replace Everything by WPCode plugin to address a significant limitation in WordPress: the lack of a built-in find and replace feature.

The lack of this feature left website owners with two frustrating options. First, they could manually update each page, which is time-consuming. Second, they might need to hire a developer to write an SQL query, which could be expensive.

Search & Replace Everything simplifies this process by providing an easy and cost-effective solution for anyone who manages a WordPress site.

Here are some of the plugin’s use cases:

  • Quickly replace outdated images site-wide with a single click.
  • Bulk update any content on your website’s posts or pages in moments.
  • Easily replace old URLs with new ones to fix broken links after migrating a website.

The good news is that you can use the tool’s free version to replace image and media files. However, upgrading to the Search & Replace pro version will unlock the history feature, where you can undo your changes, replace images from the WordPress block editor, and more.

If you need help installing the plugin, then you can check out our guide on how to install a WordPress plugin.

Expert Tip: If you already have WPCode Pro, then you can install and activate Search & Replace Everything from the WPCode dashboard within the WordPress admin area. All you have to do is navigate to Code Snippets » Search & Replace and then click the ‘Install Search & Replace Everything’ button.

Upon activation, you can access the Search & Replace Everything dashboard by navigating to Tools » WP Search & Replace.

You don’t need to configure anything, so you can use the tool right away.

WP Search & Replace menu item

Step 2. Choose the Images or Media Files to Replace

To replace images or media files, let’s move to the ‘Replace Image’ tab in the Search & Replace dashboard.

In this area, you’ll be able to see all of your existing images.

The Replace Image tab in Search & Replace Everything

Now, you’ll want to find the file you want to replace.

Once you have found the file, simply hover your mouse over it, and you will see a button labeled Replace.’ You can give it a click.

The Replace button in Search & Replace Everything

This will take you to the ‘Replace Image’ panel.

You can upload your new file by clicking on the ‘Choose a file’ button or on the ‘Choose a new image to see a preview here’ box.

Either way, it will redirect you to your computer’s local disk to choose an image replacement.

The Choose a file button in Search and Replace Everything

Once you choose a file, it will appear in the box to the right of the old image.

If everything looks good, go ahead and click the ‘Replace Source File’ button.

The Replace Source File button in Search & Replace Everything

You’ll then see a warning pop-up window that says the change will be permanent.

Simply click the ‘Yes’ button to commence the process if you’re sure everything is good to go.

Note: When you replace an image, other data like the media file title and alt text will remain the same. You can update these details later once the replacement process is complete, but making sure your new image or media file can use the same image title and alt text helps save you time.

The Yes button in the Are You Sure warning popup in Search & Replace Everything

After that, Search & Replace Everything will process the replacement.

Once it’s done, you’ll see another pop-up window. Here, it says ‘Image Replace Complete,’ followed by some notes.

You can click ‘OK’ to finish the process.

The OK button in the Image Replace Complete popup in Search & Replace Everything

Step 3. Check if Your New Images or Media Files Are Live

You can now visit your posts or pages where this media file was attached and see it replaced with the new file you just uploaded.

Here’s what ours looks like:

Replaced image on a live website

If you see the old image, then you should try clearing your cache.

For more detailed instructions, you can see our detailed step-by-step guide on how to clear your cache in WordPress.

Video Tutorial

Subscribe to WPBeginner

More WordPress Guides for Using Images Effectively

We hope that this article helped you find an easier way to replace images and media files in WordPress. You may also want to check out our tutorial on how to easily rename images and media files in WordPress or our expert picks of the best featured image plugins and tools for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

30 CommentsLeave a Reply

  1. Daniel Whalen

    I love your videos but please slow down on how to do it, older persons need to see it slowly.

    • WPBeginner Support

      Thank you for your feedback on our video!

      Admin

  2. Phil

    Is there a way to batch replace? I’m a photographer and sometimes have over 100 images per blog post. I wanted to replace them with smaller file sizes to help with my pages speeds. Is this possible?

    Many thanks

  3. Jeff Vetterick

    If I use the plugin to just “replace image only” (with one of the same file name) will the alt text, image description, and image caption of the original image be overwritten or preserved. If they are preserved, this would save me a ton of time.

    • WPBeginner Support

      It should keep that information if it is able, you would want to reach out to the plugin’s support for specifics.

      Admin

  4. jg

    This option isn’t available in the new version as it just allows you to delete or edit it. if I delete it I don’t know the url to replace it with?

    • WPBeginner Support

      You may want to ensure you are in the correct view for your media library as the feature is currently available

      Admin

  5. Sanjay Sajeev

    Thank you for your post.

    I installed enable media replace plugin in my site. But when I replace an image that I used in a blog post, I can see the image has been replaced in the media library. But When I check that image in the blog post, there is no change to that image and its file size. What I have to do to resolve this?

    • WPBeginner Support

      You may want to try clearing your cache and if that does not work, reach out to the plugin’s support for them to take a look at possible issues.

      Admin

  6. Linda Joyce

    Can I do the same thing manually by replacing the image via FTP? Will that change the image?

    • WPBeginner Support

      Hi Linda,

      That would work. But WordPress will not be able to regenerate thumbnails and image sizes.

      Admin

  7. Rehan

    Can I disable this plugin permanently after all images have been replaced in media library ?

  8. Fede

    Hi. I keep getting request timeout. Same as when uploading using usual wp means. That is why I had to switch to uploading via ftp and then loading them through a plugin meant for that. I really need to get this working since some of the images are not scaling properly nd need to change them. Any help would be apreciated. Thanks.

  9. hitesh

    Hi

    in my wordpress admin there is no any option like replace media..in mine there are only 3 options 1) EDIT 2) DELETE PREMANENTLY 3) VIEW

    So what is the issue there ..its old version or have any other issue can u please clear that so that i can replace that media files

    Regards
    Hitesh

    • Luke

      That’s why you need to install the mentioned plugin.

  10. Nicole

    Help

    I’m a perfrormer contacting agents and tried to replace voice reels after successfully installing yourplugin ( thought it was safest way to go )
    Now htey are blanks – I’ve cleared browsing cache

    I followed the instructions
    my media player is this :

    svnlabs HTML5 Mp3 player 3.6 installed

    please help :0

  11. Riccardo

    Hi thanks for the article, the plugin works great. There’s one thing I don’t get though: the image replacement seems to only affect the image in its original size, when the site displays the image in other formats (thumbnails, previews, etc…) I can still see the old image file.
    How can I force the image replacement on all the other image files (e.g. imagename-300×200.jpg)?
    thank you

    • Rehan

      Please use Regenerate thumbnails plugin to regenerate your images. after that you will see the replaced images.

  12. Leed

    Thanks a lot.
    You help me for this problem.

  13. Panagiotis Tabakis

    The Enable Media Replace plugin poses a security threat, I would totally avoid it. Its a shame to suggest users to use dangerous software. Please research before posting.

    The exploit holds since 2011.

    For more info see

    • WPBeginner Support

      Hi Panagiotis,

      The issue was immediately resolved by the plugin author in the very next release (please see plugin’s changelog and scroll down to version 2.4).

      This is why we recommend users to keep their WordPress site and plugins updated.

      Admin

      • Panagiotis Tabakis

        Yes, you are correct. I’m sorry, I saw a support post which the plugin author didn’t answer and thought it wasn’t resolved.
        The exploit was patched @ 09 February 2011 (the same day).

        I wonder why the author hasn’t replied but I will inform the forum users.

        Again, sorry.

        • WPBeginner Support

          No problem :) It’s good to be cautious about security issues. Hopefully, your answer on the support forums will help other users.

  14. Blake

    I am running WP 4.6.1 bootstrap and I want to remove a background photo and replace it with one that is in my galley. Can you tell me how to do it, Thanks

  15. Sky

    I followed the steps and in the library the new image is displayed but where the image is located on the home page remains the old photo. Not sure what to do…

    • Christian Scholz-Flöter

      Maybe it’s a browser cache related issue and you need to clean/delete the browser cache. If you don’t know how to do it, google your browser’s brand name and “clear browser cache”.

  16. jorge

    This plugin works great in the media page. However I would like to also replace images/media from within the media modal window inside a post/page edit page without leaving the page. Any ideas?

    Thanks for this amazing post!

  17. Marilyn

    I wish I had known this sooner! I didn’t detach my media files before I deleted them. I replaced them with a new image. The problem is that resulted in broken images. Even though I go back and reattach/choose the correct image down the road it breaks again. In my Easy recipe program I see the placeholder for the deleted image and the program searching for it. Is there a fix for this? Unfortunately there are about 200 files doing this.

  18. Rosy

    Hi, unfortunately the “replace media” link is not showing as an option?

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.