Make WordPress Core

Opened 9 months ago

Last modified 3 months ago

#59753 new defect (bug)

Attach image to existing content functionality not working properly

Reported by: mihirdev21's profile mihirdev21 Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Media Keywords: phase-3-media-triage
Focuses: docs Cc:


Hello guys, Hope you're doing great!

So, I was trying to attach my image to existing content of a post from the media module. But I guess that functionality isn't working at all! can someone please check into this?


Screen recording:
Tested Environments: Fresh WordPress ( 6.3.2 , 6.4 - Beta , 6.5 alpha-57013 )

Attachments (2)

Media Library ‹ Basic — WordPress.mp4 (543.3 KB) - added by hardikgohil 9 months ago.
Screenshot 2023-11-02 at 10.51.19 AM.png (187.0 KB) - added by hardikgohil 9 months ago.

Download all attachments as: .zip

Change History (11)

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

9 months ago

#2 @hardikgohil
9 months ago


WP version tested: 6.3.2, 6.4 RC1, 6.4 RC2
Browser: Chrome
OS: Mac

Steps to reproduce:

  1. Go to Media Library
  2. Make sure you have already uploaded images in media library
  3. In the list view, click attach link of any image
  4. Select Post or a Page where you want to attach the image
  5. Click Select button
  6. Make sure selected page or post is linked to the image
  7. Now Click on the selected page or post to check the attachment of the image

Actual Result: On the list view, image is attached to selected page or post. And when user click on the attached page or post, the image is not there.

Expected Result: Image should be attached to the selected page or post.

Video is attached.

#3 @zunaid321
9 months ago

Test Report

This report shows that the issue can be reproduced.


  • OS: Windows 11 (22H2)
  • Web Server: nginx/1.25.1
  • PHP: 7.4.33
  • WordPress: 6.5-alpha-56966-src
  • Browser: Chrome Version 118.0.5993.117 (Official Build) (64-bit)
  • Theme: Twenty Twenty-Four v1.0


  • Followed the instructions of @hardikgohil
  • 🐞 Reproduced the issue

Supplemental Artifacts

#4 @pbearne
9 months ago

  • Keywords reporter-feedback added; needs-patch removed


I am not sure that you have got the behaviour expectations right

Attaching an image to a post just links the image to the post it doesn't insert it or make it the featured image

This is an internal linking

If you go the media library you can filter the media by upload to this page and will see the images attached

#5 follow-up: @hardikgohil
9 months ago


I have referred to the document of WordPress Media Library and here is the screenshot of the "uploaded to" column definition is attached.

It clearly states that:
"Uploaded to describes the title of the Post or Page that contains this Media and the date of that Post or Page."

It means post or page contains the attached image.

Version 0, edited 9 months ago by hardikgohil (next)

#6 in reply to: ↑ 5 @pbearne
9 months ago

Replying to hardikgohil:

I take this to mean that the Media page has the title and link the first Post/Page the image is linked to

Not that the Post/Page pages have the images displayed

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

3 months ago

#8 follow-up: @antpb
3 months ago

  • Focuses docs added; administration removed
  • Keywords phase-3-media-triage added; reporter-feedback removed
  • Milestone changed from Awaiting Review to Future Release

The behavior outlined here is working as intended, we should move the focus of this ticket to refining the docs to be more clear that linking a media item to a post is an internal linking and should not be expected to add markup or change the post data. There are lots of ux considerations there that would need to be taken if that was the case.

#9 in reply to: ↑ 8 @azaozz
3 months ago

Replying to antpb:

The behavior outlined here is working as intended

Yes, the "linking" is actually setting the selected post to be the image attachment post's "parent". This is not really "linking". Perhaps can also add a little of "explanation text" at the top of that modal.

It seems now this is used mostly for back-compat. For example this was used to create a gallery from all the images that were uploaded to a post by typing [gallery] (yea, that's the first shortcode ever in WP).

Last edited 3 months ago by azaozz (previous) (diff)
Note: See TracTickets for help on using tickets.