How To Increase WordPress File Upload Size

Are you having trouble uploading files to your WordPress Media Library? This tutorial explains how to increase your WordPress file upload size limit.

How To Increase WordPress File Upload SizeAlways backup your WordPress site before making changes to important files and make copies of any files that you are about to modify.

If you don’t want to edit WordPress files yourself, ask a professional to help you.

***

Are you getting a message in your WordPress Media Uploader that you don’t have sufficient memory to upload certain files to your WordPress site?

In this tutorial, you will learn what the cause of this issue is, and how to increase the maximum file upload size in WordPress in order to eliminate those errors and help get your files uploaded to your site.

How To Increase Maximum File Upload Size In WordPress

Check Your Webhosting Settings

Depending on your web hosting setup and server configuration (and especially on shared hosting accounts), you may experience problems trying to upload some files like audios and videos, to your WordPress site using the Media Uploader function.

Often, problems arise because not enough memory has been allocated to your WordPress Media Uploader …

Media Menu - Add New

(Media Menu – Add New)

In the screenshot below, for example, you can see that the Maximum upload file size assigned to your hosting account by your webhosting provider is only “2MB” …

Upload New Media - Maximum Upload File Size

(Upload New Media – Maximum Upload File Size)

While a limit of 2MB is fine for most images, it is clearly not enough memory to upload media files like videos, audios, etc.

If you try to upload a file that is larger than the upload file size limit, you will get an error message like the one shown in the screenshot below …

Maximum Upload File Size Limit Needs To Be Increased

(Maximum Upload File Size Limit Needs To Be Increased)

The solution, clearly, is to increase the maximum upload file size limit for your site. The easiest way to do this is to ask your web host to increase your limit. If you want to increase the maximum upload file size limit yourself, however, then follow the tutorial below.

Change The Settings In Your Server’s PHP Configuration Settings

The maximum upload file size limit setting is controlled by your server’s ‘PHP Configuration Editor’.

To change this setting, log into your cPanel account, then scroll down to the ‘Software/Services’ section and click on ‘PHP Configuration’ …

cPanel Software / Services - PHP Configuration

(cPanel Software / Services – PHP Configuration)

You will see a message informing you that your PHP configuration settings are customizable by the server administrator (not the user) …

cPanel - PHP Configuration

(cPanel – PHP Configuration)

To increase the maximum upload file size limit without modifying any code in your files, you will need to have access to your server’s Web Hosting Manager (WHM) account.

Useful Info

Having access to your server’s WHM (Web Hosting Manager) account is not the same as having access to your cPanel user account.

WHM is the administrative console for cPanel-based internet web hosting servers.

Basically, cPanel and WHM is the same software, but “cPanel” refers to the user interface and is accessed by the user to control certain aspects of their webhosting account (e.g. set up emails, edit files, view databases, etc.), and “WHM” refers to the administrator interface, and is accessed by the administrator who manages the server and who needs to set up, control, and manage the Cpanel user accounts and logins within the server.

If you are hosting your WordPress site on a “shared hosting” server plan, then you probably don’t have access to WHM – only cPanel.

If your site is hosted on a “dedicated” server (i.e. where no one else shares your server – the server is only for you), then you should have access to your WHM account.

If so, then log into your WHM account …

Web Hosting Manager Login

(Web Hosting Manager Login)

This will bring you to the WHM control panel …

WHM Control Panel

(WHM Control Panel)

Click on the WHM icons, or scroll down the main menu to locate the ‘Service Configuration’ section, and then click on ‘PHP Configuration Editor’ …

WHM - PHP Configuration Editor

(WHM – PHP Configuration Editor)

In the ‘PHP Configuration Editor’ screen, select ‘Advanced Mode’ …

PHP Configuration Editor - Advanced Mode

(PHP Configuration Editor – Advanced Mode)

Scroll down the settings page until you find this function …

post_max_size

“post_max_size” is the function that controls your maximum upload file size …

'post_max_size' value limit set too low

(‘post_max_size’ value limit set too low)

Change this setting to a higher limit (e.g. 10MB, 32MB, 64MB, 128MB), etc …

'post_max_size' value limit increased

(‘post_max_size’ value limit increased)

Scroll down to the bottom of the ‘PHP Configuration Editor’ page and click the ‘Save’ button to update your settings …

Save your PHP configuration settings

(Save your PHP configuration settings)

Your previous settings will be overwritten by the new upload file size limit in the server’s ‘php.ini’ file …

Your previous settings will be overwritten in the 'php.ini' file

(Your previous settings will be overwritten in the ‘php.ini’ file)

You should now see the new upload size limit in your Media Uploader section …

Your maximum upload file size limit has been increased!

(Your maximum upload file size limit has been increased!)

Note: Setting the limit to 64MB – 128MB should be more than sufficient to upload most types of media files.

Important

The methods listed below require modifying server files, and may not work for you if you are on a shared hosting plan. The simplest thing to do in this case is to contact your web hosting company and request them to increase your file upload size limit.

Create Or Edit An Existing PHP.ini File

The ‘php.ini’ file is the PHP configuration file containing instructions to your server about how to handle PHP functions based on your hosting account’s PHP settings. The php.ini file is where you declare changes to your PHP settings. You can use the default settings for the server, change specific settings by editing the existing php.ini file, or simply create a new text file and name it php.ini.

