Media Library quirks and bewares
It’s fair to say the Media Library is a weak area of WordPress, at least for the needs of u3as. Well know is that it’s tricky to identify media items that are not in use so they can be tidied up by deleting them. It’s also annoying that images can’t simply be pasted into a block with just a prompt proffered to give them a name and alternate text.
There are also quirks to be aware of:
Media items are referenced by a URL – while media items have file names they are located by a URL on the published website. The URL will be the subdomain then the full path to the item in the website’s internal file store (see example below).
Replacing a media item – if you upload a media item directly to the Media Library with the same file name as an existing item, WordPress will not replace the item, it creates an additional item. To be specific, if the item was uploaded in the current month then it will append “-1” (or -2 etc.) to the file name. If the item being replace was upload in a previous month then it goes in a different folder/directory in the WordPress file store but will confusingly retain its name (but not URL). This is assuming there isn’t an item with the same name for that month as well.
This all happens because WordPress creates a new folder/directory for the Media library each month. For example 2024/07/ as in:
siteworks.u3a.org.uk/wp-content/uploads/2024/07/WM-migration-Go-Live-Instructions-and-chklist.pdf
The same applies to uploading to a Page – the URL will be the current year/month. Confusingly, for uploading directly to Posts/Group/Event/Venue/Notice and even Contacts, the URL will adopt the year/month the Post was first created and not the current date. In this case, uploading a replacement item with the same filename directly to the Media Library will create duplicate entries with the same name. The exception will be if the post etc. was created in the current month.
The recommendation is that when replacing Media give them a new file name by including in the name the date and/or version numbers such as v1, v2. Once uploaded, edit the blocks and any links to the item to updatethe URL of the to that of he replacement. Only delete the original item if you are confident it is no longer referenced.
Remove unwanted Media – the simple answer is that unless you are confident the item is not used, don’t.
If WordPress states an item is ‘Unattached’ using the filter on the right it is not at all reliable. For a full explanation see the ‘How to’ on the Media Library Unattached status

There are plugin tools that list unreferenced items, for example WPVivid backup that’s documented in another ‘How to’ article. However, because the way WordPress works internally they cannot be completely reliable, even if you are lured into taking up the offer of a paid version.
This external article on webtrainingwheels.com explains more of the technical detail and some WordPress history.
Cataloguing media – on approach that can ameliorate chaos is to adopt file naming conventions. For example, all items specific to groups could start with a “z” followed by the Group name such as “z Archaeology-treasure.jpg”, “zBridge-bidding-guide.pdf”. Adding the date in the filename can help, e.g. “Walk 2024-08-22.pdf”. Of course this only works well if authors follow the conventions.
Organising media – a Plugin that’s popular with u3as is Media Library Assistant. Note that it’s not supported by the SiteWorks team so please seek help from the Forum rather than our Help Desk. The plugin does not change how WordPress stores media so it can easily be installed and uninstalled without side effects.
Perhaps the most useful Media Library Assistant feature is giving items a category such as “Monthly meeting”. A category can have a parent category, so an image for the Book Group could have the category “Book Group” with the parent category “Groups”.