We are currently running a script to migrate from a custom CMS to WordPress. Everything is going perfectly well except for the "media manager".

The media is all stored on a S3 bucket. Here is a sample: CDN_LOCATION/2018/12/13/06/19/22761255000000_original.jpg

We are re-creating the media item and mapping all the thumbnails accordingly and it all works perfectly fine. On the frontend everything loads good and all the different sizes load perfect. On the Admin Panel featured images display correctly.

But the problem is the media manager thumbnail URLs are incorrect and the system automatically adds an additional part on its own disrupting the correct URL:

enter image description here

The additional part automatically takes the folder structure from the original image and implements it on the thumbnails (all we need is to disable this basically).

We are using Offload Media Lite plugin for the S3/CDN.

Below is how the meta is saved which is correct and reflecting on the site.


and this is the rest of the metadata:

enter image description here

Can anyone help let us know what are we doing wrong? How can I tell media library not to randomly add this bit of code? Funny enough when we click on it and go to the actual media the path and URL on the right are correct but again the large image has the exact same problem where it chooses to add that addition to it.

  • 1
    This is because the media manager is treating each addition as an entirely new upload to Wordpress thus implementing the structure into the file name where it would usually be stored. Have you looked in your upload folder to see if the directory is being built? If so it's more than likely also adding the imagery. – Beaniie Jan 24 '19 at 20:33
  • @Beaniie no, nothing is being stored in the upload folder actually. How are we supposed to just tell media manager not to deal with it like that? – Hossj Jan 25 '19 at 4:46
  • I believe...there is a temporary directory, in which media files pass into, that you need to set "proper" user permissions on, or else you are going to have issues as explained. – klewis Jan 26 '19 at 2:19
  • That /2018/12/13/06/19/ part in the object's path is weird, WP Offload Media Lite does not split out the path beyond YYYY/MM if using that setting. Just a guess, but it looks like you have something altering the object path that is maybe also getting hooked in at the wrong time for the Media page. Normally you alter the object path with the as3cf_object_meta filter, maybe another filter is being used? – ianmjones Jan 28 '19 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.