Hi,
This should not happen, it should only moves files depending on the complete path.
Do you have an examples?
Like what is the original full path of the image (ex: /wp-content/uploads/2020/05/myfile.png), the new path name you set (ex: /wp-content/uploads/myfolder/newname.png) and the older file path?
Best regards
Hi there,
Thanks for the quick response. This is my first time asking for support on WordPress.org so I apologize in advance if I miss something you need.
So here’s what happens:
I have two pre-created folders, /wp-content/uploads/comics/series1/ep01/ and /wp-content/uploads/comics/series2/ep01/. Both have files named page01_panel01_background.jpg
I upload a new file also named page01_panel01_background.jpg, which has the default path /wp-content/uploads/page01_panel01_background.jpg
I change this file’s path to /wp-content/uploads/comics/series2/ep02/page01_panel01_background.jpg
When I do that, the database table replace also replaces the previous files with the same name on the other folders.
Thus, I end up with the following broken links on pre-existing pages:
– /wp-content/uploads/comics/series1/ep01/comics/series2/ep02/page01_panel01_background.jpg
– /wp-content/uploads/comics/series2/ep01/comics/series2/ep02/page01_panel01_background.jpg
I have to assume this happens because the plugin checks for instances of files named “page01_panel01_background.jpg” and replaces the path, thus breaking the links on the existing pages.
Thank you in advance for all your help and patience.
Hi,
Don’t worry that’s ok.
Yes in fact the bug occurs because all your files end up in the /wp-content/upload folder.
Unfortunately that’s a bug I’m not sure to be able to fix, due to how file are stored in the database.
The only solution for the moment is to set the option “Organize my uploads into month- and year-based folders” in the WordPress media settings page.
I’ll try again to have a look on it, maybe I’ll have a better idea this time.
Best regards
Hey again,
Okay, gotcha, thanks for clarifying.
Follow-up question then:
Disabling “Detect media tables to replace content” in the settings and selecting no options just disables the database table rewrites, right?
I’m changing all the file paths before I add them to posts anyway and, honestly, it’s easier to correct an image or two I forget to change the path to than have to run SQL queries to correct hundreds of other images.
Thanks again, I’m really surprised by the speed of your support!
Yes, in your case you can do that.
Be sure to deselect all columns, as by default some columns are set for the wp_posts table.
You’re welcome!
You can drop a review here to share your thought: https://wordpress.org/support/plugin/wp-media-folders/reviews/#new-post
Best regards
Hi,
I have published a new version today.
It should fix your problem.
Now first uploads in a folder are not updating database anymore, as it’s not necessary. This should fix your issue.
Also there is now a setting to replace or not relative path in database, which when the plugin is installed and year/months folders are not used will be set to uncheck on plugin install.
This should also fix your issue. You can set it in the setting page.
Best regards
Oh hey, that’s amazing, thanks! I’ll update and check it out!
Oh and I won’t forget to give you a 5-star review 🙂