• I’m trying to increase the Maximum upload file size on some of my accounts. I notice that some have a default of 2MB, others have 8MB and one even has a default of 64MB. I’ve read all the posts about changing the php.ini and I’ve tried all of it but nothing has worked.
    So can someone provide a definitive answer on this subject of how to increase the Maximum upload file size?

Viewing 14 replies - 1 through 14 (of 14 total)
  • There doesn’t seem to be one solution that works for all sites/themes. This topic discusses some options:

    https://www.ads-software.com/support/topic/error-saving-media-attachment-when-file-size-is-over-2mb?replies=5

    A Google search for ‘wordpress max upload file size’ will find other option.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    It’s not a theme setting, nor a WordPress one (unless you’re on MultiSite). It’s your server. You may need to ask your webhost.

    If you make a phpinfo() page, you can scan for max upload size and see what it’s set to on your server.

    Thread Starter mjefferson96

    (@mjefferson96)

    Do you have instructions on how to do that? I would love to know.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Thread Starter mjefferson96

    (@mjefferson96)

    ok I can see the info now, but still changing and or appending the the php.ini did not change anything. what to try next?

    Thread Starter mjefferson96

    (@mjefferson96)

    I just looked at the phpinfo on another wordpress site and it says 8max but wordpress upload says 2max. hmmmmm? whats up with that?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Ask your host. There’s more than JUST the phpinfo() to check.

    There’s a simpler solution that will work for any host because you’re not messing with php.ini or .htaccess. I know this post is outdated, but I was looking and looking, and I figured out this, which works perfectly.

    open wp-admin/includes/template.php
    find the function wp_max_upload_size()
    alter it (I copied, then commented out the existing) like this:

    function wp_max_upload_size() {
    $u_bytes = wp_convert_hr_to_bytes( ‘1000MB’ );
    $p_bytes = wp_convert_hr_to_bytes( ‘1000MB’ );
    $bytes = apply_filters( ‘upload_size_limit’, min($u_bytes, $p_bytes), $u_bytes, $p_bytes );
    return $bytes;
    }

    That’s for a 1 gb file size. You can make it any size here.

    open wp-admin/includes/template.php

    No! Never edit WordPress core files.

    is that a copyright issue? I was just testing this out pre-production…

    Well I just read the license agreement and with a comment, it does not violate any terms.
    I should say that you should know some php if you’re going to screw with this. This is my workaround to ftp uploads and side-loading links, and I’m going to use it, because I have people that need to upload that don’t understand an html link tag.

    is that a copyright issue?

    No but if you edit core code then, at best, you’re going to have to replace that hack every time you upgrade. At worst, you’ll bring your entire site down or severely comprise overall site security.

    I actually found that this doesn’t entirely solve the problem.
    For example, I uploaded my site to godaddy and found that it spouted html errors and said it was ‘crushing’ files over 32mb, when the uploader worked fine with those settings locally. I tried media files of a lot of different sizes and found that godaddy’s limit appears to be 32mb. I don’t know about any other hosting at this point

    TLDR;
    You still have to talk to your hosting if you want very large files or videos to be uploaded.

    A simple example in .htaccess file

    <IfModule mod_php5.c>
    php_value post_max_size           10M
    php_value upload_max_filesize     40M
    php_value memory_limit            500M
    </IfModule>
Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Maximum upload file size’ is closed to new replies.