How to Change the WordPress Upload Limit
Five ways to raise the WordPress media upload limit. Pick the one that suits your server environment and hosting provider.
Check the current limit
The WordPress admin shows "Maximum upload file size" on Media → Add New, and the Info tab of Site Health lists the underlying PHP values. Out of the box, WordPress usually inherits a PHP limit somewhere between 2 MB and 10 MB.
The effective limit is the smallest of these three settings.
upload_max_filesize— the maximum size of a single filepost_max_size— the maximum size of the whole POST request; it must exceed upload_max_filesizememory_limit— the memory ceiling available to PHP
Method 1: edit wp-config.php
The quickest option: add this single line to wp-config.php in the WordPress root.
@ini_set('upload_max_filesize', '64M');
This has no effect if the host has disabled ini_set; in that case try another method. For something more dependable you can also use define as shown below.
define('WP_MEMORY_LIMIT', '256M');
That raises the WordPress memory ceiling but does not by itself change the upload limit. Combine it with one of the methods below.
Method 2: edit .htaccess (Apache)
On an Apache server running mod_php, add the following to .htaccess in the WordPress root.
php_value upload_max_filesize 64M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300
Note: where PHP runs as CGI or FastCGI — which covers most shared hosting — .htaccess cannot change PHP settings, so this method does not apply. If you get a 500 error, remove the lines you added.
Method 3: edit php.ini or .user.ini
Editing the PHP configuration directly is the most reliable way to change these values, provided you have the access to do it.
In php.ini
upload_max_filesize = 64M
post_max_size = 128M
memory_limit = 256M
max_execution_time = 300
max_input_time = 300
In .user.ini (for shared hosting)
If your host does not let you edit php.ini directly, create a .user.ini file in the WordPress root with the same contents. It can take minutes to hours to take effect.
upload_max_filesize = 64M
post_max_size = 128M
memory_limit = 256M
Method 4: add a filter in functions.php
Add a filter hook to the theme's functions.php. It helps when you cannot change PHP itself, but it can never exceed the server-side PHP settings.
@ini_set('upload_max_filesize', '64M');
@ini_set('post_max_size', '128M');
@ini_set('memory_limit', '256M');
@ini_set('max_execution_time', '300');
@ini_set('max_input_time', '300');
Alternatively, set the limit through a WordPress filter.
add_filter('upload_size_limit', function($size) {
return 64 * 1024 * 1024; // 64MB
});
Note: this only changes the WordPress-side limit. If PHP's own upload_max_filesize is smaller, PHP wins.
Method 5: change it in your host's control panel
Most Japanese hosting providers let you change PHP settings from their control panel. This is the safest and most dependable route.
Xserver
- Sign in to the server panel
- Choose PHP → php.ini settings
- Select the domain
- Open the php.ini settings tab
- Set
upload_max_filesizeandpost_max_sizeto the values you want - Click through the confirmation and apply the change
ConoHa WING
- Sign in to the control panel
- Site management → Site settings → Advanced settings
- Change
upload_max_filesizeunder PHP settings
Sakura Internet
- Sign in to the control panel
- Script settings → php.ini settings
- Change the values and save
Testing after the change
Once you have changed the settings, upload a genuinely large file and confirm the behaviour. DevLab's threshold test files let you test the exact boundary of the limit you configured.
| Test case | What to look for |
|---|---|
| A file below the limit (63 MB if you configured 64 MB) | It should upload without trouble |
| A file exactly at the limit (64 MB) | Confirm whether it succeeds or fails |
| A file over the limit (65 MB) | A clear error message should appear |
Troubleshooting
- The change does not take effect: you may need to restart the web server (Apache or Nginx) and the PHP process.
- You get a 500 error: check
.htaccessfor typos or directives the server does not support. - You get a 413 error: on Nginx, check
client_max_body_sizeas well — it lives innginx.conf. - Timeouts: large uploads also need higher
max_execution_timeandmax_input_time.