In WordPress How to Change Maximum File Upload Size Limit for larger Attachment? cPanel, htaccess & wp-config.php Options • Crunchify

In WordPress How to Change Maximum File Upload Size Limit for larger A …

    Maximum upload size limit reached – This is the most common error message notification for new WordPress blogger. Is your WordPress maximum upload file size 2mb?

    I also, faced the same yesterday as I changed my WordPress PHP version to 7.1 and this setting got reset automatically. How to Increase the Maximum File Upload Size in WordPress now?

    Solution is very simple but sometimes takes time to figure out what to do. What is the best way to increase Maximum upload file size? In my opinion, changing setting using cPanel is the safest and fastest way to increase file size limit.

    Method-1 using cPanel?

    Step-1

    1. Login to cPanel
    2. Look for section Software
    3. Click on Select PHP version

    Step-2

    1. Make sure right PHP version is selected. I would suggest to use version 7.1.
    2. Click on Switch to PHP Options link.

    Step-3

    1. Look for an Option upload_max_filesize.
    2. Set value to 8M from dropdown.
    3. Click Save Button to save settings.

    Now next step is to verify if it’s working or not? Go to WordPress Admin -> Media -> Add New and you should see maximum size changed to 8MB.

    There are few more methods you could try if you want. Make sure to just use single method on your WordPress site.

    Method-2 .htaccess method

    php_value upload_max_filesize 8M
    php_value post_max_size 8M
    php_value max_execution_time 240
    php_value max_input_time 240

    Above code will change maximum upload size to 8MB. You could change it to any value like 32MB or 64MB as per your need. 240 (4 minutes) is a Timeout setting in seconds.

    Method-3 wp-config.php method

    Just put below code at the bottom of wp-config.php file

    define( ‘WP_MEMORY_LIMIT’, ‘8M’ );
    define( ‘WP_MAX_MEMORY_LIMIT’, ‘8M’ );
    ini_set( ‘memory_limit’, ‘8M’ );

    Let me know which method worked best for you.

    If you liked this article, then please share it on social media. Have a question or suggestion? Please leave a comment to start the discussion. 👋

    Share

    Xổ số miền Bắc