How to Increase Maximum File Upload Size in WordPress 1

How to Increase Maximum File Upload Size in WordPress

To make your WordPress website look attractive and engaging, you should give a lot of thought to the type of content that will be added to your pages. Videos, images, audio files, and other types of media can help you better present your product or service to your customer base.

WordPress comes with its own media uploader, so you don’t have to bother using different file managers. However, there is a limit when it comes to the maximum file size you are allowed to upload. This can be a problem in WordPress when trying to add animated GIFs, large video files or large images to your site, but it can also be a problem when installing a theme or plugin.

But, do not be sad! Actually, there are several ways to change this. We will show you how to increase the maximum file upload size in WordPress.So let’s dive right in, shall we?

Check Maximum Upload Size Limit

The maximum upload size limit may vary depending on your WordPress hosting provider’s settings. Go to your admin dashboard to check your current upload limit. Choose from the menu on the left Media > Add New. Here you will be able to see the maximum upload size.

Increase Maximum File Upload Size

If it doesn’t meet your requirements, you can do the following to increase the maximum file upload size in WordPress:

1. Modify the functions file

The first way to increase the maximum upload size in WordPress is: Changing the function.php file.

go Appearance > Theme Editor from your admin control panel.

Increase Maximum File Upload Size

on the right side of the screen, under Theme Fileschoose functions.php.

Increase Maximum File Upload Size
Increase Maximum File Upload Size

Scroll to the bottom of the code, create a new line and paste the code below:

@ini_set( 'max_execution_time', '300' );
@ini_set( 'upload_max_filesize' , '128M' );
@ini_set( 'post_max_size', '256M');
@ini_set( 'memory_limit', '128M');
Increase Maximum File Upload Size

Let’s take a closer look at what each of these directives mean:

If you’re having trouble uploading files to your server because of its size, we recommend increasing all four of these guidelines. Of course, you can adjust the dimensions for each directive according to your needs.

When you’re done, click Update File to save your changes

2. Create or edit a php.ini file

Another way to change the upload limit is Creating or editing a php.ini file on your server. For starters, Access WordPress root folder your website. To do this, you need to use an FTP client or File Manager from your hosting account’s cPanel dashboard.

Next, Search for the php.ini file in the root folder. If you are using a shared hosting plan, you may not see a plan. In this case, you can create a php.ini file yourself and then upload it to your root folder. in the php.ini file itself enter the code below:

max_execution_time = 300
upload_max_filesize = 128M
post_max_size = 256M
memory_limit = 128M

3. Update the .htaccess file

The .htaccess file is used to configure your website. You can find it in the root folder of your WordPress website. As in the previous example, you will need to access your server via FTP or your control panel’s file manager.

To make changes, open the .htaccess file in a code editor or Notepad++. Enter the following four lines at the very end of the code:

php_value max_execution_time 300
php_value upload_max_filesize 128M
php_value post_max_size 256M
php_value memory_limit 128M

4. Modify the wp-config.php file

To find the wp-config.php file, once again connect to your server via an FTP client or your cPanel File Manager and navigate to the root directory of your WordPress installation.

Hungry wp-config.php Open the file and add these lines of code at the bottom:

@ini_set( 'max_execution_time', '300' );
@ini_set( 'upload_max_filesize' , '128M' );
@ini_set( 'post_max_size', '256M');
@ini_set( 'memory_limit', '128M');

Don’t forget to save the changes when you’re done.

Solution

One of the numerous advantages of using WordPress is that you can customize almost anything you want. Want to make your posts or pages private? No problem. Or do you want to remove the admin bar? You can do it in a snap. In this little guide, we showed you that you can even increase the maximum file upload size. But if you’re not comfortable with any of these options, you can always contact your hosting provider and ask them to do it for you. Whichever option you choose, it’s fine as long as you don’t let anything stop you from creating great websites.

Support our work ❤️

If you enjoyed this article, consider leaving a tip to help us keep publishing great content.

Secure payment on PayPal
Moyens I/O Staff is a team of expert writers passionate about technology, innovation, and digital trends. With strong expertise in AI, mobile apps, gaming, and digital culture, we produce accurate, verified, and valuable content. Our mission: to provide reliable and clear information to help you navigate the ever-evolving digital world. Discover what our readers say on Trustpilot.