• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WriteNowDesign - Wordpress and Ecommerce Website Design

WordPress, Joomla, Ecommerce Website Design

  • Home
  • Prices/Packages
  • WordPress
  • Services
  • Portfolio
  • Blog
  • About
    • Testimonials
    • Locations
    • Online Payment
  • Contact
  • Show Search
Hide Search

Call 303-907-6133 Email

How to Link to a PDF in WordPress

December 11, 2018 by Pat Fortino

WordPress makes it pretty easy to add images to a page or post, but how do you add a PDF or Word document to a post? Update added for Gutenberg Blocks. It’s even easier now but with some limitations.

Now that Gutenberg has been released, Linking to a PDF is different.

  • Link to a PDF in WordPress Gutenberg
  • Link to a PDF in WordPress Classic Editor
  • Workaround to Link to PDF in WordPress Gutenberg Paragraph and List Blocks

Limitations of the Gutenberg File Block

In Gutenberg, you use the File block to link to files such as PDF or MS Word documents. There are, however, several limitations to the File block that will prevent you from linking to PDF files like you did in the Classic Editor.

The File block is an individual block, and as such, it cannot be added to another block. As a result, you can’t use the File block to add a PDF file link in a paragraph or list.

Unfortunately, lots of people use unordered lists to list links to PDF files. And lots of people link to PDF files from within a paragraph. If you still want to link to PDF files in this way, I recommend that you install the Classic Editor and continue to use that until Gutenberg includes these features.

Or, you can insert the Classic Block and then link to PDF files the same way you do in the Class Editor. The nice thing about this method is that you can enjoy the advantages of the new Block Editor while still using features you need from the Classic Editor.

Classic Block

You can install the Classic Editor even if you already installed WordPress 5.x / Gutenberg. Furthermore, once the  Classic Editor is installed, you can open any post or page using the Classic editor. With the Classic Editor installed, go to Settings > Writing to specify if the Block or Classic editor is the default and if the user can choose which editor they want to use to open a post or page. With the Classic editor installed and with the correct settings in Settings > Writing, WordPress will work just like it did before version 5.x / Gutenberg.

Finally, if you want to continue using the Block editor, there is a workaround to add PDF links to paragraphs and lists.

Link to a PDF in WordPress Gutenberg

  1. Open a post or page, put your cursor in the block where you want to add the PDF link, and click the Add Block button.
    Gutenberg Add Block button
  2. Select the File block.
    Gutenberg add file block
  3. Click Upload or Media Library and navigate to the PDF file or document you want to link to. If you are uploading a PDF, it will automatically upload to your media folder.
    Gutenberg Choose File
  4. Select the PDF you want to link to and click Select.
  5. Adjust the PDF Settings.  
    – Click Open in New Tab if you want the pdf to open in a new tab.
    – Click Show Download Button if you want to show a file download button. The Download buttons allows the user to download the pdf rather than view it.
    Gutenberg adjust pdf settings
  6. Click Save or Update to save your changes.

Link to a PDF in WordPress 

  1. Open a post or page, put your cursor where you want to add the PDF link, and click Add Media.
    Click Add Media Button
  2. Click Select Files and navigate to the PDF file or document you want to link to.
    link-pdf-select-files
  3. In the Insert Media screen, make sure the PDF you want to link to is checked.
    link-pdf-insert-in-post
  4. In the Title field, enter the text you want to use for the PDF link.
  5. Make sure Media File is selected in the Link To field.
  6. Click Insert Into Post to add the PDF link.
  7. Your PDF link is inserted into the text.
    PDF link in text

Note: If you link to a MS Word .doc file or a an Excel file, it will not display in the user’s browser. It will download the file to the user’s device. Click here if you want to link to an MP3 file.

Workaround to add PDF links to Gutenberg Paragraph Blocks and List Blocks

