How Do You Add a File to WordPress?
Upload and attach WordPress files with fewer mistakes.
Understand the WordPress Media Library
The Media Library stores files that you upload to WordPress. It holds images, PDFs, documents, audio, and video.
To learn how to add a file to WordPress, start in the WordPress Dashboard. Select Media, then open Library. You can view uploads in grid or list mode.
Each item has a file name, type, size, upload date, and URL. You can change its title, caption, or description. The original file stays in place.
- Search by file name.
- Filter files by month or type.
- Copy a file URL for a direct link.
- Open an item to edit its details.
WordPress does not show every upload as a normal folder. It stores files in the uploads area. The Media Library gives you the safest way to manage them.
See the official WordPress Media Library documentation for screen details.
Upload a File From a Post or Page
The post editor offers the quickest way to upload a file. Sign in to your Dashboard. Open Posts or Pages. Then create a new item or edit an existing one.
Place the cursor where the file should appear. In the block editor, select the plus button. Search for the File block. Older editors may show an Add Media button instead.

Here is how to upload file to WordPress with the File block:
- Open the post or page editor.
- Place the cursor at the needed spot.
- Select the plus button and choose File.
- Select Upload in the block settings.
- Choose a file from your computer.
- Wait until the upload finishes.
You can also drag a file into the upload window. This method works well for PDFs and small documents. Keep the editor open until the upload ends.
WordPress may block a file type that your site does not allow. Common types include PDF, DOCX, ZIP, JPG, PNG, and MP4. Your host or security plugin may set a smaller size limit.
Attach and Link the File in Your Content
After the upload, WordPress adds a file block to your content. Visitors can select the file name or download button. You can change the button label before publishing.
To learn how to attach a file in WordPress, use the File block. It keeps the file tied to the page content. It also makes later edits easier.
Fill in the title field with a clear label. Use “Product setup guide” instead of “document-final-2.pdf.” A useful label tells visitors what they will open.

- Use plain words for the link label.
- Choose whether the link opens in a new tab.
- Show or hide the download button.
- State the file type and size when useful.
You can link file in WordPress with a normal text link. Select the words that should become the link. Click the link icon, then paste the file URL.
Use descriptive words such as “Download the event form.” Avoid “click here.” Clear links help visitors scan the page.
Preview the page before publishing. Test the link in a private browser window. This catches broken URLs and access problems.
Protect Uploaded Files
Public Media Library files usually have a direct URL. Anyone with that URL may open the file. Do not use a public upload for private records or paid downloads.
For sensitive files, use a membership tool or a download tool with access checks. Store the file outside the public uploads path when your host supports that setup. Check the tool’s rules before publishing.
File permissions control who can read or change files on the server. Ask your host for help before changing them. A wrong setting can block your site or expose files.

The WordPress hardening guidance covers safer site settings. Keep WordPress, themes, and plugins up to date. Also limit admin access to trusted users.
Related WordPress File Tasks
Some searches mention files outside the Media Library. For example, what is htaccess file in wordpress? It is a server rules file that can guide redirects and access rules.
To find the htaccess file in wordpress, check the site root with a host file tool. It may be hidden. Never edit it without a backup.
Searchers may ask how to create an htaccess file for wordpress. They may also ask how to edit htaccess file in wordpress, how to edit htaccess file wordpress, or how to edit htaccess in wordpress. These tasks need host access and care.
The same applies to how to modify htaccess file for wordpress. For theme work, how to find style css file in wordpress usually means opening the active theme folder. The header file is often named header.php, which answers where is the header file in wordpress.
Converting a design needs a separate build. Searches such as how to convert psd file to wordpress theme and how to convert psd to wordpress describe that work. They do not describe a normal Media Library upload.
Manage Files With Care
Good file management saves time as your site grows. Use simple names before uploading. Lowercase names with hyphens work well, such as employee-handbook.pdf.
Do not upload many files with unclear names. WordPress may add numbers to duplicate names. That makes later searches harder.
| Task | Recommended approach |
|---|---|
| File name | Use short words and hyphens |
| Title | Describe the file for visitors |
| Format | Choose a common type when possible |
| File size | Compress large files first |
| Old versions | Check links before removal |
Keep file sizes small when quality allows. Large files slow downloads and use more storage. A smaller PDF often gives visitors a better experience.
Review the Media Library each month. Remove unused files only after checking your pages. Deleting a file can break links that still use its URL.
Fix Common Upload Problems
A failed upload often comes from file size or type limits. Check the file size first. Then ask your host whether the site allows that format.
A missing file link may point to an old URL. Open the item in the Media Library. Copy its current URL and replace the broken link.
If visitors see an access error, check the file permissions and protection tool. Test the link while signed out. This shows what normal visitors can reach.
- Rename files with simple letters and hyphens.
- Reduce large PDFs or videos before upload.
- Confirm the upload reached the Media Library.
- Test links on both desktop and mobile screens.
Step-by-step
- 01 Open the editor
Sign in to the WordPress Dashboard. Open a post or page, then place the cursor where the file should appear.
- 02 Add a File block
Select the plus button and choose File. Older editors may use the Add Media button.
- 03 Upload the file
Choose Upload, select a file from your computer, and wait for the upload to finish.
- 04 Set the file details
Add a clear title and choose the link or download settings. Use a useful label for visitors.
- 05 Test the link
Preview the page and open the file while signed out. Fix any broken link or access issue before publishing.
Frequently asked questions
- How do I add a file to WordPress?
- Open a post or page, add a File block, and choose Upload. Select the file from your computer, then publish or update the page.
- How do I attach a file in WordPress?
- Use the File block in the editor. It uploads the file and adds a link or download button to your content.
- How do I link a file in WordPress?
- Copy the file URL from the Media Library. Select link words in the editor, then paste the URL.
- Why can’t WordPress upload my file?
- The file may exceed the size limit or use a blocked format. Check your host settings and rename the file with simple characters.
- How can I protect uploaded WordPress files?
- Use a membership or download tool with access checks. Do not place private files in a public upload folder.
Related reading
How to Build a Website With WordPress
Build and launch a WordPress site with simple steps.
How Do You Edit a Slider in WordPress?
Edit WordPress slider images, text, links, and settings with confidence.
How Do I Add Google Analytics to WordPress?
Set up GA4 on WordPress, verify tracking, and fix common errors.