Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Updated Sunday, February 22nd, 2009 at 8:20pm

Change Default Thumbnail Size in WordPress

WordPress 2.5 and later include a built-in option to change the size of thumbnails, but for those of you out there using an older version, it is quiet easy to change. It just requires modification of one WordPress file. When WordPress 2.1 was released, it changed the way this was done, and once again with the release of WordPress 2.3, so I have included instructions below for multiple versions.

Instructions for:

  If you have found this page useful, please consider donating. Thanks!


WordPress 2.0

Open /wp-admin/inline-uploading.php and look for the following code:

if ( $imagedata['width'] > 128 && 
$imagedata['width'] >= $imagedata['height'] * 4 / 3 )
      $thumb = wp_create_thumbnail($file, 128);
    elseif ( $imagedata['height'] > 96 )
      $thumb = wp_create_thumbnail($file, 96);

The default max size is 128 x 96. You can change these numbers to whatever you like, although you must keep the proper aspect ratio (4 / 3).

For example, to double the size of the thumbnails, replace 128 with 256, and 96 with 192. Be sure to change both sets of numbers – they are each listed in the code twice.


WordPress 2.1 – 2.2

Open /wp-admin/admin-functions.php and look for the following code:

$max_side = apply_filters( 'wp_thumbnail_max_side_length', 
128, $attachment_id, $file );

The number specified here (128 by default) is the maximum size of either dimension. Just change this to whatever you like.


WordPress 2.3

Open /wp-admin/includes/image.php and look for the following code:

$max_side = apply_filters( 'wp_thumbnail_max_side_length', 
128, $attachment_id, $file );

The number specified here (128 by default) is the maximum size of either dimension. Just change this to whatever you like.

WordPress 2.5 and later