This procedure requires that you get the PDF or File URL from the Media Manager and then add that URL to a link in a Gutenberg Paragraph or List block. This procedure works on Gutenberg Paragraph and List blocks.

  1. From the WordPress Admin screen, go to the Media and select the PDF you want to link to.
    The Attachment Details Screen is displayed.
    Attachment Details Screen Link to PDF in a Gutenberg Paragraph or List block
  2. Copy the PDF URL.
  3. Open a post or page and select the link text in the Paragraph or List block.
    Link to PDF in Gutenberg Paragraph or List Block 1
  4. Click the Link button and paste the PDF URL you copied in Step 2.
    add a link to the paragraph or list and paste the PDF URL that you copied into the link URL field. 2
  5. Click Link Settings.
    add a link to the paragraph or list and paste the PDF URL that you copied into the link URL field. 3
  6. Select Open in New Tab
  7. Click the Apply button to add the link.
    add a link to the paragraph or list and paste the PDF URL that you copied into the link URL field. 4
  8. The link is inserted in the text. If you click on the link, you can see the PDF URL.
    add a link to the paragraph or list and paste the PDF URL that you copied into the link URL field. 5
  9. Click Save or Update to save your changes.

Filed Under: Gutenberg, Wordpress How To 6 Comments

Previous Post: « Flexbox Justify-Content Doesn’t Work – Space Between or Space Around
Next Post: Add a Message at Top or Bottom of WooCommerce Checkout Page »

Reader Interactions

Comments

  1. Laura Rajsic-Lanier says

    December 15, 2018 at 4:50 pm

    This does not work with bulleted lists.

    When I change the blocks to a bulleted list, it makes it one block. So, the individual PDFs I’d normally link to with ease within a bulleted list now require me to upload the graphics, get the link to each, then manually put it in.

    For me, this is a massive disappointment as the post / page combos I did with the old WordPress took 30-45 minutes, I’m now well over 3 hours for the same post / page creation.

    As annoying as this is, the randomly eaten blank spaces in my text blocks is even worse.

    I would warn against upgrading to WordPress Gutenberg. I wish I hadn’t.

    Reply
    • taponitrof says

      December 16, 2018 at 10:52 am

      Hi Laura, I agree, there are some issue with Gutenberg that need to be worked out. Not being able to easily link to files from within a block is unacceptable. It’s the same issue for images: you can’t add them to a bulleted list.

      There are a couple things you can do to work around the PDF issue. 1. install the Classic Editor plugin. That allows you to continue to use the classic editor with WordPress 5.x / Gutenberg installed. Also, go to Settings > Writing and make Classic Editor the default editor and click “No” to Allow Users to Switch Editors. That way, you won’t even see the link to the Block editor in the page or post lists. 2. If you want to continue using the Block editor, you can link to pdf files by going to the Media manager and copying the pdf link. Then create a link in the list and paste the pdf url.

      Reply
      • john says

        August 2, 2019 at 2:52 pm

        Why should we have to go to all of that effort simply to have a capability that already existed. The WordPress developers and their management clearly don’t give a damn about their users!

        Reply
  2. john says

    August 2, 2019 at 2:48 pm

    Frankly the difficulties in linking to a pdf with the new Gutenberg version of WordPress are completely unacceptable. I would strongly discourage anyone from using WordPress given the complete insensitivity of WordPress to its users. This is absolutely unacceptable and we will be discontinuing all of their products. I am pissed!!

    Reply
  3. Chad says

    May 11, 2020 at 2:29 pm

    I have an alternative method I use to add media to lists. I simply create a classic block and do the list there, complete with an add media button. It sure seems like a large oversight not to add an “add media” button to the list and paragraph blocks. It’s a situation where “new” is not necessarily “improved.”

    Reply
  4. Mike says

    May 12, 2021 at 7:17 pm

    Thanks for your help. Happy still using the classic editor :)

    Reply

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related

Primary Sidebar

Blog Categories

Call Today

Get a Free Quote

303-907-6133

Subscribe to News

News about WordPress, WooCommerce, & Technology

What’s New

  • WPForms Not Sending Notifications
  • Add Terms and Conditions WooCommerce
  • Fix WordPress AMP Validation Errors
  • Use the Classic Editor with Gutenberg Block Editor
  • Add a Message at Top or Bottom of WooCommerce Checkout Page
  • How to Link to a PDF in WordPress

Find Us On…

  • Facebook
  • LinkedIn
  • RSS

Call 303-907-6133 Email

© 2004–2023 · WriteNowDesign · Sitemap · Log in · Return to Top

 

Loading Comments...