Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Upload Large Images in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Upload Large Images in WordPress

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.

Simply add this code in your theme’s functions.php file.

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

This code tries to increase upload maximum filesize, post maxiumum 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.

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.


Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Lutaaya paddy says:

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

  2. 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?

  3. 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?

  4. 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.

    • WPBeginner Support says:

      Thanks for the feedback. We do miss things occasionally, but you can always ask us to clarify in the comments. We will be happy to offer further explanation.

      PHP is the programming language in which WordPress is written. FTP client is a software that allows you to connect to your web server to edit and upload files on your shared hosting server. Take a look at our guide on how to use FTP to upload files to WordPress for beginners.

  5. Rybird says:

    Very well written informative article.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.