How to Attach a PDF to a WordPress Post

Resumes, printable coupons, eBooks, and many other type of documents are prepared for distribution and printing as an Adobe PDF, (Portable Document Format), file.

If you have PDF files that you want to make available for download on your blog, follow these easy steps:

  • login to the Admin area of your WordPress blog
  • click Write Post
  • give the post a Title and begin to enter the text of the post
  • at the point in your post where you want the PDF link to appear, click the Add Media icon

  • A window will appear prompting you to Choose Files to Upload.




  • Click the Choose Files to Upload button and select the .PDF file you want to attach to the post. WordPress will upload the file to your webserver, and the contents of the window will change, prompting you to enter a Title, Caption and Description.(*Note: this tutorial demonstrates how to upload a PDF to your own WordPress / website. If you want to just link to a PDF that is already on the web, simply fill in the URL and Title fields and skip the step of uploading the PDF file)



The Title is the text that will appear in your post as the link text someone will need to click to download the PDF file, enter something appropriate, (e.g.- “Download My Resume as a PDF”, or “Download Printable Coupons”, etc– something to let the user, and the search engines know what the PDF file contains).

For the Link URL field, click the [File URL] button to automatically populate field with the absolute URL of the file.  (Note – this step added 9/30/2009.  This tutorial does not cover use of other URLs in this field).

You do not have to fill in any other blanks, although you may want to enter a brief description and caption for reference.

 

 

 

  • Once you have entered the Title and any other info, and populated the Link URL field, click the [Insert into Post] button.

Based on our example, the link below was inserted into this post, and you can click it to download the sample PDF file.


Download a Sample PDF file


