In your wordpress, the image is large or uncompressed then the site is too slow. In webdevelopment, many users have no knowledge regarding how to resize the image using image editing software. So, every one simply upload images as-is.Even if the image is resized by the theme to fit the width of the content area, it still requires time to process when loading the page. You have to simply upload the files and then to keep your site active and pretty.
Basically, there are three ways to upload files in WordPress:
- Connect to your server via an FTP client like FileZilla.
- Log in to your hosting provider by accessing their online file manager.
- Upload your media, themes, or plugin files directly from the WordPress Dashboard.
If you want to upload anything other than media,plugins or themes, you can always upload them via a file manager.
In wordpress dashboard, we can upload the images or media files through this platform. After login wordpress dashboard, select media link from left side and click add new and select the media from your computeryou can just drag and drop it in the box. And also maximum upload file size specified here. Here’s a screenshot:
From the screenshot we can say that, the maximum upload size is 24MB. We can change these upload size using different ways. There are three settings within the PHP info file that are relevant to your upload limit. You can search through the file to see what they are currently set to.
- memory_limit – This defines how much memory is allocated to PHP. You will simply need to ensure that this number is as high or higher than the upload limit you want to set.
- post_max_size – This defines the maximum size that is handled in a POST request. We will need to set this to our new upload limit.
- upload_max_filesize – This defines the maximum size for file uploads. This will also be set to our new upload limit.
Increasing The WordPress Maximum Upload File Size
There are three basic ways you can go about solving this issue.
1: Theme Functions File
We can change the maximum file upload file using function file from wordpress theme folder. Select active theme from wp-content->theme folder. From here select the functions.php and add the below code into functions.php file.
@ini_set( 'upload_max_size' , '65M' ); @ini_set( 'post_max_size', '65M'); @ini_set( 'max_execution_time', '300' );
2. Create or Edit an existing PHP.INI file
In most cases if you are on a shared host, you will not see a php.ini file in your directory. If you do not see one, then create a file called php.ini and upload it in the root folder. In that file add the following code:
upload_max_filesize = 65M post_max_size = 65M max_execution_time = 300
3. htaccess Method
Somebody tried to change the uploaded file size through .htaccess file. Open or create the .htaccess file in the root folder and add the following code:
php_value upload_max_filesize 65M php_value post_max_size 65M php_value max_execution_time 300 php_value max_input_time 300
There are three basic ways you can go about solving this issue. I will start with the two easiest ones, then move on to changing the server settings yourself – there are a number of options here as well.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.