How to Replace Image URLs in Elementor Templates After Moving Media
You’ve just completed a major project, like migrating your website’s images to a new server or integrating a new Content Delivery Network (CDN) to improve performance. The migration was a success, but now you’re seeing a sea of broken image placeholders across your Elementor-built website. The old image URLs are still embedded in your templates, causing them to fail to load. Manually going into every single page, template, and widget to fix hundreds or thousands of broken images is a daunting and time-consuming task. This is where a strategic approach to replace image URLs in Elementor becomes a crucial skill for any website manager.

Why Standard Methods Don’t Work for Elementor
Elementor’s flexibility is largely due to how it stores page data. Unlike a simple WordPress post, Elementor saves content, including image URLs, in a serialized format within your database. A standard search and replace operation in your database, even with a powerful tool like phpMyAdmin, can corrupt this serialized data. The result? Completely broken pages and layouts that are far worse than just a missing image.
A reliable solution must be able to understand Elementor’s unique data structure. It needs to unserialize the content, find and replace the URLs, and then re-serialize the data correctly. Using a plugin built specifically for this purpose is the only way to guarantee a safe and successful outcome.
Using a Plugin to Replace Image URLs in Elementor
The most efficient and secure method to fix broken images is by using a specialized plugin. For this guide, we’ll use a powerful and highly-rated tool: Search & Replace for Elementor. It’s designed to safely handle Elementor’s serialized data, making it the perfect solution for this task.
Step-by-Step Guide
Step 1: Back Up Your Website (Non-Negotiable!)
Before you make any direct changes to your database, it is absolutely essential to create a full backup of your site. This includes both your database and your files. A reliable backup plugin like UpdraftPlus or Duplicator can automate this process. Download the backup to your local computer. If anything goes wrong during the process, you can easily restore your site to its previous state.
Step 2: Install and Activate the Plugin
From your WordPress dashboard, navigate to Plugins > Add New. Search for “Search & Replace for Elementor.” Once you find it, click Install Now and then Activate. To get the full functionality needed for this task, you will need the PRO version of the plugin, as it supports image URL replacement across templates.
Step 3: Access the Plugin’s Interface
After activating the plugin, go to Elementor > Search & Replace in your WordPress dashboard. This will open the main interface where you can configure your search parameters.
Step 4: Configure Your Search and Replacement Settings
This is the most crucial step. You will tell the plugin exactly what to look for and what to replace it with.
- Search for: Enter the old URL that is causing the broken images. For example, if your old images were at
https://old-site.com/wp-content/uploads/
, enter that full path. - Replace with: Enter the new URL where your images are now located. For instance, if you moved them to a CDN at
https://cdn.new-site.com/uploads/
, enter that URL here. - Search Method: Make sure you select the Images search method. This tells the plugin to specifically target the
url
field for images within Elementor’s data. This ensures a safe and targeted replacement without affecting other data.
H3: Run a Dry Run to Replace Image URLs in Elementor
Before you commit to any live changes, you should always run a “Dry Run.” This feature simulates the search-and-replace operation and shows you exactly what changes will be made, without actually modifying your database.
With the “Dry Run” option enabled, click the Search button. The plugin will scan your site and provide a detailed list of every instance where your old image URL was found. Review this list carefully to ensure that the plugin is targeting the correct URLs.
H4: Execute the Live Replacement and Verify Changes
Once you have verified the dry run results, it’s time to run the live replacement. Go back to the plugin’s interface, uncheck the “Dry Run” box, and click the Replace button.
The plugin will now work its magic, safely updating the serialized data in your database. Once the process is complete, you’ll receive a success message.
The final step is to clear your caches. This includes your WordPress caching plugin (WP Rocket), your server cache, and your browser cache. This ensures that you are viewing the most recent version of your site. Now, visit some of the pages that previously had broken images and verify that they are loading correctly.
Conclusion
Broken images after a migration or CDN move can be a major headache, but they are completely fixable with the right tools. By using a specialized plugin to safely replace image URLs in Elementor templates, you can automate this tedious task and ensure your website is visually perfect. This approach saves you a significant amount of time and eliminates the risk of data corruption, allowing you to quickly get your site back to a fully functional state.