Version 2.5 and later have built-in support for the thumbnail size in the options.

  If you have found this page useful, please consider donating. Thanks!

  1. thank you admin.

  2. These organizations are vital to communities across the United States, and I understand their concerns about possibly losing their tax-exempt status.

  3. thanks, useful for me…

  4. WordPress 2.5 and later include a built-in option to change the size of thumbnails. Thanks

  5. Ah well your comment! I did you good!XZEWEG

  6. thak you admin.

  7. thanks for giving such a nice information.It is very helpful for me.again thanks a lot.

  8. WordPress 2.5 and later include a built-in option to change the size of thumbnails, but for those of you out there using an older version, it is quiet easy to change.

  9. If you are a fan of the National League, then you will be one of the online shoppers who will empty our shelves off with logo items from the Atlanta Braves, the Colorado Rockies, the Cincinnati Braves, the St. Louis Cardinals, and the San Francisco Giants.

  10. keep up the excellent work! thanks for such a nice post!

  11. Great tips thanks for the advice

  12. Great tips thanks for the advice

  13. jgg This is a wonderful site! I’ve been looking for something like this 
    for a while now! Thank you!
    

  14. great stuff as usual.reg

  15. useful for me thank you.

  16. Great job. Looking forward to be updating.

  17. Thank you so very much for taking the time to share…very useful, indeed!fghty

  18. Thanks for a nice share you have given to us with such an large collection of information dghffd

  19. I will make sure to bookmark your blog and will come back someday. I want to encourage one to continue your great posts, have a nice morning!

  20. We have indeed got lot to learn from the post. Its really very helpful.

  21. Very helpful concept.

  22. All stuffs that may work easier to do is always appreciate.

  23. Too much updated do make work more complicated at start but it really work at last.

  24. Sometimes it do become embarrassing to updated too much stuffs.

  25. Word press is truly doing an awesome job. Keep it up.

  26. ? love Word press thank you

  27. Thx so much once more!!

  28. Word press has truly prove its helpful system.

  29. Great job. Looking forward to be updating.

  30. I admit, I have not been on this blog in a long time, however it was joy to find it again. It is such an important topic and ignored by so many, even professionals! I thank you for helping to make people more aware of these issues. Just great stuff as per usual!

  31. Brilliant article my friend, but could you teach me more detail about your post.
    cogumelos magicos

  32. I visited this page first time and found it Very Good Job of acknowledgment and a marvelous source of info………Thanks Admin!

  33. I think the process need to be easier to perform so that it do not become boring to the users.

  34. Wordpress has as usual done its best to help the users.

  35. Nice article, It covered the basics so people can have a solid foundations to work from
    Pennsylvania Child Care Grants

  36. Great tips thanks for the advice

  37. Great post – it’s always nice to get some hints and tips
    Daycare Forms

  38. I must say wordpress is the most efficient.

  39. Looks like you are a specialist on this because you just made it so easy to be with you, motivated me to learn more on the subject! May I ask you, do you devote a lot of effort to it because you seem to be so in tune with Medical Assistant

  40. I checked out SWEET and Events.org (who we used) was far better priced then them. Education

  41. I checked out SWEET and Events.org (who we used) was far better priced then them. Taller

  42. I want to be a part of this mags. I have idea to make a good design and to make a good layout for this mags. We need to make other people to feel interesting by see our mags cover, then they will buy itbachelors criminal justice

  43. I want to be a part of this mags. I have idea to make a good design and to make a good layout for this mags. We need to make other people to feel interesting by see our mags cover, then they will buy it bachelors of criminal justice

  44. 63
    sun

    please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks. health information management degree

  45. Explorer Tab is powerful toolbar add-on for Windows Explorer, it provides some important file management features you could most want. Tabbed interface to allow users to find and organize their files in new ways (Copy iPod to new computer), bookmarks feature allow users to access to most used folder quickly by clicking tab without browsing file directory tree. It also provides some other features, open CMD console in any folder, show/hide hidden file and so on.

  46. Thank You for this wonderful post!Washington Foreclosure Help

  47. Hi I found option for chANGING thumbnail size in categories but it doesn’t change the size on the page…? What I am missing?

  48. please read through the comments because most common issues have already been discussed many times. Thanks. vonline masters educational leadersip

  49. Excellent posts!

  50. Thanks buddy!i was looking for this helpful sit i happy to be there. i found this site is entrusting and informative thanks for sharing this with us
    daycare grants

  51. please read through the comments because most common issues have already been discussed many times. Thanks. information security masters

  52. please read through the comments because most common issues have already been discussed many times. Thanks. online it security degree

  53. please read through the comments because most common issues have already been discussed many times. Thanks.
    masters of social work

  54. I high appreciate this post. It’s hard to find the good from the bad sometimes
    Tennessee Foreclosure Process

  55. keep up the excellent work! thanks for such a nice post!

  56. I really enjoyed reading this post, big fan. Keep up the good work and please tell me when can you publish more articles or where can I read more on the subject? Thank you . I will really appreciate you for your upcoming blast also.
    Texas Foreclosure Help

  57. I really enjoyed reading this post, big fan. Keep up the good work and please tell me when can you publish more articles or where can I read more on the subject? Thank you . I will really appreciate you for your upcoming blast also.
    daycare grants

  58. I got these guides very helpful. Here I got much stuff to know..

  59. Amazing! This is very informative blog. Thanks for sharing such a nice information with us. I appreciate your blog

  60. read through the comments because most common issues have already been discussed many times. Thanks. online mba degree programs

  61. The techniques of word prress is too good. Its quite different as well.

  62. Companies these days are using ergonomic furniture to ensure that there are no injuries from work related hazards. Use an ergonomic chair and feel better comfort in your back and shoulder

    sports masters

  63. Thanks for the tip, came here looking the php code, never thought about looking at the settings first RTFM all over again

    health administration

  64. word press

  65. Thanks so much! Great plugin.
    drm removal tool, remove drm protection

  66. 41
    person_guyz

    It’s good to be visiting her again since, it has been months for me. Well this article I’ve been waiting for so long. Need this item to complete my homework in school, and has the same issue with your item. Thanks, much.
    bachelor of nursing

  67. 40
    person_guyz

    Best-of-Programm jedoch probiert Josef Hader etwas, was viele Kollegen machen, er aber normalerweise nicht: Nummern spielen und dazwischen Lieder singen. gout diet
    clinical informatics

  68. 39
    jibran

    Companies these days are using ergonomic furniture to ensure that there are no injuries from work related hazards. Use an ergonomic chair and feel better comfort in your back and shoulder. resa

  69. this is awesome. just what I have been looking for for ages! I’m going to have a go at donating to you (although last few times i’ve

  70. useful for me thank you.

  71. 36
    wedseo

    Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.
    skin care products

  72. 35
    jibran

    Best-of-Programm jedoch probiert Josef Hader etwas, was viele Kollegen machen, er aber normalerweise nicht: Nummern spielen und dazwischen Lieder singen. gout diet

  73. Great job, thanks!
    burn iTunes to DVD MP4 to DVD

  74. i like this website.thanksl

  75. Thanks for the tip, came here looking the php code, never thought about looking at the settings first ;-) RTFM all over again

  76. 31
    Hilmon

    Using the TwentyTen Theme in WP3 they use the Featured Image for the homepage banner so in functions.php its set like this …
    set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); …. You need to take out all of the parameter so it just set_post_thumbnail_size(); … This will leave your image untouched!! :-)

  77. 30
    sybil sage

    Is there a code to substitute so that the thumbnails will appear in their entirety on version 2.5? I’m not understanding from the forum how to fix the problem of thumbnails showing only partially?

  78. On worpress 2.9.1 my thumbnails, regardless of size I try to load, don’t show in their entirety. Can you explain how to fix this?

    Thank you!!!

  79. Running into the same issues with uploading images and sizes on the wp media library. The sizes do match what I put in the media settings. Then when I go to a post to insert a image all the sizes are screwed and under sizes it only shows 3 of 4 available sizes. Thumbnail Medium and Full Size no large?

    I am running:
    WordPress 2.8.5.
    Server: Apache/1.3.37 (Unix)
    PHP: v5.2.3
    GD: bundled (2.0.34 compatible)

    I went through high and low and still having issues.
    I deactivated all plugins. Reactivated 1 by 1. – No luck

    WordPress 2.8.5. – GD Library / WP Media Library Size Issues & Other Issues

    Running into the same issues with uploading images and sizes on the wp media library. The sizes do match what I put in the media settings. Then when I go to a post to insert a image all the sizes are screwed and under sizes it only shows 3 of 4 available sizes. Thumbnail Medium and Full Size no large?

    I am running:
    WordPress 2.8.5.
    Server: Apache/1.3.37 (Unix)
    PHP: v5.2.3
    GD: bundled (2.0.34 compatible)

    I went through high and low and still having issues.
    I deactivated all plugins. Reactivated 1 by 1. – No luck
    I am not running podpress

    Please help this is extremely frustrating…

    Support Topics:
    http://wordpress.org/support/topic/241804?replies=4#post-1274481

    http://wordpress.org/support/topic/227408?replies=25#post-1273733

    http://wordpress.org/support/topic/227408?replies=24

    http://wordpress.org/support/topic/226550?replies=7#post-992291

    http://wordpress.org/support/topic/226550?replies=17#post-1273739

    http://core.trac.wordpress.org/ticket/7151

  80. Thanks so much!!! I really appreaciate your help…THanks again!

  81. does anyone know how to change the article style on the premium news theme from woo themes for small boxes to that of slamxhype.com with the picture on the left and the description on the right?? if you do please email me your answer or code at ventagemusicgroup.com

  82. This page has been updated for WordPress 2.7 – It still has the thumbnail size option built-in, but its position has moved to Settings -> Media

  83. I tried to do it myself, but i failed and you’ve helped me a lot. Thanks!

  84. I got the permanent media php file to work, but if i ever upgrade, I lose all of those settings. I cannot get it to work for my wedding photography blog as a theme. Any suggestions?

  85. Thank you, thank you, thank you!
    Finding that line and changing it, unguided, would have been well beyond my comfort level!

  86. Dagon – you is always da’ man! Never fails, I search on how to do some random thing in wordpress and Dagon comes through like a champ!

  87. Yanurmal: Thanks for the info :)

  88. To resize the thumbnail in WP2.5, open your Dasboard and goto Setting – Miscellaneous. You can resize small thumbnail and midle here :)

  89. 18
    BDcomics

    Thank you! Was very helpful. :)

  90. Hopefully you will update this post to include changing the default thumbnail, medium, and “full” size image uploads for WP 2.5?! This would be greatly welcomed.

  91. Excellent, thanks! I figured it would be in there somewhere but you saved me having to dig through all the code to find out where exactly.

  92. 15
    Reilly

    great help, thanks

  93. Please forgive my stupidness, but where exactly do you find this wp-admin folder?? Is it on my server?

    WordPress 2.3

    Open /wp-admin/includes/image.php and look for the following code:

    $max_side = apply_filters( ‘wp_thumbnail_max_side_length’,
    128, $attachment_id, $file );

    The number specified here (128 by default) is the maximum size of either dimension. Just change this to whatever you like.

  94. 13
    brandon

    Thanks. This was easy. I agree that it would be nice to implement a faster change in the options somewhere. I could see myself forgetting to change this the next time I upgrade, which I’m sure won’t be too far off.

  95. In WP 2.3, can you modify the code in order to set both the height AND width?

  96. hi sir i want a script of submit from where users submit a theams mobile text sms in to my email plz tell me the script

  97. 10
    Steve

    It might be better were you to use a plugin for this, rather than mucking about within the code. There is actually a plugin already written, available at http://www.shiftthis.net/wordpress-thumbnail-size-plugin/ . This is not mine, just something I found. I’ve used it from v2.0 on (including 2.3.1).

  98. thanks so much… it was big problem for me..

  99. Many thanks for this great tip!

  100. Thanks, works great :-)

  101. Excellent, thanks! I figured it would be in there somewhere but you saved me having to dig through all the code to find out where exactly.

    I wouldn’t mind if they take it a step further and allow you to set the thumbnail size on a per-image basis so I can generate different sized thumbnails for different categories, etc.

  102. This is AWESOME! Thanks a lot for this, as it’s going to help in my redesign. :D

  103. Hi

    I found this tip very useful. I’m using at all my blogs.
    This must be a feature that they will implement in future a release.

  104. They should add this to the normal options settings accessible through the dashboard. It is very annoying to need to manually edit this file after each update.

  105. Richard: Both of those things are already possible from the file upload box. You choose ‘Show: Full Size’ and ‘Link To: None’

    Unless perhaps you are using a much older version of WordPress.

  106. I have a related question. Would anyone know how you can hack the image upload code so that instead of having “thumbnail” as the default image size, you can have “full size” be the default? It bugs me that they didn’t allow users to custommize this feature. I’d also like to set the link default setting to “none.”

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.