Pixel dimensions included in image src URL (3 posts)

  1. ViscoDesign
    Posted 2 years ago #

    I recently used the WordPress Importer to transfer hundreds of posts to a new site. It all worked except that the images don't show up. After I looked at the code I noticed that all the src URLs include the pixel dimensions, as set in Settings > Media.
    So, instead of this:

    <img class="alignleft size-large wp-image-ID"

    I get this:

    <img class="alignleft size-large wp-image-ID"

    The problem is, if I regenerate thumbnails to fit my new theme design, all the image links are broken — because they include the old pixel dimensions.

    Maybe this is normal WP behaviour, but I can't imagine it would be. Otherwise how is anyone supposed to move posts (with images) between sites?

    Any thoughts on how I can fix this? Am I missing something obvious? Thanks!

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Did you use http://wordpress.org/extend/plugins/regenerate-thumbnails/ to regenerate your thumbnails?

  3. ViscoDesign
    Posted 2 years ago #

    Thanks for the response esmi. Yes I did use Regenerate Thumbnails, but that's where the problem lies.

    When I first imported all the posts, I noticed the image links in the posts had pixel dimensions at the end of the filename. So, when I regenerated the thumbs to fit my new design, all the images had broken links (1,500+ posts!). This is because the URL was looking for image-100x100.jpg and I now had image-200x200.jpg.

    is this how WordPress operates normally — automatically adding characters to image links? Or was it they way the users were importing the photos?

    Either way I'd love to find a solution. Find & Replace is not going to cut it obviously, because of the thousands of random sizes (all images were not identical sizes and were cropped proportionally.)

Topic Closed

This topic has been closed to new replies.

About this Topic