{"id":266,"date":"2019-07-31T09:02:27","date_gmt":"2019-07-31T07:02:27","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=266"},"modified":"2021-01-15T15:59:17","modified_gmt":"2021-01-15T14:59:17","slug":"wordpress-maximum-upload-size","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/wordpress-maximum-upload-size\/","title":{"rendered":"How to Increase the Maximum File Upload Size in WordPress"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]To ensure your WordPress website looks attractive and engaging, you have to put a lot of thought into the kind of content to add to your pages. Videos, images, audio files and other types of media can help you better present the products or services you\u2019re offering to your client base.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]WordPress comes with its own media uploader, so you don\u2019t have to bother with using different file managers. However, <strong>there\u2019s a limit when it comes to the maximum file size you\u2019re allowed to upload<\/strong>. This can be an issue when trying to <a href=\"https:\/\/qodeinteractive.com\/magazine\/add-gifs-in-wordpress\/\">add animated GIFs in WordPress<\/a>, large video files or sizable images to your site, but it can also create problems when installing a theme or plugin.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]But don\u2019t fret! There are actually several ways in which you can change this. <strong>We\u2019ll show you just how to increase the maximum file upload size in WordPress<\/strong>, so let\u2019s dive right in, shall we?[\/vc_column_text][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1596057466909{padding-top: 68px !important;}&#8221;][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Check the Maximum Upload Size Limit<\/h2>\n<p>[\/vc_column_text][vc_column_text]The maximum upload size limit may vary, depending on the settings of your WordPress hosting provider. To check your current upload limit, go to your admin dashboard. From the menu on the left select <strong>Media &gt; Add New<\/strong>. Here, you\u2019ll be able to see the maximum upload size.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"378\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-1.jpg\" class=\"attachment-full size-full\" alt=\"Increase the Maximum File Upload Size\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-1.jpg 710w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-1-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-1-620x330.jpg 620w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text] If it doesn\u2019t meet your requirements, this is what you can do to increase the maximum file upload size in WordPress:[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#modify-the-functions-file\">Modify the functions file<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#create-or-edit-a-php-ini-file\">Create or edit a php.ini file<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#update-htaccess-file\">Update .htaccess file<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#modify-the-wp-config-php-file\">Modify the wp-config.php file<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;70px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"modify-the-functions-file\"><\/a> 1. Modify the functions file<\/h2>\n<p>[\/vc_column_text][vc_column_text]The first way to increase the max upload size in WordPress is by <b>altering the functions.php file<\/b>.[\/vc_column_text][vc_column_text]Go to <b><i>Appearance &gt; Theme Editor<\/i><\/b> from your admin dashboard.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"378\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-2.jpg\" class=\"attachment-full size-full\" alt=\"Increase the Maximum File Upload Size\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-2.jpg 710w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-2-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-2-620x330.jpg 620w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]On the right side of the screen, <b>under <\/b><b><i>Theme Files<\/i><\/b>, select <b>functions.php<\/b>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"378\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-3.jpg\" class=\"attachment-full size-full\" alt=\"Increase the Maximum File Upload Size\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-3.jpg 710w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-3-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-3-620x330.jpg 620w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;60px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"378\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-4.jpg\" class=\"attachment-full size-full\" alt=\"Increase the Maximum File Upload Size\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-4.jpg 710w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-4-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-4-620x330.jpg 620w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Scroll to the bottom of the code, create a new line, and <b>paste the following code<\/b>:[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">@ini_set( 'max_execution_time', '300' );\r\n@ini_set( 'upload_max_filesize' , '128M' );\r\n@ini_set( 'post_max_size', '256M');\r\n@ini_set( 'memory_limit', '128M');<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;40px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"378\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-5.jpg\" class=\"attachment-full size-full\" alt=\"Increase the Maximum File Upload Size\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-5.jpg 710w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-5-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2019\/06\/Increase-the-Maximum-File-Upload-Size-Gallery-5-620x330.jpg 620w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Let\u2019s take a closer look at what each of these directives mean:[\/vc_column_text][vc_empty_space height=&#8221;24px&#8221;]<ul class=\"qodef-unordered-list-item \">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">The <strong>max_execution_time<\/strong> directive <strong>defines how long a PHP script will be allowed to run before it\u2019s stopped<\/strong>. The default value is 30 seconds, meaning if a script takes longer than 30 seconds to execute it will result in an error. To make sure this doesn\u2019t happen, we have increased the maximum execution time to 300 seconds.<\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item \">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">The <strong>upload_max_filesize<\/strong> directive is the one that actually <strong>defines the maximum size of a file you can upload<\/strong>. As you can see, we have set it to 128 megabytes.<\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item \">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">The <strong>post_max_size<\/strong> directive <strong>defines the maximum size of all POST body data, including your uploaded files<\/strong>. This is why it should be set at the very least to the same size as your upload_max_filesize\u00ad directive, though we suggest you set it higher. In our example, we set it to twice the size of upload_max_filesize.<\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item \">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">The <strong>memory_limit<\/strong> directive <strong>defines the maximum amount of memory a script is allowed to allocate<\/strong>. It limits scripts to a certain amount of memory so they don\u2019t use up all the available memory on the server. We set our memory limit to 128 megabytes.<\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_column_text]If you\u2019re having issues uploading a file to your server due to its size, we suggest increasing all four of these directives. Of course, you can adjust the sizes for each directive as per your needs.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Once you\u2019re done, click on <i>Update File <\/i>to save your changes.[\/vc_column_text][vc_empty_space height=&#8221;81px&#8221;][vc_separator color=&#8221;custom&#8221; accent_color=&#8221;#f0f0f0&#8243;][vc_empty_space height=&#8221;50px&#8221;][vc_widget_sidebar sidebar_id=&#8221;top-picks-banner&#8221;][vc_empty_space height=&#8221;28px&#8221;][vc_separator color=&#8221;custom&#8221; accent_color=&#8221;#f0f0f0&#8243;][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1596057488058{padding-top: 80px !important;}&#8221;][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"create-or-edit-a-php-ini-file\"><\/a>2. Create or edit a php.ini file<\/h2>\n<p>[\/vc_column_text][vc_column_text]Another way to change the upload limit is by <b>creating or editing a php.ini file <\/b>on your server. For starters, <b>access the WordPress root folder<\/b> of your website. To do this, you have to use an FTP client or File Manager from the cPanel dashboard of your hosting account.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Next, <b>look for the php.ini file <\/b>in the root folder. If you\u2019re using a shared hosting plan, you might not be able to see one. In that case, you could create a php.ini file on your own and then upload it to your root folder. In the php.ini file itself <b>enter the following code<\/b>:[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">max_execution_time = 300\r\nupload_max_filesize = 128M\r\npost_max_size = 256M\r\nmemory_limit = 128M<\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1596057571699{padding-top: 59px !important;}&#8221;][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"update-htaccess-file\"><\/a>3. Update .htaccess file<\/h2>\n<p>[\/vc_column_text][vc_column_text]The .htaccess file is used for your website\u2019s configuration. <b>You can find it in the root folder of your WordPress website.<\/b> Like in the previous example, you will need to access your server via FTP or through your control panel\u2019s file manager.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To make the changes, open the .htaccess file in a code editor or Notepad++. <b>At the very end of the code, enter the following four lines:<\/b>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">php_value max_execution_time 300\r\nphp_value upload_max_filesize 128M\r\nphp_value post_max_size 256M\r\nphp_value memory_limit 128M<\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1596057586137{padding-top: 59px !important;}&#8221;][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"modify-the-wp-config-php-file\"><\/a>4. Modify the wp-config.php file<\/h2>\n<p>[\/vc_column_text][vc_column_text]To locate the wp-config.php file, once again, connect to your server via an FTP client or through your cPanel File Manager and head over to the root directory of your WordPress installation.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<b>Open the <\/b><b><i>wp-config.php<\/i><\/b><b> file and add these lines of code to the bottom:<\/b>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">@ini_set( 'max_execution_time', '300' );\r\n@ini_set( 'upload_max_filesize' , '128M' );\r\n@ini_set( 'post_max_size', '256M');\r\n@ini_set( 'memory_limit', '128M');<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;18px&#8221;][vc_column_text]Just don\u2019t forget to save the changes once you\u2019re done.[\/vc_column_text][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1596057599011{padding-top: 68px !important;}&#8221;][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Conclusion<\/h2>\n<p>[\/vc_column_text][vc_column_text]One of the numerous advantages of using WordPress is the fact that you can customize pretty much anything you like. You want to make your posts or pages private? No problem. Or perhaps you\u2019d like 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\u2019re 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\u2019s fine, as long as you don\u2019t let anything stop you from creating superb websites.[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>To ensure your WordPress website looks attractive and engaging, you have to put a lot of thought into the kind of content to add to your pages. Videos, images, audio files and other types of media can help you better present the products or services you\u2019re offering to your client base.<\/p>\n","protected":false},"author":4,"featured_media":6736,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[14,21,13],"class_list":["post-266","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-core","tag-php","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=266"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/266\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/6736"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}