Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Upload Large Images in WordPress

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Recently, one of our users asked us how they can upload large images in WordPress.

Many users see an error when trying to upload larger images in WordPress. This is due to the file size limit.

In this article, we will show you how to fix this and upload large images in WordPress.

Large File Size Error

Why You Cannot Upload Large Images in WordPress?

Your WordPress hosting provider may have configured their servers in a way that place a reasonable limit on file upload sizes.

You can see this limit by visiting Media » Add New page.

maximum upload file size in WordPress

If the limit is lower than the file you are trying to upload, then you will see an error like this: ‘ filename.jpg exceeds the maximum upload size for this site’.

Another issue which may stop you from uploading large image files is memory limit.

By default, your WordPress site is allowed to use a reasonable amount of memory. When a script runs for too long and exhausts the defined memory limit, then you will see an error.

If you’re encountering either of these errors, then this article will help you fix that so you can easily upload large files to WordPress.

Fixing Image Upload Size in WordPress

If you want to upload large image and media files in WordPress, then here is how you will fix image upload size issue in WordPress.

This method requires you to add code in WordPress. If you haven’t done that before, see this guide on how to paste snippets in WordPress.

Simply add this code in your theme’s functions.php file or in a code snippets plugin.

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

We recommend adding this code using WPCode, the best WordPress code snippets plugin. It makes it safe and easy to add code in WordPress, without editing your theme’s functions.php file.

WPCode

To get started, you need to install and activate the free WPCode plugin. For instructions, see this tutorial on how to install a WordPress plugin.

Once the plugin is activated, go to the Code Snippets » + Add Snippet page from your WordPress dashboard.

From there, click the ‘Use Snippet’ button under the ‘Add Your Custom Code (New Snippet)’ option.

Add a new custom code snippet in WPCode

Next, add a title for your code and paste the code snippet from above into the ‘Code Preview’ box. Don’t forget to select ‘PHP Snippet’ as the code type from the dropdown menu on the right side of the screen.

Paste code snippet into WPCode plugin

Finally, simply switch the toggle from ‘Inactive’ to ‘Active’ and click the ‘Save Snippet’ button.

Activate and save your custom code snippet

This code tries to increase upload maximum filesize, post maximum size, and maximum execution time limits for your WordPress site. However, this may not work for some WordPress websites.

In that case, you can try adding this code to your .htaccess file in your site’s root folder.

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

If both of these methods fail, then you can try adjusting these values using php.ini file.

The php.ini file is a configuration file used by PHP to define settings. Users on shared hosting, typically don’t have access to the main file. However, you can still create an empty php.ini in your site’s root folder using an FTP client.

Creating a new file using FTP

Simply add this code in your php.ini file:

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

Take a look at our guide on how to increase maximum file upload size in WordPress for more information.

Do You Really Need to Upload Large Image Files in WordPress?

Images take more time to load than text. This means that if you have large images files, then it would take longer for your website to load.

Search engines don’t like slow websites, and your pages with huge images may not rank high in search results. This would cost you traffic and affect your business goals.

We understand many photography site owners may want to upload high quality images to their site. However, high quality images can be optimized to have reasonable file sizes without losing too much quality.

First we would recommend you to learn how to optimize images for web. You can reduce image file size without having to compromise on quality. You can also bulk resize images from within your WordPress admin area.

Next, you should start using Envira Gallery to display images on your website. Envira beautifully displays image galleries without making your website slow. It is incredibly fast, beautiful, and works on all devices. We believe it’s the best photo gallery plugin for WordPress.

Many popular websites rely on CDN’s to serve static content like images. CDN (content delivery network) serves your images from servers located all over the world. This makes your images and rest of your website load simultaneously. It also improves your site’s SEO and user experience.

See our guide on how to install and setup WordPress CDN solution for detailed instructions.

That’s all, we hope this guide helped you learn how to upload large images in WordPress. You may also want to see our guide on how to resize and make images larger without losing quality and our picks of the best drag and drop WordPress page builders.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

14 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Tyler Simonds says

    Re-sizing images prior to upload is a pain–a whole ‘nother step that WordPress should do automatically.

  3. Brittney says

    Hello,

    I tried using this code the 1st code into the functions folder, and now my website no longer works. I am getting “Parse error: syntax error, unexpected ‘@’ in ___” even after I have deleted the code and tried to update it back to normal. Any suggestions?

  4. Wali shah afridi says

    i upload the above code but still the large image file does not upload in my block , kindly tell my that what i do know ??

  5. Chase says

    I would like to clarify that making changes to functions.php files has no effect and that editing my .htaccess file causes an internal server error no matter how perfect I try to make the code. Should I be uploading large video files using another method? The main reason I want to upload the video is to share with a small group of people. I can’t upload it with YouTube, and therefore can embed into WordPress via YouTube because they claim a copyright on my music and the audio is automatically hushed. I need that specific audio track with my video, so YouTube is not an option. So I guess if I can’t solve this problem I need to either find a video hosting service that does not flag copyrighted material or try to host it myself, both of which are a bit off topic for this message board. I am assuming in am out of luck at this point.

  6. Chase says

    Nothing works to upload large files on my GoDaddy WordPress multi-site account running the new version of php. I certainly can’t add directly though my WordPress media browser, so I upload the recommended way via FTP first. The problem is I can’t get the files from my ftp folder to the WordPress media browser. Very little relevant information is posted about the topic online. The recommended “Add from server” plugin does not work. The backup version does not work. The developer does not know. I have all my settings at the right levels in the cPanel configuration settings. I verified with GoDaddy three times. GoDaddy said I can’t do anything more on the hosting end and that it should work. Since the actual php.ini file is not accessible in GoDaddy, creating a new php5.ini or regular php.ini is recommended for GoDaddy servers, but this does not work for me. I can’t edit my actual php.ini file as the video shows. My files size a 150MB mp4 video file and can’t get it much smaller. I adjusted all of the WordPress settings for uploading large files and video files. This did not work. Does anybody know what to do? In the meantime, I am trying to find an another plugin that actually works.

  7. Lutaaya paddy says

    thank you for this article it has worked for me . the code which is put in the .htaccess

  8. Penelope says

    The reason I would like my max upload size increased is because I have a button that opens a URL link of my catalog for customers to download. This link is from my media folder in wordpress.
    If I use a link in a button, does this slow down my website? Do you have a recommendation on how to go about allowing viewers to view a pdf catalog without slowing down a website?

  9. Ankit Agarwal says

    Though for photographers, using a template ( or theme ) that does not allows large image sizes is not understandable. And for rest of us using a plugin seems logical since we will never want to upload a 10 MB+ ( even that’s too high) for the fear of reducing speed. Other wise can there be another reason of uploading high res images?

  10. gary odom says

    You call this WP for beginners but when you proceed to talk about things like php file and ftp client you assume a beginner knows of what you speak. I am sure there many that do, but do real beginners really know what you are talking about? Of course, you are entitled to do what you wish, but it certainly does not cater to true beginners that are still finding they way around the WP program. Many of us had our hosting service install WordPress for us so we are not acquainted with much of what you speak. i am anxious to learn but first I must understand the basics.

Leave a Reply to edizzz Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.