Setup & site building · Guide
How to Add a Document to WordPress (PDF, Word and Google Docs)

Short answer
To add a document to WordPress, open the page in the block editor, insert a File block, and upload your PDF or Word file or pick it from the Media Library. The File block shows a download link and, for PDFs, can display an inline viewer. You can also link to the file from any text, or embed a published Google Doc.
Key takeaways
- The File block uploads a document and adds a download link.
- PDFs can show an inline viewer through the File block settings.
- Documents are stored in the Media Library like images.
- Upload limits and allowed file types depend on your host and WordPress.
- Make documents accessible and add a clear description of what they contain.
How do you add a document with the File block?
Insert a File block, click Upload or Media Library, choose your PDF, Word, Excel or other document, and WordPress adds a link with the file name plus an optional download button.
The WordPress documentation for the File block explains each setting.
You can rename the link text to something clearer than the file name.
The download button can be turned off if you only want a text link, or kept for a clearer call to action.
Update or publish the page, then test the link on the front end.
Open the link in a private window to make sure visitors can reach the file without being logged in.
How do you show a PDF on the page?
Select the File block with a PDF, turn on Show inline embed in the block settings, and set the viewer height; supported browsers then display the PDF directly on the page.
Some mobile browsers do not show inline PDFs. Keep the download link visible as a fallback.
Test the page on a phone to see which experience mobile visitors actually get.
Keep the viewer height sensible. A very tall viewer pushes the rest of the page far down on small screens.
Large PDFs load slowly inside the page. Compress them before uploading.
Splitting a long manual into chapters also makes each file faster to open.
For many PDFs on one site, a dedicated PDF viewer plugin offers more control over the viewer.
Can you add a document as a text link?
Yes. Select text in any block, click the link icon, then upload or choose the file from the Media Library and link to it.
Link text should describe the document, such as Download the 2026 price list.
Avoid using the raw file name as link text, since names like final-v3-edited.pdf mean nothing to visitors.
Mention the file type and size near the link, so visitors know what to expect.
For example, a short note such as PDF, 2 MB, helps people on mobile data decide when to download.
Our guide on creating a button in WordPress shows how to make a document link stand out.
Which file types can you upload?
WordPress allows common documents such as PDF, Word, Excel, PowerPoint and OpenDocument files by default, and blocks unusual or risky types for security.
If a file type is rejected, convert it to a common format, usually PDF.
PDF also keeps formatting the same on every device, which Word files do not always do.
Developers can allow extra types with the upload_mimes filter, but only add types you trust.
Multisite networks have their own list of allowed upload types in the network settings.
Never allow executable files. They can be used to attack your site or visitors.
Even allowed types can carry risks, so only upload files from sources you trust.
Why won't your document upload?
The usual reasons are a file larger than the upload limit, a file type WordPress blocks, or a server timeout on slow connections.
Media > Add New shows your site's maximum upload size.
If the limit is very small, you can upload large files by SFTP to the uploads folder, though they will not appear in the Media Library automatically.
The PHP manual explains the upload_max_filesize setting that sets the limit; your host can raise it.
Compressing the PDF often solves size problems without changing server settings.
Most PDF tools have a reduce file size option that keeps text sharp while shrinking images.
How do you embed a Google Doc?
Publish the document to the web from Google Docs, copy the embed code it gives you, and paste it into a Custom HTML block on your page.
Google's help page on how to publish a file to the web explains the publishing steps.
Our guide on adding HTML in WordPress covers the Custom HTML block.
Set the embed width to 100 percent so the document fits narrow screens.
Published documents update when you edit them in Google Docs, which suits documents that change often.
Remember that anyone can see a published document, so do not publish files that contain private information.
Where are uploaded documents stored?
Documents are stored in the Media Library and in the uploads folder on your server, just like images, so you can reuse, replace or delete them from Media > Library.
Use the Media Library filter to show only documents.
You can also add a title and description to each document in the Media Library, which helps when searching later.
Give files clear names before uploading, since the file name becomes part of the URL and appears in downloads.
Replacing a document with a new upload creates a new URL. Update links on pages that use the old one.
Delete outdated documents to avoid visitors finding old versions in search.
Keep a short list of which pages link to each important document, so updates are quick.
Can you keep the same URL when updating a document?
Not with core WordPress, which gives each upload its own address; a media replace plugin can swap the file while keeping the same URL.
This matters for documents linked from emails or other sites.
Test the replaced file afterwards and clear caches, since browsers and CDNs may keep the old version for a while.
Can search engines find your documents?
Yes. Google can index PDFs and some other document types, so they can appear in search results and send visitors straight to the file.
Google lists the file types it can index.
Give PDFs a clear title in their document properties, because search results may show it.
Add the PDF to your site's internal links from relevant pages, so search engines and visitors can find it.
If you prefer visitors to land on a web page, put the key content on the page and offer the PDF as an extra.
A web page can be updated, linked and measured more easily than a PDF, so it is usually better for important content.
How do you make documents accessible?
Create documents with real headings, alt text for images and a logical reading order, export accessible PDFs, and summarise the key points on the web page too.
Scanned PDFs without text cannot be read by screen readers.
Run text recognition on scanned documents, or provide a text version alongside them.
Our guide on making WordPress accessible covers the wider basics.
Check colour contrast and font sizes inside the document too, not just on the web page.
HTML pages are usually easier to read on phones than PDFs, so avoid putting essential information only in a document.
Can you restrict who downloads documents?
Core WordPress files are public to anyone with the link, so use a membership or download manager plugin when documents should only be available to logged-in users or customers.
Password-protected pages hide the link, but the file URL itself remains public.
Anyone who shares the direct link can still pass the file on, so treat uploads as public by default.
For sensitive files, use a plugin that stores them outside the public uploads folder.
Never upload documents containing passwords, personal records or payment details to a public page.
How do you track document downloads?
Use an analytics tool that records outbound and file link clicks, or a download manager plugin with built-in counts.
Many analytics setups track file downloads as events automatically.
Check your analytics settings to confirm document clicks are recorded before relying on the numbers.
Tracking shows which documents are useful and which can be retired.
Review the numbers every few months and update or remove documents that nobody opens.
Popular documents may deserve their own web page, which is easier to read and better for search.
Frequently asked questions
How do I upload a PDF to WordPress?
Insert a File block on a page, click Upload and choose the PDF, or add it in Media, then Add New and link to it from any text.
How do I display a PDF on a WordPress page?
Add the PDF with a File block and turn on Show inline embed in its settings. Supported browsers show the PDF directly on the page.
Why can't I upload a document to WordPress?
The file may exceed the upload size limit, be a blocked file type, or time out. Compress it, convert it to PDF, or ask your host to raise limits.
Can I embed a Google Doc in WordPress?
Yes. Publish the document to the web in Google Docs, copy the embed code and paste it into a Custom HTML block.
Are uploaded documents private?
No. Anyone with the file link can open it. Use a membership or download manager plugin to restrict documents to certain users.
Sources
- File block WordPress.org Documentation
- upload_mimes WordPress Developer Resources
- upload_max_filesize PHP Manual
- Publish a file Google Docs Editors Help
- File types indexable by Google Google Search Central
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.


