Large images in WordPress


Yet another small, but annoying problem solved:
Since sometime ago (allegedly since version 2.5 – I haven’t noticed it until 2.6), WordPress has started to scale all larger images, which were added in the editor by clicking “add image”, down to a width of 500 pixels. This will also happen, if you even chose “full size” in the dialogue before. This behaviour is meant to prevent you from accidentally hosing your layout with outsized images.
I for one always make sure my images have a suitable size before the upload, and aside from that, I loathe when programs infantilise me! Of course, one could still change the image size manually later, but who has the mind to do so…

I found the solution here: Somewhere in your theme, e. g. in functions.php, set the variable $GLOBALS['content_width'] to the desired maximum width of your images. Like I said, I want to have full control over all image sizes, so I set this maximum value to 9999:

As mentioned above, if this variable is not set, the value 500 will be used instead.


Leave a Reply

Your email address will not be published. Required fields are marked *