Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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:

Local:
<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">

Staging:
<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.

share|improve this question
    
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. –  Brian 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. –  Brian 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 :) –  Brian Dec 10 '12 at 2:29
add comment

1 Answer

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.

share|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? –  Brian 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 –  Brian Dec 9 '12 at 20:41
add comment

Your Answer

 
discard

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.