WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.)

share|improve this question
possible duplicate of Set custom name for generated thumbnails – brasofilo Mar 13 '13 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 Mar 13 '13 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 Mar 13 '13 at 15:01
@brasofilo We as well got the power to reopen the question :) – kaiser Mar 13 '13 at 15:18

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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