How to Increase the Maximum Upload File Size in WordPress
Seeing “the uploaded file exceeds the upload_max_filesize directive”? Learn where WordPress upload limits come from and how to raise them safely.
You try to upload a large photo, a video, a theme ZIP or a backup to WordPress, and it stops with an error such as “The uploaded file exceeds the upload_max_filesize directive in php.ini.” The limit comes from PHP, the language WordPress runs on, and you can raise it. The quickest way is the PHP settings in your hosting control panel. If you can't reach those, a small .user.ini file usually works. Below, we explain where the limit comes from, how to change it and what to do with very big files.
Where the upload limit comes from
Every upload passes through PHP. Four PHP settings decide how big a file it accepts and how long it waits:
| Setting | What it controls |
|---|---|
upload_max_filesize | The largest single file PHP will accept. |
post_max_size | The largest whole request, which is the file plus the rest of the form. |
memory_limit | How much memory one PHP process may use, for example while WordPress resizes an image. |
max_execution_time | How many seconds a PHP script may run before it is stopped. |
The first two work together. Because the file travels inside the request, post_max_size must be larger than upload_max_filesize. If you raise only upload_max_filesize, the smaller post_max_size still wins and the upload still fails. When a request is bigger than post_max_size, PHP throws the uploaded data away, so you may see a vague error or nothing at all. Also keep memory_limit larger than post_max_size.
The other two settings explain different failures. A large image can upload and then fail while WordPress makes its smaller copies, because PHP runs out of memory. A big ZIP or backup can also take longer to unpack than max_execution_time allows.
How to check your current limit
WordPress shows the limit in two places:
- Media > Add Media File (called Add New Media File or Add New in older versions). Below the upload box you will see “Maximum upload file size” with a number in MB. This is the effective limit: the smaller of
upload_max_filesizeandpost_max_size. - Tools > Site Health > Info. Open the Server section to see each value on its own: Upload max filesize, PHP post max size, PHP memory limit and PHP time limit.
Note the numbers so you can tell whether your change worked.
How to raise the limit
Try these methods in order. Change one thing at a time and check Site Health after each.
Method 1: Your hosting control panel
Most control panels let you change PHP settings per website, with no files to edit. On Plesk, open your domain and look for its PHP settings, which usually include all four values above. Set new values, save, and check Site Health again.
For example, for a site that handles photos and theme files:
upload_max_filesize = 64M
post_max_size = 80M
memory_limit = 256M
max_execution_time = 300Pick values that match your real files rather than the highest number allowed. If a field can't be changed, your plan sets a ceiling. Ask your host before you try workarounds.
Method 2: A .user.ini or php.ini file
If your panel has no PHP settings, a small text file often does the job. On most modern setups PHP runs as PHP-FPM or FastCGI, separate processes that handle PHP for the web server. These setups read a file called .user.ini in your site's main folder, the one that holds wp-config.php.
- Connect with your control panel's file manager or with SFTP (secure file transfer).
- Create or edit
.user.iniin the WordPress root folder. - Add the same four lines as in the example above and save.
- Wait a few minutes. PHP re-reads this file on a timer, five minutes by default, so new values do not always appear straight away.
Some older hosts read php.ini in the same place instead, with the same lines. If neither file changes the numbers in Site Health, use the control panel or ask your host.
Method 3: .htaccess, with a warning
Many guides suggest adding lines like these to .htaccess, the Apache web server's settings file:
php_value upload_max_filesize 64M
php_value post_max_size 80MThis only works when PHP runs as an Apache module, which is less common today. On PHP-FPM or FastCGI setups these lines cause a “500 Internal Server Error” and take your whole site down. If you try it, keep a copy of the original file and remove the lines at the first error.
A limit outside PHP: Cloudflare
If your site sits behind Cloudflare, every upload passes through it first. Cloudflare sets a maximum size for a single request: 100 MB on its Free and Pro plans and 200 MB on Business. A bigger upload is stopped before it reaches your server, with a “413 Request Entity Too Large” error, and raising PHP limits does not change that. Our CDN page explains how Cloudflare works with your site.
Better options for very large files
For really big files, a different route is often faster and kinder to your site.
Upload by SFTP, then import
Upload the file with SFTP, which does not go through your site's PHP settings. Theme and plugin folders can go straight into wp-content/themes or wp-content/plugins, unzipped. For media, an “add from server” import plugin can register the file in the Media Library, but check that it is still maintained. If your plan gives you command-line access, WP-CLI, the WordPress command-line tool, does the same job. Upload the file to a folder outside wp-content/uploads first, then run this with your own file path:
wp media import /path/to/wedding-01.jpgCompress images before upload
Take a photographer in Prizren uploading a wedding portfolio. Straight from the camera, each photo can be many megabytes. Exported at the width the site shows, as a compressed JPEG or WebP, each file shrinks to a fraction of that. It uploads without errors and loads faster for visitors.
Host videos elsewhere
Video files are large and use your storage and traffic. Upload them to a video platform and embed them in WordPress by pasting the link.
Upload limits on Zebra Hosting
On our WordPress hosting, you manage your site in Plesk. Large themes, plugins or backups can go up through its file manager instead of the WordPress uploader. Plans include one-click install, automatic updates and free SSL, with Cloudflare in front of every site. If a PHP value won't change, or you're not sure which limit is blocking you, contact our support team by ticket, email or phone, in 17 languages including Albanian.