Increase your wordpress website’s maximum size of media file upload limit

Are you troubled about wordpress site’s maximun size of media file upload limit?
Don’t worry.You are in right place.
Read this article to know how easy to solve this problem


Depending on your chosen web hosting , your wordpress site’s media maximum size of upload limit may be different .It’s totally up to your hosting provider.In general WordPress maximum size of media upload limit is 2MB(especially it’s seen in localhost).

file-size-2mb

However most of our using image size is less than 2MB but it is not worthy for other type of file as like Audio , Video , PDF …… ect.

In this tutorial I’ll try to cover how can you increase your wordpress website’s maximum size of media file upload limit.

 

I’ll explain three different way to do that.You can prefer any one way whatever you like.

 

First way :

By editing function.php file of your theme.

import these code at your theme’s functions.php file

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

change 64M as your need.

 

Second way :

By editing php.ini file.

If you have access php.ini file of your web hosting then you can easily increase maximum file size limit.Basically it is seen in shared hosting( actually I’m not over sure ).If you not see this , create a file named with php.ini.Then paste these codes into that.

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

The third and final :

By Editing .htaccess file.

I think it is more effective way than other.When you’ve installed wordpress you may saw a file named .htaccess in root directory where you installed wordpress.

.htaccess file in wordpress root directory

Simply copy these code and paste on .htaccess file.

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

 

 

Hope this tutorial may be useful for you.Please subscribe with your mail address to get notify for my future articles.

Have fun 🙂

Thanks for reading

Author: King Rayhan

Fullstack dev. Code enthusiast. Coffee addict. Music lover. Let's build cool things together! ☕ 🎶 💻

Leave a comment