Make WordPress Core

Opened 2 years ago

Closed 15 months ago

Last modified 15 months ago

#55500 closed enhancement (invalid)

Ability to change slug of Attachments

Reported by: nidhishanker's profile nidhishanker Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.9.2
Component: Media Keywords: reporter-feedback
Focuses: performance Cc:

Description

As WordPress facilitates to change permalink/slug of Post Types, it is suggested to enable editing the slug of Attached Media.

Right now after uploading an image, it is possible to update all information except the media slug.

In my case, the slug had some encrypted or random character and now I want to change the slug of Attachment.

Note: Required screenshots are attached.
[]

Attachments (2)

after-image-upload.png (2.9 MB) - added by nidhishanker 2 years ago.
Attachment after uploading media.
after-image-renamed.png (2.2 MB) - added by nidhishanker 2 years ago.
Attachment after renaming media but permalink remains steady.

Change History (9)

@nidhishanker
2 years ago

Attachment after uploading media.

@nidhishanker
2 years ago

Attachment after renaming media but permalink remains steady.

#1 @desrosj
22 months ago

  • Component changed from General to Media

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


21 months ago

#3 @antpb
21 months ago

  • Keywords reporter-feedback added; needs-patch removed

Hi @nidhishanker ! There was some discussion about this in a recent media meeting and we had some concerns around this feature giving folks the ability to break content without knowing. In posts, it is easy to change slugs and redirect as we need because it is the final content rendered when making a request. For attachments it could conflict with existing content.

Do you have any thoughts around how this could be avoided? Ideally a feature like this would account for all uses of the Media to update them, but I suspect theres some hidden complexity in there.

#4 @verygoode
18 months ago

Howdy @nidhishanker, @antpb!

There is a Slug option for attachments. I believe it is hidden by default to prevent potential problems. E.g. broken links...etc

To reveal it

  1. Edit the selected attachment
  2. Open Screen Options
  3. Check/enable the Slug option.
  4. The slug field will be available at the bottom of the page and can be edited.
  5. Update once done.

This will change the slug and also free it up so it can be used by other post types.

Not sure if this issue needs to remain open, unless it's converted into an enhancement to improve this behavior.

Last edited 18 months ago by verygoode (previous) (diff)

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


15 months ago

#6 @joedolson
15 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

To add to @verygoode's comments, this is only a feature available in list mode; the slug isn't editable in the modal view. However, given that this is a rarely needed option, I don't see a lot of need to add it into other views.

Closing this ticket, as the option to edit an attachment slug already exists.

#7 @sabernhardt
15 months ago

comment:4 describes how to access the Slug field in the media library's List mode, but the description of #57285 tells how to get there when in Grid mode (clicking "Edit more details" in the popover dialog).

Note: See TracTickets for help on using tickets.