• Hi there WordPressers, I have a media library with about 375 pages. I have a group of images that are uploaded to ‘ Portfolio 1’

    How do I search and display only these images in the search results of the media library?
    I have tried a couple of plugins, but nothing to select the ‘ uploaded to’ column.

    Thanks in advance for any advice!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    You can order media items by their uploaded to posts. (in list view, not grid view) Click on the uploaded to column head. Repeated clicking toggles between ascending and descending order. Of course “Portfolio 1” is not near the start or end of the alphabet, so finding the right page would be a matter of trial and error. But they all will be grouped together once you can find the correct page. You can change the items per page in screen options to get more items listed on a single page. The max. per page count is 99 IIRC.

    If you know how to construct custom SQL queries, determine the ID for Portfolio 1, the query for all attachment posts whose parent field is that ID. This will yield a list of all media attached to Portfolio 1. Since I don’t know what you intend to do with such a list, I’m unsure if or how this might help you.

    Thread Starter ajphoto

    (@ajphoto)

    Hi @bcworkz thanks for that. Yes I wanted to avoid having to plough through hundreds of pages. In the end I set the search results to display 100 results so I could scroll easy through them. I manually selected the inages attached to portfolio 1 and then put them in a separate folder.

    So in the end plain old fashioned manual work. A filter would have been nice.

    Thanks for replying! Appreciate the help!

    I saw your topic here yesterday and remembered a pain of my own, which I already had in exactly the same place with some WordPress projects. So today I spontaneously designed a small plugin that should fulfil exactly your requirement.

    As it’s very new, it’s not in the repository or available as a plugin. However, you can download it here: https://github.com/threadi/media-attached-filter – go to Code > Download ZIP and then install the ZIP file in your WordPress. You will then have a new input field labelled ‘Attached to…’ in the Media list view:

    View post on imgur.com

    As soon as you search for something in the field, it will suggest a maximum of 10 possible hits in your project. These can be pages or posts. Searches are only carried out in the page title or post title. You must then select the title and can then filter. Only media files that are assigned to the selected page or post should then be displayed.

    Does that work for you?

    I’m still a little confused that you mentioned folders into which you want to move the files. WordPress does not recognise folders. Are you using a plugin for this, if so, which one? It would be interesting to know in order to test compatibility with it – however, the plugin I created is so minimalistic that there should hardly be any problems.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.