Skip to content

Instantly share code, notes, and snippets.

@dotherightthing
Last active August 15, 2019 03:04
Show Gist options
  • Save dotherightthing/c87dbf5abc99b237533a302298eb73f6 to your computer and use it in GitHub Desktop.
Save dotherightthing/c87dbf5abc99b237533a302298eb73f6 to your computer and use it in GitHub Desktop.
[Maximum Upload Size] Upload large images into the WordPress Media Library. #wordpress

Maximum Upload Size

Created: 2017.07.07

Upload warning

MacOS file picker.

I tried to upload a 2.9MB image.

WordPress file upload warning.

Maximum upload size: 1MB

When attempting to upload a 4MB photo into a local WordPress gallery, I receive the warning:

FILENAME exceeds the maximum upload size for this site

Possible solutions

Defining settings in Sublime Text Editor.

Changing PHP settings in functions.php.

MAMP Pro's PHP.ini for PHP 5.6.30.

MAMP Pro was already configured to allow uploads up to 32MB in size.

Several sites offer solutions, including editing PHP.ini, .htaccess and functions.php:

// functions.php
@ini_set( 'memory_limit' , '64M' );
@ini_set( 'upload_max_filesize' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

Multisite Network Settings

WordPress multisite Network Settings screen.

Configuring the max upload file size for a multisite installation.

However none of these worked for me. My site was running inside a multi-site installation, so after poking around, I found the control in Network Settings > Upload Settings (/wp-admin/network/settings.php):

Max upload file size: 1500KB

I changed this to 10000MB and uploaded the photo successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment