Blogging & content · Guide
How to Add a Link to a PDF in WordPress (Step by Step)

Short answer
Upload the PDF to the Media Library and copy its file URL. Then highlight text in the block editor, click the link icon and paste the address, or add a File block that shows the document with a download button.
Key takeaways
- Every uploaded PDF gets its own address in wp-content/uploads.
- Copy the File URL, not the attachment page address.
- The File block adds a download button and an optional inline preview.
- Add (PDF) to link text so readers know a document will open.
- Use a replace-media plugin to update a PDF without breaking links.
How do you add a link to a PDF in WordPress?
Upload the PDF to the Media Library, copy its file URL, then highlight text in the editor, click the link icon and paste that URL; you can also use the File block.
A PDF in WordPress is just a file with its own address. Once it is uploaded, any link pointing to that address opens or downloads the document.
There are three common methods. Pick the one that fits how you want the PDF to appear on the page.
| Method | Best for | What visitors see |
|---|---|---|
| Text link | A PDF mentioned inside a sentence | Normal linked words |
| File block | A clear download area | File name plus optional download button |
| Button block | A strong call to action | A styled button |
| Embed plugin | Reading the PDF on the page | A viewer inside the page |
Step 1: Upload the PDF to the Media Library
Go to Media > Add New Media File (or Add New), drag the PDF into the upload area and wait for it to finish.
Give the file a clear name before uploading, such as price-list-2026.pdf. WordPress uses the file name in the address, so a tidy name makes a tidy link.
If the upload fails because the file is too large, your server limit is too low. Our guide on fixing the upload_max_filesize error explains how to raise it.
Compress very large PDFs before uploading. Smaller files open faster, especially on phones.
Most PDF editors have a reduce file size or optimize option. Image-heavy brochures often shrink a lot without visible loss.
Also check the document itself. Add a title in the PDF properties, since some browsers show it in the tab, and search engines can use it in results.
Step 2: Copy the PDF's file URL
Open the PDF in the Media Library and click Copy URL to clipboard, or copy the address shown in the File URL field.
In grid view, click the file to open the attachment details. In list view, hover over the file and click Copy URL.
The address usually looks like your domain followed by /wp-content/uploads/ and the year and month. That is the direct link to the document.
Do not copy the attachment page address by mistake. That page is a separate WordPress page about the file, not the file itself.
Developers can get the same address in code. The wp_get_attachment_url() function returns the direct file URL for any attachment ID, which is handy in templates.
Newer WordPress versions turn attachment pages off by default on fresh installs. Older sites may still have them, so double-check which address you copied.
Step 3: Link text to the PDF
In the block editor, highlight the words you want to link, click the link icon or press Ctrl+K (Cmd+K on Mac), paste the PDF URL and press Enter.
You can also type part of the file's title into the link box. WordPress searches your site and often lists media files, so you may not need to copy the URL at all.
Use descriptive link text such as download the 2026 price list (PDF). Words like click here do not tell readers or screen readers where the link goes.
The W3C guidance on link purpose explains why clear link text matters for accessibility. Adding (PDF) also warns people that a document, not a web page, will open.
The same link tool works for pages and posts too. Our guide on adding internal links shows how to search for and link your own content.
Step 4: Use the File block for a download area
Add a File block, choose your PDF from the Media Library or upload it, and WordPress shows the file name with an optional download button.
Type /file in a new line to add the block quickly. Click Media Library to pick an existing PDF, or Upload to add a new one.
The block settings let you show or hide the download button and choose whether the link opens the file or the attachment page. You can also turn on an inline embed that displays the PDF on the page in supported browsers.
The File block documentation describes each setting. The embed preview depends on the visitor's browser, so some phones show only the link.
Step 5: Link a button or image to the PDF
Add a Button block, type the label, click the link icon on the button toolbar and paste the PDF URL.
Buttons work well for menus, brochures and forms people must download. Keep the label short and specific, such as Download menu (PDF).
Place the button close to the text that describes the document. People should know what they are getting before they click.
If you offer several PDFs, use a short list of text links instead of a stack of buttons. A wall of identical buttons is hard to scan.
To link an image instead, select the Image block, click the link icon, choose Link to a custom URL and paste the PDF address.
You can also add a PDF to your navigation menu as a custom link. Our guide on linking pages in a menu shows how custom links work.
Should the PDF open in a new tab?
Opening PDFs in a new tab is optional; it keeps your page open behind the document, but some users find unexpected new tabs confusing, so mention it in the link text if you do.
In the link popover, toggle Open in new tab. WordPress adds the right attributes automatically.
If you want the file to download instead of opening, add the HTML download attribute. Switch the block to Edit as HTML and add it to the link tag:
<a href="/wp-content/uploads/2026/01/price-list.pdf" download>Download the price list (PDF)</a>
Browsers do not always honour this attribute, especially for files on another domain. The MDN anchor element reference explains how it behaves.
How do you show a PDF inside the page?
Use the File block's inline embed option or a PDF viewer plugin such as PDF Embedder or PDF Embed Block to display the document on the page.
Embedding is useful for menus, magazines and reports that people read rather than save. Plugins give a consistent viewer across browsers, with page navigation and zoom.
Check the plugin page on WordPress.org, for example PDF Embedder, for its current features and update history before installing.
Always keep a plain download link too. Embedded viewers can be awkward on small screens.
Large embedded PDFs also slow the page down. If the document is long, link to it instead and keep the page light.
How do you replace a PDF without breaking links?
Upload the new version with the same file name only if you remove the old one first, or use a replace-media plugin so the URL stays the same.
If you simply upload a new file with the same name, WordPress adds a number to the end, such as price-list-1.pdf. Every old link still points to the old file.
A replace plugin swaps the file but keeps the address. Our guide on replacing a media file covers the options.
After replacing, clear any caching plugin or CDN cache. Otherwise some visitors may still get the old document for a while.
What are common PDF link problems?
The usual problems are a 404 after a site move, a link to the attachment page instead of the file, or a browser downloading a file you wanted to open.
Quick checks:
- Open the link in a private window to see what visitors get.
- Make sure the URL ends in .pdf, not a page slug.
- After a domain change, update old links with a search-replace tool.
- Scan for dead links regularly with a link checker.
Our guide on finding broken links shows tools that flag PDFs that no longer exist.
Search engines can index PDFs too. If a document should stay private, do not upload it to a public page, since anyone with the address can open it.
Frequently asked questions
Where do I find the URL of a PDF in WordPress?
Open Media in the dashboard, click the PDF to open its details and copy the File URL field, or click the Copy URL to clipboard button. The address points to the file inside the uploads folder.
How do I make a PDF download instead of open?
Add the HTML download attribute to the link tag using the block's Edit as HTML option. Browsers decide whether to honour it, and many still open PDFs in a built-in viewer, so it is not guaranteed.
Can I link a PDF in a WordPress menu?
Yes. Copy the PDF's file URL, add a custom link to your menu or Navigation block, paste the address and give it a clear label such as Menu PDF. Save the menu and test the link.
Why does my PDF link show a 404 error?
The file may have been deleted, renamed or left behind after a site move. Check the address in the Media Library, update the link with the current file URL and replace old domain links if the site moved.
Do I need a plugin to show a PDF on a page?
No. The File block can embed a PDF preview in supported browsers. A viewer plugin gives a more consistent display with page controls and zoom, which helps on phones and older browsers.
Sources
- File block WordPress.org Documentation
- <a>: The Anchor element MDN Web Docs
- Understanding Link Purpose (In Context) W3C
- PDF Embedder WordPress.org Plugins
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