…that’s all folks!
Posted in Wordpress Tagged with: , , , ,
46 comments on “How to Attach a PDF to a WordPress Post
  1. Calicut Students says:

    Do you know why at times when we try to upload a pdf file you get an http error? But when you use the Browser uploader it works fine?

    You are using the Flash uploader. Problems?
    Try the Browser uploader instead.
    Is there something you can do to use the flash uploader ?

    Thanks.

  2. Randy Harris says:

    I checked the URL, and clicked the “Click Here to See Paper” link, (and PDF did show).

    The upload problem you’re having (with Flash uploader), is a known problem having to do with the first account with “Admin” level access, and subsequent “Admin” level accounts. I noticed your article was posted by “admin1″, so I suspect your are hitting that problem.

    If you have access to the original “admin” login, and also have a WP account which is set to Admin level, see if it works in either. Be sure to delete all cookies for that site and clear cache between tests. This could also be browser or browser setting issue.

    This article may help:
    http://thethemeblog.com/wordpress/a-solution-to-http-error-using-wordpress-flash-uploader-problem

    Or some info in the official WordPress support area…

    http://wordpress.org/support/topic/164999

    Hope this helps.

  3. Richard Myers says:

    When I follow these instructions for uploading a PDF file to a WordPress page, I get the message, “specified file failed upload test.”

    Any idea what I’m doing wrong?

    Thanks.

  4. Randy Harris says:

    I did a quick search on google for the exact error message you report, plus the term wordpress, e.g.-

    Google: “specified file failed upload test” wordpress

    It returned a URL: http://wordpress.org/support/topic/164290

    It appears to be a common, but fixable problem (something on your end, e.g. browser, file, or your host, not WordPress).

  5. ck says:

    Thank gawd for your website. I thought I was going to cry. I was shaking trying to find tips to attach a file to a doc. Thank you!

  6. Mark Waterfield says:

    Just great to read some instructions that I can understand. More often I need to be a rocket scientist to understand what are meant easy to understand instructions.

  7. Yes, thank you for this.

    I’m no newbie, and I searched through a lot of material (like info about uploading files in 2.7, which looked very different, and plugins that tell you what files are attached to a post) before I found this perfectly clear, very welcome set of directions.

  8. Randy Harris says:

    I wrote it because I couldn’t find any good directions myself. I work on so many different aspects of web development, I sometimes have to refer back to my own tutorials when I forget how I did something before. I’m glad it’s been useful to others.

  9. mrnav says:

    Ok i follwed all the instructions as mentioned above. It all worked fine in wordpress 2.7 but i recently upgraded to wordpress 2.8.4 .

    Now when i upload a pdf file it appears as a link and when you click on the link, it takes you to a separate page with file download link.

    All i want is that when i upload a file it appears as a downloadable link not to take me to a different page to download a file. Although When i check the html of the page i can see the link to the file attached but when i save it the wordpress editor saves it as a link to a separate page instead of a downloadable link.

    Also the attached file contains rel=”attachment” which seems to be the problem as when i remove the rel tag the file appears as a downloadable link.

    Any help greatly appreciated

  10. Randy Harris says:

    I tried to duplicate your issue. (I am running WordPress v2.8.4 also). It works the same way for me; the PDF opens in the same window as the post and the browser [BACK] button will take you back to the post.

    I suspect it was something to do with the Link URL you used… I have updated the article to instruct people to click the “File URL” button to populate the “Link URL” field in the upload dialog. Entering something else may cause different behaviors, (such as you describe, and; which I have not experimented with… yet)

    Try again, and let us know if you can’t get it to work.

  11. Max says:

    Thanks for this tip. I had to add mime type to be able to upload Windows Registry files.

  12. Amy Porterfield says:

    YOU are the BEST. I just figured out what I was doing wrong in about 5 seconds thanks to this great post. THANK YOU! Amy

  13. Cathy Ridley says:

    When I try to link a pdf to a specific page, not a blog, it doesn’t seem to link. Although it does upload to the media library and is identified there as attached to the correct page. Any advice?

  14. Randy Harris says:

    Did you use the Insert Into Post button after you uploaded the PDF ?

  15. Edna says:

    I have spent a whole week trying night and day to insert page tags in my long separated wp posts but nothing appears. I don’t understand CODE language and the instructions give say, in wp-paginating.

    May be I have come to the right place for an explanation.

    Thanks
    Edna

  16. Randy Harris says:

    Hi Edna,

    Unfortunately I am not using any of the pagination features or plug-ins. I suggest using the WP support forums — there are a lot of topics on paging there already, and many people who are working on the same issues.

    See: http://wordpress.org/support/

    Sorry I couldn’t be more help.

    Randy.

  17. Darren says:

    Thanks for the great instructions. PDF newsletter posted successfully on my website.

  18. Gayle says:

    To Cathy (comment #14)
    I have same problem. I have newspaper articles that I want to link to a pdf but it wont link. Can some one give advise?

    click media, library, add new
    select files (I choose a pdf from my computer hard drive)
    click save all changes
    copy the File URL

    click pages, edit
    highlight the title of the article
    click the link icon(aka insert/edit link)
    at Link URL paste the URL of the PDF
    click insert
    click update

    AND IT DOES NOT WORK, I tried with a PDF and MS Word doc
    do I have to fill in title?

  19. Randy Harris says:

    Hi Gayle. You seem to be making this difficult on yourself. I just did a test to upload a .PDF to a WordPress PAGE (not a post, a page)… It was simple and worked immediately. And yes, I filled in the Title, (it is the text used for the link to the PDF).

    In Admin screen:
    1. click Pages > Add New
    2. Type some text in the body of the page editor.
    3. Position cursor at point where you want .PDF link to appear on page.
    4. Click Add Media icon
    5. Select file from computer (upload)
    6. you can change the Title text or leave it as is for testing.
    7. make sure it is using the File URL
    8. click Insert into Post

  20. Gayle says:

    To Randy,
    Yea it worked, all my articles have links that work. thanks.

    You are good. Can you help me figure out how to change font size, font color? I would like to do it in Visual but I don not see font or color buttons , like in a Word doc. HTML is confusing to me.

    I want to make this font smaller:
    Flamingo Tennis Center Articles:

  21. MS says:

    Hi, I followed the steps:
    In Admin screen:
    1. click Pages > Add New
    2. Type some text in the body of the page editor.
    3. Position cursor at point where you want .PDF link to appear on page.
    4. Click Add Media icon
    5. Select file from computer (upload)
    6. you can change the Title text or leave it as is for testing.
    7. make sure it is using the File URL
    8. click Insert into Post

    But the issue is that whenever I do file URL (step 7), it sets a location which no longer exists (as I restructured the categories) but it always upload the file to that unavailable locatoin and I’m getting 404 errors.

    Please help

  22. Randy Harris says:

    Check under:

    Dashboard > Settings > Media > Store uploads in this folder

    WordPress will use that path plus the YEAR and MONTH, (in YYYY/MM/ format), e.g., the full path for the example in this post (which is from October 2008) is:

    http://lexipixel.com/wordpress/wp-content/uploads/2008/10/sample-pdf-for-wordpress2.pdf

    (path + upload archive directory + filename)

  23. Lorna says:

    Hello,
    I am desperately trying to get a pdf to appear on a page. NOT a link to the pdf to download, but the actual pdf. Seems I’ve tryed everything, but clearly not. Any help out there?

  24. Randy Harris says:

    .PDF files are not “native” to HTML and require the Adobe Acrobat Reader to open the file — so you would not be able to get PDF content to appear within the (HTML) of a page.

    Additionally, since PDF requires an application to open the file —AND— the user can control if the browser (and Acrobat) should simply open the file in current browser window or tab, or in a new window or tab or save the file to disk (and not open it at all) — you can neither force or predict how the PDF will be handled.

    Before you start looking for problems in how your site delivers PDF’s, you should check your own browser settings, and better yet — test with a few browsers — and ask others to test and give you feedback.

    If you really need the content of the PDF to display “on page”, the content should be duplicated as HTML and images.

  25. Fred says:

    Very helpful instructions,

    Thanks for sharing

  26. Linda Marrone says:

    I, too, am adding PDF files to our website. Your directions are very clear and concise… Thanks! I have uploaded and inserted the PDF newsletters from my computer. Logged in as admin and after saving all changes, I can access the file (view the post) and it populates in another window with an active link. However, when I log out as admin and enter into the website as “Joe Average”, the link is not there. What’s my dilemma?

    Comments… Thanks!
    Linda

  27. Randy Harris says:

    Hi Linda. I was able to browse the HS website and and found the May Newsletter, (HSWM_May20112.pdf), which was a link in a blog post — I clicked it and was viweing the PDF with no problem. I’m guessing it may be a browser cache issue, (try clearing the cache then reloading the page and see if it’s there). You might also want to try it from another computer, (or have a few friends try from their computers). The first thing to figure out is if it “you”, “your computer”, “certain browsers” or “everyone”… and since I can view the PDF, it’s not “everyone”… FWIW, I was able to access and view the link and the PDF using both FireFox and MS-IE.

    Randy.

  28. Nilay says:

    Thanks it helps a lot.

  29. I’ve been wondering how to do this for awhile. Today when a client asked me to add downloadable PDFs to their WP website, I said, “No problem.” Then I immediately hit Google and found your post (#1 search result for ‘how to post downloadable pdf in wordpress’).

    Thanks to you, it was indeed, No Problem!

    Best,
    Nikolas Allen
    BAM! Small Biz Consulting

  30. Randy Harris says:

    Glad to help — looks like this nearly 3 year old post was worth writing!

  31. jane says:

    thanks for posting this,it may be 3 years old but it is still brilliant :)

  32. Hashini says:

    it is opened in the Browser. I need to download it. Please help.

  33. Nabraj says:

    Thank you so much. It worked

  34. Eve Black says:

    Hi, Randy.

    I have a simple, two-page PDF document, sitting on my desktop. It is an enrollment form and is necessary for enrolling someone into a specific program I am offering on my site. I need to have a link from my central text to that PDF file. Can you tell me, please, exactly what I must do? I’m a real newbie at all this, and really need to have that document available to anyone who reads my site.

  35. Randy Harris says:

    If there is some part of this article you don’t understand, I’d be happy to answer a specific question — beyond that, all I can say is to follow the steps above.

  36. MW says:

    Hi, is it possible to be able to have the PDF open in a new tab/window? I find it’s annoying to have a pdf open in the same window, and then you have to navigate back.

    Thanks!

  37. Randy Harris says:

    How your browser handles the PDF can be a browser setting. You could try adding target=”_blank” into the tag — but many people’s browsers are set to open PDFs in their own window, or only download the PDF then open it with Acrobat…

  38. Jim Clark says:

    Hi

    With respect to #24, where uploaded files are stored, is it possible to have multiple folders for different kinds of content, rather than everything being in one directory?

    Thanks
    Jim

  39. Randy Harris says:

    Hi Jim,

    I don’t think you can specify multiple folders from the WP settings.

    The simple solution is to learn how to use FTP client software and use that to upload the files.

    Using FTP software you can manage files on your host in the same way you would on your own computer. You could create as many folders as you like and then “drag and drop” files into those folders from your computer…

    Once you FTP (upload) the file, you would use the “From URL” method to insert a link to the PDF (or other type of media) into your post.

    For FTP client software, I suggest looking into Filezilla — it’s FREE and very easy to use.

    See: http://filezilla-project.org/

    Randy.

  40. Daniel Payne says:

    Randy,

    Using FTP is defeating the entire purpose of WordPress because WordPress is designed to be a complete CMS, not requiring external tools like an FTP client. Yes, as a developer I use FTP all the time but none of my clients will use a FTP tool.

    Jim,

    WordPress uploads everything into the same folder, the default are folders with the names of the month. If you go to: Settings> Media, then you can check or uncheck the choice for where your files get uploaded to. I usually uncheck the choice, so my files get uploaded to: http://www.mysite.com/wp-content/uploads/

  41. Randy Harris says:

    Hi Daniel,

    I was offering what I consider the best advice for someone who doesn’t like the default /uploads/ -or- /year-month/ type of archiving of uploaded assets.

    While WP is great and has given countless people the ability to put up a website without having to know anything more than how to use WP — that is also a problem; there are now hundreds of thousands of “webmasters” who don’t know what FTP is, or how to hand edit HTML, CSS, JS, PHP or work with MySQL databases —- they simply expect there to be a “WordPress setting” to make everything work the way they want it to.

    …and FWIW, many of my clients use FTP and find it very easy, (and in many cases I insist they learn to use FTP so they can do complete backups, clean up old files, etc).. Using FileZilla to manage files on (1) website is only slightly more complicated than being able to drag and drop files between two folders on your own machine.

    Randy.

  42. Gina says:

    If anyone can assist me I would be forever grateful! I have no problem uploading my pdfs to my WordPress Website, but my dilema is this: The pdfs I am uploading are to be downloaded only when my customer purchases and I don’t want them to be able to open and get them free prior to paying.

    1. How do I add a pdf file and/or word file to my SIGN UP page on my website, for example, so customer can click to purchase, but is not able to see, download and/or open the file until the purchase has been approved?

    Thanks so much for any help out there.

    Gina

  43. Randy Harris says:

    Hi Gina,

    I took a quick look at your WordPress site. Your problem is beyond the scope of this article. You’ll need to find and use a ecommerce / shopping cart plugin, or otherwise enable some 3rd party software or service to handle payments and authorizing the downloads through your WP based website. Personally, I don’t think WordPress is the best solution if the primary function of your website is to sell PDFs, (which could be considered “eBooks” in .PDF format).

    WordPress is basically “blogging software” — but these days people are pushing the limits and trying to use it as a full-blown content management systems, (CMS), ecommerce solution, and many other purposes — it may not be the right tool for your needs.

    Sorry I couldn’t be more help.

    Randy.

  44. Kevin says:

    Randy,

    I’ve had success creating pages with pdf links to our history bulletin. Within one publication, there are sometimes several articles. I’d like to know how to create a link to the pdf that goes to the specific page or even part of the page the article begins on so the reader doesn’t need to scroll through the entire issue to find the article title desired. If you would have any clear instructions for someone like me just wading into building a WordPress site, I’d sure appreciate it.

    Kevin

  45. Randy Harris says:

    What you’ve done with your “Index” page seems close to what I would have suggested, if I understand the issue.

1 Pings/Trackbacks for "How to Attach a PDF to a WordPress Post"
  1. [...] to attach your PDF file’s URL , follow the directions here. by pjhalterman posted under Tutorials | No Comments »     Click [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>