Thanks for your kind words and for your question.
There is no support in the current MLA version for updating Media Library items from the content of a CSV file. However, it would be straightforward to create a small custom plugin that would do something like you propose. Here’s what I imagine:
- You install and activate the custom plugin.
- A new Tools submenu, e.g., “MLA CSV Updater” appears.
- You upload your CSV file to the Media Library.
- You navigate to the Tools/MLA CSV Updater submenu, enter the ID of the CSV item and click “Do Updates”.
- The custom plugin reads the file and applies the updates.
I propose adding column headers to the first line of the CSV file to make it a bit more general. The first column would be either “file” or “id”, denoting the file name or the item id as the key. The second column would be something like “title”, “caption”, “description” or “alt_text”, denoting the field to be updated.
Using the file name can be tricky. First, if you divide the uploads area by year and month you can have the same file name in multiple directories, e.g., 2015/01/file.jpg
and 2015/07/file.jpg
. Do you have the year and month prefix in your file names, or are you using a “flat” uploads area? Second, if your file name contains spaces or other special characters WordPress will alter the name; is that a problem in your application? Third, if you upload the same file multiple times WordPress will add a suffix to the file name to make it unique. Is that a problem in your application?
If you can ensure that the file name in your CSV file matches the value in the WordPress _wp_attached_file
postmeta field the custom plugin approach should work.
If this is of interest, let me know and I will try to put something together. Thanks for your interest in the plugin.