How to Increase Maximum Upload File Size in WordPress

There are 4 ways that you can choose to increase the maximum upload file size in WordPress.

1. Update .htaccess file

php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300

Change the numbers to the values that you need. The max execution time and max input time values are in seconds and might need to be increased further if your internet connection is slow.

2. Update wp-config.php file

@ini_set( 'upload_max_filesize' , '128M' );
@ini_set( 'post_max_size', '128M');
@ini_set( 'memory_limit', '256M' );
@ini_set( 'max_execution_time', '300' );
@ini_set( 'max_input_time', '300' );

3. Contact hosting provider

Reach over to the customer support of your hosting provider and ask them to increase these limits for you

4. Use plugin

https://import.wp-migration.com

62 Comments

  1. Mark Smerdon

    Hi Yani,
    After updating to the latest version and installing the extension for all in one wp migration, it says the maximum file size is 20MB.
    Is this an error in the latest version?

    1. Pim J. Iliev

      Hi Mark,

      In the latest version, file import has been re-added with limits imposed by your server using wp_max_upload_size(). You can check out how to increase the upload limit in the article.

    2. Gavin

      Hello, can I write the code in #3 anywhere in the wp-config.php file?

      Also, on a separate topic, when I updated my page, its contents disappeared. This is why I’m hoping the backup will work. Is this a common problem (page content disappearing after update)?

      1. Yani I

        Yes, you can write it anywhere, but it is good to be around WP_DEBUG statement.
        I have not seen the page content disappearing after update – you might want to report it to Gutenberg project if this is the editor you are using.

  2. Ken

    re: How to Increase Maximum Upload File Size in WordPress

    Are all 4 of the above required (and) or just one of the above (or)?

    Thanks

  3. CHARLES HEITZ

    I have the Google Drive extension which is supposed to include “Unlimited” file size. I’m now capped at 64MB. Why is this?

  4. Photron

    Is this a typo in item 2?
    `@ini_set( ‘upload_max_size’ , ‘128M’ );`

    Should it be this instead?
    `@ini_set( ‘upload_max_filesize’ , ‘128M’ );`

  5. Mark Dressel

    For the benefit of those struggling with upload limits……

    I recently found that new installs of All-in-one WP Migration were only allowing me a 2mb upload limit whilst previous installs on the same server allowed 520mb uploads.

    The solution to this was not to change any php upload limits but to install the plugin extension at https://import.wp-migration.com.

    Older versions of the migration plugin use a constant set in constants.php which overrides the maximum file limit to allow 520mb. For some reason the latest version of the migration plugin has this constant set but does not use it. The plugin extension restores the use of this constant and will save you a lot of time fiddling with php upload settings.

  6. Atje Patatje

    After updating to the latest version and installing the extension for all in one wp migration, it says the maximum file size is 50MB.

    I’ve added upload_max_filesize = 512M in .user.ini. When I load http://domein/info.php it says: upload_max_filesize 512M (local) | 50M (master). Local Value overrules de master value.

    So the settings are correct. Stil i’m getting the message maximum file size is 50MB.

  7. DeeBee

    Hey Yani, I’m trying to upload a websitefile size 234mb to a new hosting provider. Already spoken to them and they have increased my upload file size to 500mb however I keep getting the same error message, maximum file upload size 128mb.
    Is it something I have done wrong?.

    1. Yani I

      Most likely, the hosting did not properly increase the upload limit.
      They have to increase both upload_max_filesize and post_max_size for the page to show proper limit.
      You can also use the file extension that will set it up for you without having to do anything with the code.

  8. Lexi

    This is ridiculous. Surely the limit should be based on the upload_max_filesize, which for most hosts can go up to 1GB, but post_max_size is usually far lower, around 128mb. Which means that individual php.ini files need to be set, which requires me to either have access or walk someone less knowledgeable through the process.
    I often don’t have Cpanel access to the sites I’m transferring to as they’re for white label clients. Suddenly this plugin is unusable for such projects without their admin tinkering :/

  9. George

    Hi, Yani – hope you’re well.

    I’m on the same boat as Lexi.

    I’m in the process of building website templates and then giving customers the import file (.wpress) and a copy of the free All-in-One Migration plugin.

    I just tried to import the content to a blank WordPress site and it says upload limit is 2MB.

    I can’t require from 100ds of customers to buy the Unlimited Extension, just so they can import the website.

    Any chance you revert this specific function to the older version?

    I love your plugin btw.

    Thanks!

    George

  10. Sophie

    I own a web design agency and I create my clients’ website on my project center. I need to migration their website after it’s done. If I buy the Premium version, may I use it on all sites I have to migrate or is it just a 1-site licence?

    1. Pim J. Iliev

      Hi Sophie,

      Thank you for getting in touch.
      Could you contact us at support at servmask.com regarding the premium extension?

  11. Camilo

    Son increibles
    Tuve problema con el .htaccess y con el wp-config pero la extencion me solucionó el problema de limite de carga
    Son increibles, muchas gracias

  12. Asrar

    I want to install its extension but it gives the below message. But i did not install and the max size is only 8mb.

    Installing Plugin from uploaded file: all-in-one-wp-migration-file-extension (1).zip
    Unpacking the package…

    Installing the plugin…

    Destination folder already exists. /storage/ssd2/236/7773236/public_html/wp-content/plugins/all-in-one-wp-migration-file-extension/

    Plugin installation failed.

  13. Pawel

    Hi,
    I have updated .htaccess, wp-config.php file, tried php.ini and even changing line in plugins file. Upload limit is still 128MB.

    // =================
    // = Max File Size =
    // =================
    define( ‘AI1WM_MAX_FILE_SIZE’, 536870912 * 4 );

    Any solutions?
    Thanks

  14. Shketo

    Hey Yani,

    I was testing this plugin on a free host and the file upload was throttled to 10mb. I assumed this was due to the nature of the free hosting so attempted to use the plugin on my paid host, and the file upload is limited to 8mb!

    Is this a WP/Plugin error or do I need to contact my host?

    1. Pim J. Iliev

      Hi Shketo,

      Did you try to increase the upload limit or install the File Extension to allow uploading more than 8MB?

    1. Pim J. Iliev

      Hi Alex,

      How large is your backup?
      Which option did you use to increase the upload limit – by using the File Extension or manually adjusting the PHP settings?

  15. Chiranthana Mysore

    Hi, I have used the plugin earlier to download one of my file content which was around 650 mb, as my website was virus hit and everything almost infected, I am planning to upload earlier downladed file tentatively to check if everything is working fine,

    If there is any way can I upload 650 mb file and check if it works or not ?

    Thanks in Advance

  16. Daniel Grossman

    I successfully changed the file upload limit to 256mb but now I’m also getting the “100%” problem – it just hangs there. What can I do about this?

  17. Jochem

    Hi!

    My provider won’t allow higher upload than 96Mb, fixed in their php.ini file.
    Changing the htaccess is resulting in errrors.

    Will the paid version still fix this??
    I doubt…

    regards!

  18. Stig Ulfsby

    I have increased the maximum file size to 700 MB. I am uploading a file of 520 MB size. It started fine, but hangs on 25.92%. Do I also have to increase the max execution time?

    1. Pim J. Iliev

      Hi Stig,

      To import a 520 MB backup, you will have to modify the PHP settings as follows;
      upload_max_filesize 530M
      post_max_size 530M
      memory_limit 786M
      max_execution_time 1200
      max_input_time 1200

Leave A Comment?