{"id":4081,"date":"2017-02-22T04:59:43","date_gmt":"2017-02-22T09:59:43","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=4081"},"modified":"2021-12-08T13:24:03","modified_gmt":"2021-12-08T18:24:03","slug":"increase-max-file-upload-size-wordpress","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/","title":{"rendered":"Here’s How to Increase the Max File Upload Size in WordPress"},"content":{"rendered":"\n

As you go into your forays with WordPress you may encounter some errors that really have nothing to do with you. In fact, let us not call them errors but a language feature built into PHP<\/a> to restrict the sizes of uploaded files and for good reason that is. To fix this we need to look at the max file upload size.<\/p>\n\n\n\n

There are several ways in which you can take a peek at this maximum file upload size threshold. For most of them, you need some decent level of technical experience with Apache<\/a> or Nginx<\/a> servers.<\/p>\n\n\n\n

In WordPress<\/a>, though there is a much simpler way. In the Admin section, on the menu, you can go to Media > Add New<\/strong> or Media > Library > Add New<\/strong>. You will then be presented with the File upload form and there it will show the maximum file size that you can upload. See the image below.<\/p>\n\n\n\n

\"WordPress<\/a><\/figure>\n\n\n\n

Depending on the native setting of your host, this figure may be too low especially if you are trying to run a website with downloadable resources like PDF documents or images.<\/p>\n\n\n\n

Three Ways to Change the Max File Upload Size<\/h2>\n\n\n\n

Here we will show you three ways to change the max file upload size.<\/p>\n\n\n\n

Method 1. Using .htaccess<\/h2>\n\n\n\n

You can use the .htaccess file found in your WordPress root directory. You can normally access this file by logging into your website’s directories using an FTP client or the File Manager provided by your web hosting provider.<\/p>\n\n\n\n

This file is processed on demand every time a visitor accesses your website. Like any file, we recommend you take a backup of this file as it stores very critical configuration information for your website.<\/p>\n\n\n\n

All you need to do is add the following lines of code at the end of the file and save it back to the server. The changes will then reflect immediately.<\/p>\n\n\n\n

php_value upload_max_filesize 32M\nphp_value post_max_size 32M\nphp_value max_execution_time 180\nphp_value max_input_time 180<\/code><\/pre>\n\n\n\n

It is also a good idea to increase the max execution time. In the example above it is set to 180 seconds (3 mins). This amount should not be too high as it could cause more problems on badly written scripts.<\/p>\n\n\n\n

Method 2. Using php.ini<\/h2>\n\n\n\n

Depending on how your hosting plan is set up, you might be given access to the php.ini file. In most cases on shared hosting plans, you will not have access to this file. Though we do not strongly recommend doing this, you can create the file and upload it to your website’s root folder. In which case it is better to stick to the .htaccess file.<\/p>\n\n\n\n

Should you choose to proceed with the php.ini file in your webroot you will probably want to secure it by adding the following piece of code in your .htaccess file to keep prying eyes away from it.<\/p>\n\n\n\n

<Files php.ini>\nOrder allow,deny\nDeny from all\n<\/Files><\/code><\/pre>\n\n\n\n

Now in your php.ini file whether in the correct location or the webroot, you will need to add the following code to the file.<\/p>\n\n\n\n

upload_max_filesize =32M\npost_max_size =32M\nmax_execution_time =180\nmax_input_time =180<\/code><\/pre>\n\n\n\n

Method 3. Using the ini_set PHP Function<\/h2>\n\n\n\n

This PHP function can be used to set the value of a given configuration option on demand. The lifespan of this configuration lasts until the end of script execution. Or in short, t lasts for that single request.<\/p>\n\n\n\n

To set the appropriate configuration options, you can the following lines of code at the end of the functions.php<\/strong> file for your theme. It can be accessed by going to the WordPress admin page. You can then go to Appearance > Editor<\/strong> and click on the functions.php<\/strong> template on the right.<\/p>\n\n\n\n

<?php\n\nini_set( 'upload_max_size' , '32M' );\nini_set( 'post_max_size', '32M');\nini_set( 'max_execution_time', '180' );\nini_set( 'max_input_time', '180' );\n\n?><\/code><\/pre>\n\n\n\n

There you have it. You can now upload larger images or documents without getting errors again as long as you remain within the increased limits.<\/p>\n","protected":false},"excerpt":{"rendered":"

As you go into your forays with WordPress you may encounter some errors that really have nothing to do with you. In fact, let us not call them errors but…<\/p>\n","protected":false},"author":1,"featured_media":4082,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,17,20],"tags":[58,136,154,400,424,433,449,452,471,651],"yoast_head":"\nHere's How to Increase the Max File Upload Size in WordPress<\/title>\n<meta name=\"description\" content=\"Having trouble with uploading large images, well here's how to increase the max file upload size in WordPress using three different methods\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Here's How to Increase the Max File Upload Size in WordPress\" \/>\n<meta property=\"og:description\" content=\"Having trouble with uploading large images, well here's how to increase the max file upload size in WordPress using three different methods\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-22T09:59:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-08T18:24:03+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/02\/Max-File-Upload-Size-wordpr.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"Here’s How to Increase the Max File Upload Size in WordPress\",\"datePublished\":\"2017-02-22T09:59:43+00:00\",\"dateModified\":\"2021-12-08T18:24:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/\"},\"wordCount\":626,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/02\/Max-File-Upload-Size-wordpr.jpg\",\"keywords\":[\"Apache\",\"CMS\",\"Configuration\",\"Nginx\",\"Open Source\",\"Optimization\",\"Performance\",\"PHP\",\"Programming\",\"WordPress\"],\"articleSection\":[\"Articles\",\"Guides\",\"Tips\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/\",\"url\":\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/\",\"name\":\"Here's How to Increase the Max File Upload Size in WordPress\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/02\/Max-File-Upload-Size-wordpr.jpg\",\"datePublished\":\"2017-02-22T09:59:43+00:00\",\"dateModified\":\"2021-12-08T18:24:03+00:00\",\"description\":\"Having trouble with uploading large images, well here's how to increase the max file upload size in WordPress using three different methods\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/02\/Max-File-Upload-Size-wordpr.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/02\/Max-File-Upload-Size-wordpr.jpg\",\"width\":1200,\"height\":630,\"caption\":\"Max File Upload Size in WordPress\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Here’s How to Increase the Max File Upload Size in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/x.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Here's How to Increase the Max File Upload Size in WordPress","description":"Having trouble with uploading large images, well here's how to increase the max file upload size in WordPress using three different methods","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"Here's How to Increase the Max File Upload Size in WordPress","og_description":"Having trouble with uploading large images, well here's how to increase the max file upload size in WordPress using three different methods","og_url":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2017-02-22T09:59:43+00:00","article_modified_time":"2021-12-08T18:24:03+00:00","og_image":[{"width":1200,"height":630,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/02\/Max-File-Upload-Size-wordpr.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"Here’s How to Increase the Max File Upload Size in WordPress","datePublished":"2017-02-22T09:59:43+00:00","dateModified":"2021-12-08T18:24:03+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/"},"wordCount":626,"commentCount":0,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/02\/Max-File-Upload-Size-wordpr.jpg","keywords":["Apache","CMS","Configuration","Nginx","Open Source","Optimization","Performance","PHP","Programming","WordPress"],"articleSection":["Articles","Guides","Tips","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/","url":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/","name":"Here's How to Increase the Max File Upload Size in WordPress","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/02\/Max-File-Upload-Size-wordpr.jpg","datePublished":"2017-02-22T09:59:43+00:00","dateModified":"2021-12-08T18:24:03+00:00","description":"Having trouble with uploading large images, well here's how to increase the max file upload size in WordPress using three different methods","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/02\/Max-File-Upload-Size-wordpr.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/02\/Max-File-Upload-Size-wordpr.jpg","width":1200,"height":630,"caption":"Max File Upload Size in WordPress"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/increase-max-file-upload-size-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"Here’s How to Increase the Max File Upload Size in WordPress"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/x.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/4081"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=4081"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/4081\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/4082"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=4081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=4081"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=4081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}