Support » Fixing WordPress » Cannot link directly to PDF file in media library, only to post

  • I haven’t noticed this on any of my WP sites except the new one I just set up. I’m trying to upload a few files, and right on the front page, I’m putting a link to a PDF file. I upload the file (using the browser uploader, since Flash 10 broke the flash uploader), and for the link type, I choose “Link To File” and insert. When I go to the HTML view, I confirm that the link does point to “”

    However, as soon as I hit Save, that link changes to “” (the “post” location of the file). If I manually change the URL back and save again, it reverts again upon save.

    The file is present and accessible. I can get to it without any problem by using the direct URL. It’s just that WordPress won’t let me save that URL in the page. What gives?

Viewing 15 replies - 1 through 15 (of 24 total)
  • I’ve confirmed that this problem does NOT exist on another WordPress site that I administer. Any clue what might be causing it on this one? Both sites are using WordPress 2.6.3.

    I was able to bypass this problem by manually changing the URL that WordPress entered, and removing the rel="attachment wp-att-114" part of the link. This workaround shouldn’t be necessary, though, as it’s not on the other site I tested on, where the automated “Link To File” button worked fine.

    Hi there,

    I have also experienced this exact same issue – and removing the ‘rel’ attribute in the link also served as a workaround – thanks for posting it.

    This bug is not restricted to pdf file types – my case was a Word doc.

    For reference I am using WordPress 2.7 on Linux based hosting.

    Will do some digging and post what I come up with.


    I found this in the bug trac – and it seems to cover what we have identified – and narrows it down to only the ‘start’ page where you have a static home page being affected (which matches my use case – not sure about yours?)

    I have reopened this in Trac.

    Yes, this was a file I was trying to link to on my static homepage. I haven’t yet tried on 2.7 to see if this bug still exists on my site.

    I’m having the same issue. Uploading a pdf puts it in the gallery fine, but there is no active link.
    This occurs on posts, haven’t tried on pages.
    We do NOT have a static homepage.
    This has occurred ever since we switched to WP 2.7 using automatic updater.

    Any Word on this? It’s not just an annoying bug, it is killing the productivity for some of my clients. Is there a plugin that corrects the issue?

    I only found about it today after a client of mine stated they were having the same issues. I updated their site as soon as 2.7 was released and they were able to post PDF’s to their site. However, as of yesterday they cannot and I have tried this on my personal site and get the same issue. This only occurs when attempting to post to the main page, whether it is static or latest posts. Also noticed the Flash Uploader is broken after installing Flash Player 10. I will continue to do some more searching for a resolution.

    Anyone found a solution to this? I have the same problem. I am running 2.7.1. The PDF is uploaded to media library fine, but is not hyperlinked when you visit the post. It is driving me nuts!!!?

    It was driving me nuts till I found a this

    Make sure the link URL is ‘file’. For me it was blank initially. By default, prior to 2.7 it would point to the file as soon as you’d uploaded.

    Having set it to file on the last upload I did it now generates the link to the file every time.

    Maybe it remembers your last preference but if you’ve never set it then I suppose it has nothing to remember…? dunno

    Yes, beautiful. Such a simple thing missed before. Everything seems to work great for me now. Thanks all for your work on this!!

    I just came across this problem too – using a static page as my homepage and trying to link to a PDF file from it. The file is there, but the link gets re-written every time you update the page so that clicking on the link takes you to another page with only the actual file link on it (and that one works fine).

    Like suggested above, taking out the rel attribute worked for me, didn’t try the file:// method.

    I’d say this is a bug – someone needs to track it down and squish it! I’ve added my voice to the Trac ticket…

    I can’t make this work either. I don’t have any rel attribute in the link code and it still doesn’t work!



    on a private blog I set up I have the pdf’s embedded in posts. Folks can then save the file or view it live.

    Thanks Samboll … I think. Can you build a link from some text in a “Page” and get it to link properly to a pdf file on the host server? I still can’t. Can you confirm for me that this is some sort of bug and that is not me doing something silly. I’ve read, googled, read instructions and watched videos and still can not link to a pdf file from a page in 2.7.1 on a hosted server.


    I haven’t tried linking directly but it seems there must be a problem since so many can’t do it.
    My client wanted the embed thing and it works.
    Here is the code:

    <embed src='' width='425' height='425'</embed></embed>

    You can play with the sizes. I don’t particularly like it but some think it’s cool.

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Cannot link directly to PDF file in media library, only to post’ is closed to new replies.