Increase WordPress upload file size limit

Have you tried to upload file, theme more than 8MB & it showed “The link you followed has expired.”? This is due to the upload file size limit in WP or your php.ini.

Here is how we can solve the problem in three ways. If one doesn’t work, try another one:

  1. Change .htaccess file:
    Go to root folder of your website. Find .htaccess file; if you can’t find, create one. Add the following code:

    php_value upload_max_filesize 64M
    php_value post_max_size 64M
    php_value max_execution_time 300
    php_value max_input_time 300
  2. Change php.ini file:
    Go to root folder of your website. Find php.ini file; if you can’t find, create one. Add the following code:

    upload_max_filesize = 64M
    post_max_size = 64M
    max_execution_time = 300
  3. Change functions.php file:
    Find this file from theme folder. Add the following code:

    @ini_set( 'upload_max_size' , '64M' );
    @ini_set( 'post_max_size', '64M');
    @ini_set( 'max_execution_time', '300' );

    Hopefully this will solve your problem.

Ref:

  1. wpbeginner.com
  2. wordpress.org

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.