If you are on a shared hosting plan, then you will probably not see a ‘php.ini’ file in your directory.

If you can’t see a file called php.ini, then create a new text file and save your file as php.ini (select ‘Save as type: All Files’) …

php.ini

(php.ini)

In your new php.ini file add the following code, as shown below …

Add this code to your 'php.ini' file

(Add this code to your ‘php.ini’ file)

Resave the file and upload it to your ‘wp-admin’ folder (or root folder depending on your host), using FTP or cPanel.

If you need help uploading files to your server using FTP or cPanel, see the tutorial below:

This file will now instruct your server to allocate the settings you have specified to your site.

Info

Notes:

Depending on your hosting setup, you may need to rename your php.ini file php5.ini in order for this method to work.

If you experience issues with this method, try readjusting the settings in your php.ini file. For example, you may not have 64MB available to assign to your Media Uploader. In this case, try 32MB, or 10MB (or consider upgrading your hosting plan).

.htaccess File Method

If the php.ini method does not work for you, then try adding the following lines of code to your ‘.htaccess file’, and reuploading the file to your root directory …

.htaccess file

(.htaccess file)

To learn more about your .htaccess file, see the WordPress training module below:

Useful Tip

If you plan to upload large media files to your site, it’s probably a good idea to consider using a CDN (Content Delivery Network), or remote cloud storage facility like AmazonS3 or Dropbox to store your large files, and display their content on your posts and pages.

To learn more about uploading videos to your WordPress site, see the tutorial below:

To learn more about uploading audios to your WordPress site, see the tutorial below:

Hopefully, the above information will help you get your files uploaded to your site with no further problems.

How To Increase WordPress File Upload Size

***

"This is AMAZING! I had learnt about how to use WordPress previously, but this covers absolutely everything and more!! Incredible value! Thank you!" - Monique, Warrior Forum

***

How To Configure WordPress Media Settings

Do you need to adjust the size of images and thumbnails displayed on your WordPress site? Learn how to configure your WordPress media settings in this tutorial.

How To Configure WordPress Media Settings

This tutorial is part of our WordPress configuration step-by-step tutorials, where we show you how to set up and configure your WordPress site or blog with no coding skills required.

***

After configuring your site’s Discussion Settings, the next step in the process of setting up a WordPress site is to configure its Media Settings.

Depending on the purpose and nature of your business, using media can be an important part of your online presence.

Media refers to the images, videos, audio recordings and other types of files you will be uploading and using in your site. Media is typically uploaded and inserted into your site’s content when writing a Post or Page.

To learn more about inserting and editing media files in your Posts and Pages, see the tutorial below:

In this tutorial, you will learn how to configure your WordPress Media Settings.

Info

If you’re configuring a new WordPress installation, you can just leave the default settings in this section as they are for now and move on to the next step of the process (i.e. configuring Permalinks).

How To Configure WordPress Media Settings – Tutorial

The Media Settings section allows you to control how media is displayed on your site. To configure your media settings, do the following:

Select Settings > Media in your main WordPress dashboard menu …

Settings - Media

(Settings Menu – Media)

This takes you to the ‘Media Settings’ screen …

WordPress Media Settings

(WordPress Media Settings)

There are two main sections in this area:

  • Image Sizes – This section lets you specify the maximum dimensions in pixels to use when inserting an image into the body of a post or page.
  • Uploading Files – This section lets you specify default settings used during the media upload process when writing or editing a post or page.

Let’s go through each of these sections now in more detail.

Image Sizes

Image sizes allow you to specify the maximum dimensions of images used in your posts and pages …

Media Settings - Image sizes

(WordPress Media Settings – Image sizes)

Thumbnail Size

Set the Width and Height of your thumbnail images in pixels. When setting a thumbnail size, the image will be cropped and resized to the setting you specify in this section.

By default, the check box for Crop thumbnail to exact dimensions (normally thumbnails are proportional) is enabled. Unless you have a reason for disabling this feature, leave this option as is.

Medium Size

Set the Max Width and Max Height in pixels for displaying medium-sized images in this section.

Large Size

Set the Max Width and Max Height in pixels for displaying large-sized images in this section.

Note: Medium and large images will keep their dimension proportions, taking the maximum width and height into account

Uploading Files

This section allows you to specify whether or not files uploaded to the media folder directory in your server will be organized into month and year based folders …

Uploading Files

(Media Settings – Uploading Files)

By default, images and other media files are uploaded to the wp-content/uploads directory on your server into “month” folders, which are nested within folders for “years” …

How media files are organized in the WordPress 'Uploads' folder

(How media files are organized in the WordPress ‘Uploads’ folder)

Unless you have a reason for disabling this feature, leave this option as is in your media settings.

If you’re configuring a new WordPress site installation, just leave the default settings in this section as they are and continue setting up your site. If you make any changes to this section, remember to click the Save Changes button to ensure that your settings are updated …

Save changes to update your settings

(Save changes to update your settings)

Congratulations! Now you know how to configure your WordPress Media Settings. The next step is to configure your WordPress Permalinks.

WordPress Media Settings

Next Step: How To Configure WordPress: Permalinks

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***