Support » Fixing WordPress » Media library "view" link

  • Hi,

    Is there a way to change the behavior of the “view” link in the media library overview when it is attached to a post? Now when I click “view” it tries to show the image in the post, which has a custom post type. I would like to change that to just show the image.

Viewing 8 replies - 1 through 8 (of 8 total)
  • when I click “view” it tries to show the image in the post

    Something is broken! Have you tried:

    – deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    – switching to the Twenty Eleven theme to rule out any theme-specific problems.

    resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    – re-uploading the wp-admin and wp-includes folders from a fresh download of WordPress.

    – resetting your custom permalinks back to the default setting via Settings -> Permalinks. If this works, then review Using_Permalinks before setting a custom permalink structure back up again.

    Thanks for your reply esmi. I think I found the problem. We’ve used /%year%/%month%/%postname%/ as a custom permalink structure. When I change back to default it is fine.
    I’ve also tested this on a clean WordPress install, there it does the same. As soon as I create a permalink structure it starts behaving like it did. So it changes from ?attachment_id=XX to the permalink of the attached post with the image name. Something like: url/post-type/year/month/postname/attachmentname

    Any way of avoiding that?

    Or is there a hook I can use to disable the view link completely?

    The custom permalink structure that you’ve been using should be fine and it should not be causing this problem. I think this is an issue at the server level. There’s something wrong with the way that the server is dealing with rewrites.

    I think this is inherent in WP now. I’m looking for a way to disable those pages that contain the images as well. They are showing up in Google results and people are finding ways of submitting pingbacks on these pages even though I have all pingbacks and trackbacks turned off.



    Bump. Can someone please provide a solution for this? We want to disable all the media “view” pages (prevent them from being public).




    I found a partial fix for anyone who is interested. I’d really like these pages to be completely gone, but at least here’s some instructions (in the comment thread) on how to disable the annoying comments and pingbacks on media view pages.


    Did the permalink solution continue to work for you? For me, it doesn’t matter what permalink structure I use. I found that when you click on the “View” link, the image is displayed by single.php which, like you, isn’t what I want. The only solution I have found is to hack single.php to only display the image. Since my site uses a custom post type instead of a “post” post type, it works. Obviously, this isn’t ideal. What if somewhere along the line I need single.php for it’s real mission. Anyway, I was just wondering. Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Media library "view" link’ is closed to new replies.