Make WordPress Core

Opened 7 months ago

Last modified 4 weeks ago

#59742 assigned defect (bug)

Media library should display the number of pages/posts/urls a particular media file is being used in.

Reported by: rsiddiqe's profile rsiddiqe Owned by: antpb's profile antpb
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: ui Cc:

Description

For managing media files, WordPress requires you to navigate from the Media Library. However, selecting a file doesn't offer any information on the published pages/posts that are actively using the file.

This information is necessary to effectively manage storage and replacing media without losing essential files or causing dependency issues.

Selecting a file from the media library should ideally, at minimum show the number of published pages/posts it's in use. Best case would be to make the number a clickable item, that shows a list of all URLs using the file.

Attachments (5)

Screenshot 2023-10-26 at 2.16.51 PM.png (511.3 KB) - added by rsiddiqe 7 months ago.
Context menu upon selecting a file in media library
WP media - 1.jpg (1.1 MB) - added by ababir 4 weeks ago.
WordPress Dashboard media list view
WP media - 2.jpg (836.9 KB) - added by ababir 4 weeks ago.
List view - source page list popup
WP media - 3.jpg (1.7 MB) - added by ababir 4 weeks ago.
Single media view
WP media - 4.jpg (948.0 KB) - added by ababir 4 weeks ago.
Single media view source page list popup

Change History (15)

@rsiddiqe
7 months ago

Context menu upon selecting a file in media library

#1 @sabernhardt
7 months ago

  • Component changed from General to Media

#2 @ababir
7 months ago

Hi,
The "View attachment page" link does not actually show the page where the image is used. It simply creates a demo page and displays the image on that page.

This could show a list of the URLs the image is used in.

This ticket was mentioned in Slack in #core-test by krupajnanda. View the logs.


7 months ago

#4 @ashikur698
7 months ago

WordPress doesn't show the location or pages the media is in use. This makes errors on many pages for deleting the media in use. If this feature is added, it has the potential to solve many errors on the WordPress site.

#5 @pbearne
7 months ago

#59753 linked ticket

#6 @matt
2 months ago

An easy first version of this could be linking to a search page where you can see all the places the URL appears in posts.

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


5 weeks ago

#8 follow-up: @joedolson
5 weeks ago

  • Milestone changed from Awaiting Review to 6.6
  • Owner set to antpb
  • Status changed from new to assigned

We could certainly add a link to search results, per @matt's suggestion. We might want to think about doing some kind of special search that also accounted for usage as featured images, since I think only identifying image usages in post content will be too limited in scope

We'll still be missing usages in meta fields, but that's more of a special case that should probably be plugin territory.

Putting in the 6.6 milestone with the suggested limited scope; if we need to actually find all uses of the image, I'm not sure we'll have time in 6.6.

#9 in reply to: ↑ 8 @rsiddiqe
5 weeks ago

Replying to joedolson:

We could certainly add a link to search results, per @matt's suggestion. We might want to think about doing some kind of special search that also accounted for usage as featured images, since I think only identifying image usages in post content will be too limited in scope

Further considerations to increase the scope of the feature:

  1. Published URL's that are using a specific image.
  2. Category of URL's (Page or Post).
  3. Sorting based on Published date of the URL.
  4. Sorting based on the date image was added to the page/post.
  5. Select URL to show all media used on the page/post.
  6. Identifiers based on the usage of the image in blocks (div, Featured Image, Inner Image etc.).
  7. Deletion warning (!) such as (Image is in use on the following number of pages/posts).
  8. Whether an Image is unused.

These are a few I've personally felt the need for when managing sites of 10K+ media with 3-5 years age.

Considering the current state of Media Library it's not intuitive enough for managing large number of media files. Adding these will enhance the management capabilities for users that can't tinker around with Adminer or MySQL Queries.

@ababir
4 weeks ago

WordPress Dashboard media list view

@ababir
4 weeks ago

List view - source page list popup

@ababir
4 weeks ago

Single media view

@ababir
4 weeks ago

Single media view source page list popup

#10 @ababir
4 weeks ago

  • Focuses ui added

I was thinking about the interface, and it could be a simple UI iteration of current design. It can show the number of the page/post attached in list view or in the single view. And by clicking on it, it will open a popup, which could be similar to the manual attach popup. And in the popup, pages and post names will be clickable to the source.

I have attached a few screenshots of possible changes.

Note: See TracTickets for help on using tickets.