Local WP is not updating media file paths to the URL it's being pushed up to, breaking all imagery on the site

I spent time building a page in WordPress using the Local WP application after seeing it used in a WPEngine webinar and thinking it would be nifty. So far, I love the software and really enjoy using it, but unfortunately it seems like Local does not update file paths when pushing up to a WPEngine environment, or else it just isn’t fully pushing up the image files when pushing to a WPE environment. There are occasionally times where the URL is updated, but it can’t pull the image for some reason. It’s almost like WP recognizes that the images was uploaded, and it shows it in the media library, but clicking on it fails to load a preview and the image itself simply never renders.

Our agency uses WPEngine for our site hosting, and so far everything between WPE and Local has been seamless except for this file path issue. I’ve searched around but none of the posts I’ve come across address the issue or they were closed early due to no response from the posters.

Does anyone know why this occurs or how to prevent it? I can use a development and/or staging environment in WPE to build and test before moving to production, but I like being able to work locally using Local WP, so I would love to get this resolved. Otherwise, using Local is just requiring double work when it comes to uploading imagery or other media files, and somewhat incentivizes me to just cease using it altogether.

For context, I am using Elementor Pro(paired with the Hello Elementor theme) to build the entirety of the site from “scratch” and also have the following plugins:

  • Admin and Site Enhancements(ASE)
  • WordFence Security (in learning mode)
  • Gravity Forms
  • Gravity Forms reCaptcha add-on
  • Simple History

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

Push to any WPE environment and check file path for media assets.


System Details

  • Local Version: Version 9.0.5+6706

  • Operating System (OS) and OS version: Windows 11 Home, Version 23H2, OS Build 22631.4317


Local Logs

local-logs.zip (59.6 KB)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hey @Lanithir

So when this happens are you having to manually clear up these paths with a search and replace?

Since you’re using Elementor does Regenerating CSS help with refreshing any assets or pathing?

Sorry, I should’ve mentioned that: I have done the “Regenerate CSS & Data” suggestion, but it does nothing to solve the problem. The issue only appears to be impacting media files, not any other styles or anything. The file path in the browser also seems to differ from what WP says it is in the media library.

When the issue occurs, even using “search and replace” to adjust the file paths doesn’t work, because WP doesn’t appear to be registering that the true media files are present. They will be visible in the media library, but when you click them, no preview shows up. It’s as if WP knows it is supposed to be there and maybe it has a database item for it, but when it tries actually rendering the image, nothing appears.

For example, I have just executed a push from Local to my WPE development environment, and when i check the media library, I see my assets. When I click on them, I see that the file path is listed as the WPE environment URL, but the image still fails to load. This is what I see:

Media library overview

Then clicking on the image specifically

Here is inspector within Chrome browser, looking at a page where the images are being used. The file path differs.

Some things blacked out for client privacy.

This recent entry in your log stands out to me. Seems like the Search and Replace is failing which obviously makes sense here:

{"class":"SshService","level":"warn","message":"Warning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\PHP\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\Base\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\PHP\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\JS\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\JS\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\JS\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\JS\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\JS\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\PHP\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\PHP\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\PHP\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\PHP\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\PHP\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\PHP\", replacements might not be complete.\nWarning: Skipping an uninitialized class \"Elementor\\Core\\Logger\\Items\\PHP\", replacements might not be complete.\n","thread":"main","timestamp":"2024-10-21T15:20:47.865Z"}

I’m not sure if there is a conflict with Elementor specifically, or another plugin or the theme being used. You could try pushing with all other plugins disabled or removed and see if that works. Or you could try swapping the theme. That would probably be the easiest troubleshooting to try next to rule out a conflict.

As an alternative to pushing with Local Connect, the WPE Migration plugin is free and will work going from Local to WPE. You could test that and see if it yields a different result in which case it might be a good workaround as well for now.

Thanks, I will begin troubleshooting with those suggestions.

To be clear, is Local supposed to update the file paths to whatever URL is set for the WPE environment being pushed up to? I would assume that it is, otherwise that implies you’re supposed to do a search and replace every time you execute a push that includes new media files.

Yes, Local does run an automatic search and replaces it with Local Connect jobs. Now, sometimes, not everything is caught, and additional cache flushing, CSS regenerating, or S/R jobs have to be run afterward. This is sometimes the case even just with using typical Staging/Dev environments and moving them to Production. That said, I think, in your case, something else is definitely amiss. If you find a resolution or have other questions or details, keep us posted, and we’ll be happy to try and assist further!