How to Upload a File in WordPress (Easy Steps)
In this article
- Understanding the WordPress Media Library
- How to Upload a File in the Block Editor (Gutenberg)
- Using the Classic Editor to Upload Files
- Uploading Files Directly to the Media Library
- Uploading Large Files or Using FTP
- Common Problems and Solutions
- Comparing Upload Methods
- Safety and Best Practices
- Frequently Asked Questions
To upload a file in WordPress, go to your admin dashboard, open Posts or Pages, and click the “Add Media” button in the editor to upload images, documents, or other files. You can also upload files directly through the Media Library or via FTP for larger files.
Understanding the WordPress Media Library
The Media Library is your central hub for managing all files you upload to your WordPress site. It stores images, PDFs, videos, audio, and other documents. When you upload a file through the editor, it appears in the Media Library, where you can view, edit, delete, or reuse it in other posts or pages. The library also lets you filter files by type (images, documents, audio, video) and search by filename or date.
How to Upload a File in the Block Editor (Gutenberg)
If you’re using the default block editor (introduced in WordPress 5.0), follow these steps:
- Open the post or page where you want to add the file.
- Click the “+” icon to add a new block.
- Choose the appropriate block: “Image,” “File,” “Video,” “Audio,” or “Cover” for media.
- Click the “Upload” button in the block toolbar and select the file from your computer.
- Alternatively, drag and drop the file directly onto the editor.
Once uploaded, you can adjust settings like alignment, size, and caption. For a file block, you can also set the link text and choose whether to open the file in a new tab.
Using the Classic Editor to Upload Files
If you still use the Classic Editor plugin (or the classic editor view), the process is slightly different:
- Click “Add Media” above the editing area.
- In the popup window, click “Upload Files” tab.
- Drag and drop your file or click “Select Files” to browse.
- After uploading, you can attach it to the post by clicking “Insert into post.”
The Classic Editor also allows you to set the file’s title, caption, and alignment before inserting.
Uploading Files Directly to the Media Library
You can upload files without creating a post first. Go to Media → Add New in the dashboard. Drag and drop files onto the page or click “Select Files.” This is useful when you want to store files for later use or if you need the file’s URL for a custom link.
Uploading Large Files or Using FTP
WordPress has a default file size limit (often 2 MB for images, but varies by host). For larger files, you have options:
- Increase the upload limit by editing the
php.inifile or adding code towp-config.php(consult your host’s support). - Use FTP (File Transfer Protocol) to upload files directly to the
wp-content/uploads/folder. You can do this with a client like FileZilla. After uploading via FTP, the file will appear in the Media Library if you go to Media → Library and click “Add New” (it may not show automatically, but you can use a plugin like “Add From Server”).
FTP is also helpful when uploading many files at once or when the web interface times out.
Common Problems and Solutions
Here are typical issues you might face and how to fix them:
- “The uploaded file exceeds the upload_max_filesize” – This means your file is too big. Increase the PHP upload limits or compress the file.
- HTTP error during upload – Often caused by a server issue or a plugin conflict. Try disabling plugins temporarily or increasing memory limit.
- File not showing in Media Library – If you uploaded via FTP, you may need to install a plugin like “Media from FTP” to scan and register the files.
- Permission denied – Check that the
wp-content/uploadsfolder has the correct file permissions (usually 755 for folders, 644 for files).
Comparing Upload Methods
There are three main ways to upload files in WordPress:
- Editor upload – Best for adding files directly to a post or page. It’s the most intuitive for beginners.
- Media Library upload – Good for uploading files you plan to use later or want to manage centrally.
- FTP upload – Ideal for bulk uploads, very large files, or when the web interface fails. It’s more technical but gives you full control.
For most everyday tasks, the editor or Media Library is sufficient. FTP is a fallback for power users.
Safety and Best Practices
Before uploading files, consider these safety tips:
- Scan files with antivirus software, especially if they come from other users.
- Use secure file types (like PDF, JPG, PNG, MP4) to avoid security risks. Avoid uploading executable files (.exe) or scripts unless absolutely necessary.
- Keep your WordPress, plugins, and themes updated to prevent vulnerabilities.
- Back up your site regularly, including the uploads folder, to avoid data loss.
Frequently Asked Questions
How do I upload a PDF in WordPress?
You can upload a PDF just like any image or document. In the block editor, add a “File” block, click “Upload,” and select your PDF. The file will be hosted on your site, and visitors can download it by clicking the link.
Why can’t I upload a file in WordPress?
Common reasons include file size exceeding the server limit, incorrect file permissions, or a plugin conflict. Check the error message, increase PHP limits, and try disabling plugins to isolate the issue.
Can I upload a video to WordPress?
Yes, you can upload video files (like MP4) through the Media Library or editor. However, large videos may slow your site. Consider using a video hosting service like YouTube or Vimeo and embed the video instead.
How do I increase the upload file size in WordPress?
You can increase the upload limit by editing the php.ini file (set upload_max_filesize and post_max_size), or by adding a snippet to your theme’s functions.php file. Many hosts also allow you to change this via their control panel.
Where are uploaded files stored in WordPress?
All uploads are stored in the wp-content/uploads directory, organized by year and month (e.g., wp-content/uploads/2025/03/). You can access them via FTP or your hosting file manager.