• Resolved Aeit

    (@mynicknamehasbenstolen)


    Attachments to posts are stored in the database as posts, this means they're accessible under their own URLs if you do not redirect them, enabling this will redirect them to the post they were attached to.

    I dont know if i understand it correctly but i thought this will work in my case.
    I have problem where every media that has been uploaded in wp shows as user post that can be accessed trough http. For example header logo name is : logo-main.svg
    Now anyone knowing this can type domain.com/logo-main
    And weird blank wp post page shows the image published by admin …
    By using redirect i had hope that it will actually redirect to homepage.
    I dont want to make 301 for EVERY media(not only images) used on site.

    I want to completely get rid of it … i already asked on main WP thread what i can do about it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support amboutwe

    (@amboutwe)

    Images and other media that are uploaded directly through the media section are considered unattached. You can view and fix unattached media by attaching it to a post or page by following these steps:

    1. Go to Admin > Media
    2. Click on the list icon
    3. Change ‘All Media Items’ to ‘Unattached’
    4. Click ‘Attach’ when hovering over an image or media item
    5. Search or click on a post or page. This post or page is where your visitors will be redirected when they go to the attachment URL (domain.com/logo-main)
    6. Click ‘Select’.
    • This reply was modified 8 years ago by amboutwe.
    • This reply was modified 8 years ago by amboutwe.

    Is this supposed to work with google image search. If someone clicks on “view original image” or “view image” in google, is this option supposed to take you to the post?

    In my case, I followed the instructions in yoast strictly and all images are attached to specific posts. However, when I click on “view original image” in google images, it takes me to the attachment. How would I make it redirect to the post? Thanks

    • This reply was modified 7 years, 11 months ago by EddieNS.
    Plugin Support amboutwe

    (@amboutwe)

    Images in WordPress are available in two URL formats:

    Image: https://www.example.com/wp-content/uploads/IMAGE-SETTINGS/image-name.png
    Attachment: https://www.example.com/PERMALINK-SETTINGS/image-name/

    The first URL is the actual image URL and allows the image to show up on your site. This is the URL that Google uses for the view original or view image link. We do not recommend redirecting this URL because this could interfere with images being displayed on your site.

    The second URL is a WordPress attachment page and can be redirected to the attached post by following the steps here: How Do I Redirect Image Attachment URLs?

    oh I see, I was actually looking for the first option in which you did not recommended. I’m aware of the interfering aspects with images being displayed on the site but I thought there was a way to overcome that.

    At any point. Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirect attachment URLs to parent post URL’ is closed to new replies.