One of the recent question raised is how to upload large images in WordPress. Because many of the users find an error in uploading the large image in WordPress. This is because many of the web hosts will set a file size limit for uploads. This will stop the users from uploading large files. Your WordPress hosting provider may have configured their servers with a limit on file upload sizes. In this article, we will see how to upload large images to WordPress.
Upload Large Images in WordPress
If you want to see the upload limit, then go to Dashboard > Media > Add New. Here you can see your current upload limit at the bottom of the page. Some hosts would have set a limit value to 128 MB.
Here if you try to upload a larger file than your current upload limit, then you will definitely get an error message like this:
[wpfmb type=’error’ theme=2]‘ filename.jpg exceeds the maximum upload size for this site’[/wpfmb]
Another problem which may keep you from uploading large image is memory limit. Maximum file upload size will be fixed from the server side. WordPress has nothing to do with it. To upload large images to WordPress, then you have manually edit some files. Depending on your server configuration, this file may be your theme functions.php file, server php.ini file or server.htaccess file. One problem is that some hosts don’t allow you to manually increase the upload limit. In that case, you have to contact your host support team.
Certain Problems Faced When Uploading Large Images:
Internet speed continues and rise and bandwidth limits are getting limited. Downloading large images is less on an issue now. But we are not sure that all users will have access to high-speed internet. The raw image will take a large time to load on a slow internet connection. Raw high-resolution images really look nice but they have a huge file size. Consider of compressing images, then the file size will be much smaller. In most of the cases, you won’t notice any quality loss and there are a lot of online tools available to compress images. Mainly speed plays an important role in SEO ranking. Google actually prefers a site with high speed.
Now let us see what can be done to increase the upload limit so that we can upload large images to WordPress.
You can start with your themes functions.php file. Open this file using FTP client and then add the following lines of code. You can place this code anywhere in the functions.php file:
@ini_set(‘upload_max_size’,’150M’); @ini_set(‘post_max_size,’150M’); @ini_set(‘max_execution_time’,’300’);
This code tries to increase maximum upload file size, post maximum size and maximum execution time limits for your WordPress website. However, this may not work for some WordPress website. In that case, you can try another method.
Be careful when editing this file and make sure you take a backup. You can find the .htaccess file in the server root directory. Make sure hidden files are visible and paste the following lines of code.
php_value upload_max_filesize 150M php_value post_max_size 150M php_value max_execution_time 300 php_value max_input_time 300
If both these methods don’t succeed, then you can try modifying these rules using php.ini.file
This is the common method and it works for most users. Php.ini is the configuration file used by PHP itself. The main PHP configuration file may not be always available. You should find your php.ini file in your WordPress installation root directory. In case if the file is not available, then you have to create a new one. You have to just create a new empty file and name it php.ini and paste the following code into it, save and upload the new file.
upload_max_filesize=150M post_max_size=150M max_execution_time=300
These are the codes to manually upload large images to your WordPress website.
If you are still not able to upload large images to WordPress, then you have to contact your web host and tell them to that you want to increase the maximum upload file size limit in the WordPress media library. They will increase it for you. Hope this article has cleared the issues about how to upload large images to WordPress.