DEV3 Technologies home

DEV3 Developer Forum

How do I increase the maximum upload file size in WordPress?

WordPress helpSolved0 views
dev3 ·

Media > Add New says "Maximum upload file size: 2 MB". I need 64 MB for a theme demo import and videos. Where do I change it?

#wordpress#php#upload

0

1 reply

dev3 · Accepted answer

The limit shown is the smallest of upload_max_filesize and post_max_size (and on multisite, a network setting). Raise both, plus related timeouts for large files.

php.ini / .user.ini

upload_max_filesize = 64M
post_max_size = 72M
max_execution_time = 300
max_input_time = 300
memory_limit = 256M

Keep post_max_size slightly larger than upload_max_filesize.

Apache mod_php in .htaccess:

php_value upload_max_filesize 64M
php_value post_max_size 72M

This causes a 500 error on PHP-FPM or CGI setups; use .user.ini there.

Nginx also has its own limit that returns "413 Request Entity Too Large":

server {
    client_max_body_size 72M;
}

Reload with sudo nginx -t && sudo systemctl reload nginx, then restart PHP-FPM.

Multisite: Network Admin > Settings > Network Settings > "Max upload file size" is a separate cap.

Check the result in Media > Add New or Site Health > Info > Server.

Pitfalls

  • Changing .htaccess has no effect when PHP runs as FPM.
  • Some hosts block overrides, so use their PHP selector.
  • A proxy or CDN may cap the request body too (Cloudflare free plans limit uploads to 100 MB).
  • For very large files, upload by SFTP and use a media-import plugin or wp media import file.mp4.
0

Your reply

Every post is reviewed by DEV3 before it appears. Usually reviewed within 24 hours.

Markdown supported. Use ``` for code blocks. Images are not allowed.