Now with custom image sizes Wordpress is almost as powerful as timThumb / phpThumb. There is one problem however. The way Wordpress handles the resized images are chaotic and doesn't survive theme changes / image size changes.

The problem is that wordpress names the files like: image-600x400.jpg, instead of naming them image-medium.jpg or image-custom.jpg.

Is it possible to override this behaviour? It would finally make Wordpress manage image sizes perfectly! You would just need to regenerate your thumbnails with any regenerator plugin, but your URL's would all work! (Also the size information should be removed from the posts.)

  • 1
    possible duplicate of Set custom name for generated thumbnails
    – brasofilo
    Commented Mar 13, 2013 at 12:55
  • @brasofilo Even if the "goal" seems to be the same, I guess the point is that the other images should then be automatically used by the "new"/next theme.
    – kaiser
    Commented Mar 13, 2013 at 14:25
  • @kaiser, oh, and that brings an interesting aspect to overcome... Hope the Q don't gets closed then... zsero, if the other Q code is useful, incorporate it here.
    – brasofilo
    Commented Mar 13, 2013 at 15:01
  • @brasofilo We as well got the power to reopen the question :)
    – kaiser
    Commented Mar 13, 2013 at 15:18

1 Answer 1


You can use the filter hook sanitize_file_name for change the string. But I have no knowing about the check for the size image, but you get the string and can check for the values inside the string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.