Support » Fixing WordPress » Media Uploader Inserts Wrong Post URL

  • I have a reproducible problem with the Media Uploader where it screws up the Post URL every time.

    When I upload an image and under the Link URL section I tell it to insert the Post URL, it shows it this way:

    Obviously, when I actually publish the post it’s supposed to insert the correct post URL. However, that’s where it goes wrong. The correct post URL after publishing should be like this:

    But what it’s doing is repeating the post title twice in the URL, like this:

    Following that incorrect Post URL that WordPress is inserting takes you to page with just a scaled down version of the media attachment.

    This is really annoying to have to publish, and then go back and correct the post URLs on all my inline image links.

    Does anyone have a solution? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Err.. Actually, that is correct behavior. Attachments get their own post which is a sub-post of the main post.

    In this case, your picture is actually named “cramps.jpg”. That’s where the second “cramps” comes from. The first one comes from the parent post, which you also named “cramps”.

    Basically, your permalink structure is %year%/%month%/%day%/%postname%. The “postname” for the attachment post is “cramps/cramps” because its parent post is “cramps” and its own name is “cramps” as well.

    If your attachment was named “picture” then it would be

    Also, that scaled down picture post is the actual attachment post. That is what you are supposed to see when you link to the “Post URL”. If you want to link to the actual image file itself, then use the “File URL”.

    Is there a way to get the Image Uploader to automatically insert the permalink for the parent post itself? That seems a lot more useful to me anyway, frankly.

    Many thanks, Otto, for clarifying!


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Media Uploader Inserts Wrong Post URL’ is closed to new replies.