I "successfully" regenerated my thumbnails using the Regenerate Thumbnails Plugin as I added a variety of new image sizes to my site; however, I'm having difficulty getting these new images sizes to actual display. When I inspect each image it is still showing the old image size path in the src="". I don't have any cacheing plugins running (this is on a staging server.) Could this be an .htaccess issue?

For example:

<img width="457" height="244" src="http://localhost:8888/example/wp-content/uploads/2012/10/ipad-mini-black1-457x244.jpg" class="attachment-large wp-post-image" alt="iPad mini" title="ipad-mini-black">

<img width="1200" height="640" src="http://example.com/staging/wp-content/uploads/2012/10/ipad-mini-black1.jpg" class="attachment-large wp-post-image" alt="iPad mini" title="ipad-mini-black">

As you can see, on my Local environment the image src is using the correct image sizes as at the end of the link it has the "456x244.jpg" crop, whereas on my Staging environment it is still using the original upload.

  • 1) Does the "old path" issue is solved? 2) Where do these <img src> are coming from, Content or Template? 3) For this kind of change (width, height and src) shouldn't have happened in the Content, unless you did it yourself. – brasofilo Dec 9 '12 at 20:46
  • 1) On my Staging environ, after running Regenerate Thumbnails Plugin and Search & Replace script, I would expect the staging environment to have a very similar image path as my local, for example: "/ipad-mini-black1-457x244.jpg" is the correct image name I want to be using as it's the new image size. 2) All of the images are being uploaded through the WP Upload interface, so I would image it would be a content/db issue? None of the images are hardcoded into my template. – Matt Dec 9 '12 at 20:56
  • Then, you need to inspect, search and research the database closely with PHPMyAdmin. – brasofilo Dec 9 '12 at 21:02
  • Ok - I will give that a try. – Matt Dec 9 '12 at 21:34
  • I wound up trashing the database in question, exporting a new copy from my local environment, and importing it into my staging site -- everything works great now. Thanks for the help :) – Matt Dec 10 '12 at 2:29

Regenerate Thumbnails won't do this for you. It simply builds all new sizes from your upload archives. The next image insertions will have the correct image source.

For your past posts, you need to run a search and replace in the database.

Of course, you need to make a proper backup and test the search and the matches before proceeding to any modification.

That said, this plugin is adequate for the task:

Search and Replace

A simple search for find strings in your database and replace the string. You can search in ID, post-content, GUID, title, excerpt, meta-data, comments, comment-author, comment-e-mail, comment-url, tags/categories and categories-description.

| improve this answer | |
  • I did a Search and Replace on my database and the image src is still showing up as the old images? The images aren't updating to the new image sizes that I added in my functions.php and calling into my template respectively. Any other ideas? – Matt Dec 9 '12 at 20:21
  • Is the src embedded into the content or being generated dynamically? Search and Replace is to correct urls written on the database. Add more details to your Question. – brasofilo Dec 9 '12 at 20:32
  • I just added more details to the question above. Let me know if you need me to further clarify. Thanks – Matt Dec 9 '12 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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