$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Which Wordpress file controls the featured image upload maximum width and height of 3000px|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Which Wordpress file controls the featured image upload maximum width and height of 3000px

matteradmin9PV0评论

Ok so i read a forum somewhere... that gave instructions on how to hardcode change the maximum image upload global values for "featured image" for woo commerce products, from a max of 3000px width and height so that I could restrict vendors from uploading large images. So I changed the values to 500px wide X 600px high, and it works like magic!!! BUT now I need to change it back and I've forgotten which file I changed due to a computer dying on me..... AAAAARG does anyone know where these settings live in the wordpress structure so I can reverse it back to 3000px X 3000px?

Ok so i read a forum somewhere... that gave instructions on how to hardcode change the maximum image upload global values for "featured image" for woo commerce products, from a max of 3000px width and height so that I could restrict vendors from uploading large images. So I changed the values to 500px wide X 600px high, and it works like magic!!! BUT now I need to change it back and I've forgotten which file I changed due to a computer dying on me..... AAAAARG does anyone know where these settings live in the wordpress structure so I can reverse it back to 3000px X 3000px?

Share Improve this question asked Jan 9, 2019 at 7:15 NettpressNettpress 12 bronze badges 6
  • WordPress doesn't set maximum dimensions for uploaded images. You must've edited a plugin or added your own code. No one here can tell you which file you edited when it could be almost anything. – Jacob Peattie Commented Jan 9, 2019 at 7:50
  • I think it was a .css file but it was definitely in the wordpress structure... max width=3000px AND max height=3000px ... Apparently wordpress defines these values for the featured image as a standard... I changed them to 500px x 600px and it restricts my vendors from uploading anything larger. – Nettpress Commented Jan 9, 2019 at 8:03
  • WordPress does not do that. If it was done with CSS then it would've been your theme. And CSS only affects the display of the image. It wouldn't prevent users uploading a larger image. – Jacob Peattie Commented Jan 9, 2019 at 8:42
  • Ok so that narrows it down because I just tried uploading a large product featured image as admin and it allowed it BUT when logged in as a vendor it prevented it sooo if i didn't do it in wordpress that makes me happier as it narrows down the search... but now I'm not sure it was a css it might have been a .js file... as these are the two file types I'm not very familiar with.... doah! wish i'd never changed it.... could be a year down the drain... – Nettpress Commented Jan 9, 2019 at 9:19
  • Dump your database and search (grep) for lines with "500", "600" and "max" in them. – Jos Commented Jan 9, 2019 at 10:14
 |  Show 1 more comment

1 Answer 1

Reset to default 0

It's set at the PHP level. In php.ini there's a line like

upload_max_filesize = 64M

which you may need to add or change. The file is at the root of your site, and might have to be added if it isn't there already. It's also possible to limit the size via the .htaccess file (which the web server looks at, and again is at the root of your site).

Also, this is a blanket limit, so if you wanted the limits to vary by role you'd probably need a plugin.

Post a comment

comment list (0)

  1. No comments so far