Increase WordPress Upload Limit on BlueHost

import

I was moving a client’s site from an old host to an up-to-date WordPress install on Bluehost and I hit the upload limit.

On the old site, I used Tools > Export to get the content, which gave me a 10MB xml file. When I went to Tools > Import on the new site, it had a max of 2MB.

I found this post on how to increase the upload size with the .htaccess file, but it didn’t seem to work for me. But, it did lead me to the solution:

  • Log into your Bluehost Control Panel, and under Find type “PHP”. Click on “PHP Config”
  • Click the big button in the middle of the page that says “Install PHP.INI Master File”. That will add php.ini.default in your public_html folder
  • Open your html editor, connect to your server, and open php.ini.default. Copy all the contents, then make a new file called php.ini and paste it in there.
  • Search for the following variables and change them to these values:
    • memory_limit = 34
    • post_max_size = 33
    • upload_max_filesize = 32
    • max_execution_time = 600

That will increase your max file upload size to 32MB. If you’re just using this to import your content, I’d recommend deleting the php.ini file afterwards, resetting the upload limit back to the default.

Bill Erickson is a WordPress Consultant who builds custom websites using WordPress as a CMS and the Genesis framework. He contributes to the WordPress community through free themes, plugins, tutorials, and core patches. He's also a cofounder of the BIL Conference (the open analog to the TED Conference).

Looking for more great tutorials? See them all!

Comments

  1. Bill,
    When I tried to install wp-commerce on a client's site I got:
    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /home2/clientsite/public_html/wp-content/plugins/wp-e-commerce/merchants/paypal_pro.php on line 280

    I then used the instructions you provided here to create new php.ini file and changed limits. That worked and I was able to install wp-commerce.

    Then the next day when I tried to install the NextGEN Gallery plug-in I got this error:
    Fatal error: Allowed memory size of 35651584 bytes exhausted (tried to allocate 122880 bytes) in /home2/clientsite/public_html/wp-admin/menu-header.php on line 90

    Any suggestions?
    Thanks!

  2. kenny says:

    I'm using hostgator i doesn't work for me

  3. Juanl says:

    Hi, I want to expand the upload size in media, what should I do?

    thanks

  4. Keren says:

    Hi Bill,
    Thanks a lot for this info, it was really helpful and solved my problem.
    2 questions though:
    1. What’e wrong with leaving the new settings? (32M)
    2. Before I found your answer I was trying to upload the file to bluehost and just add the URL link to my post. I did upload the file using File Manager but I can’t actually do anything with it right now or at least I can’t find any link to it. Do you have any suggestion how to do that?
    Thanks,
    Keren.

    • Bill Erickson says:

      There’s nothing wrong with leaving the new settings (I have it set to 32M on my site) but I typically drop it down on client’s sites so they don’t upload very large files.

      I’m not sure what you’re doing in the second question. Did you upload the xml export file directly to the server? You should use WordPress’ import tool (Tools > Import ) so that the content will be added to the database. If you’re using this to move a large website you might want to take a look at my post How To Move Your WordPress Website which provides a better solution.

      • Keren says:

        I actually just wanted to upload a big video file to insert into a post.
        The import tool seems more for importing a complete blog or so..

        • Bill Erickson says:

          Ah, no worries. For video I highly recommend just uploading it to a 3rd party video hosting service like Vimeo or Youtube, then dropping a link to it in the post. WordPress will automatically convert it to the embedded video player. If you host your own videos you’ll need to find a video player plugin.

  5. Biron Phillips says:

    I followed your instructions above and i still have the cap on my upload limit. i was wondering if i just had to save the file after i changed it or somehow upload it to my website for the changes to take place.

  6. Curtis F says:

    Great! This worked like a charm. Thank you!

    Now using the wordTube plugin, I can host HD video technique playlists on my blog. I use Page Security by Contexture to restrict access to the techniques I only want my students to have access to.

  7. Great post, I’m trying to upload a 11mb audacity podcast I made to my WordPress site. The limit says 8mb. I uploaded it to blip tv and linked it to my WordPress site. It plays fine but I’m not getting the right rss feed to upload the podcast to itunes. I’m going to try this technique to upload my mp3 file to WordPress so I can have the rss feed. I will post back right after I try this, thanks

  8. Brian Lis says:

    fyi now with BlueHost after you create the php.ini.default file. You also have to change the post_max_size = file size also.

Speak Your Mind

*

If you'd like to include code in your post, please post it to http://gist.github.com and include a link.