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.

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.

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.

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.

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.

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)

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.

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

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.

.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.

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?

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.

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’).

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.

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…

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.

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/

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.

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?

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.

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.