• Hello!

    I’m wondering if anyone knows of an easy way to change the image size in a bunch (200) posts? Basically they were all inserted as ‘full size,’ which generated code such as:

    <a href="https://domain.com/wp-content/uploads/2012/01/granola.jpg">
    <img class="alignnone size-large wp-image-5023" title="Granola"
    src="https://domain.com/wp-content/uploads/2012/01/granola.jpg"
    alt="" width="640" height="426" /></a>

    But what I really want is:

    <a href="https://cvps.codydehaan.com/wp-content/uploads/2012/01/granola.jpg">
    <img src="https://cvps.codydehaan.com/wp-content/uploads/2012/01/granola-1024x682.jpg"
    alt="" title="Granola" width="640" height="426"
    class="alignleft size-large wp-image-5023" /></a>

    Anyone know of anything that can help me out with this? Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter codydh

    (@codydh)

    Unfortunately that won’t work, because each image file has slightly different dimensions, and so just replacing them with a set string of text won’t work. What I really need is a plugin that can go in and fix the img src’s.

    Maybe with css?

    #content img {
        max-width: 640px;
        height: auto;
    }

    Thread Starter codydh

    (@codydh)

    Ah, right, this is a good solution for the display (although that’s not the issue). The problem is that the full resolution images are like 2MB, whereas the resized ‘thumbnail’ is like 256kb, so just HTML/CSS-resizing the images really slows down the page loads.

    I’ve never seen anything that can change your given embed code.

    might be worth checking out:

    ncode-image-resize

    Thread Starter codydh

    (@codydh)

    Right now it looks like what has worked is doing an export.

    I then find-and-replaced all size-full with size-large in the export file.

    Then I modified the WordPress code as per this: https://www.doc4design.com/articles/wordpress-better-naming-of-thumbnails/

    So now all of the large thumbnails, regardless of their actual resolution, will be called imagename-large.jpg

    And finally, once this big import is complete, I’ll do a SQL search through the database and replace the src=”…imagename.jpg” with imagename-large.jpg

    Sounds like a plan.

    Thread Starter codydh

    (@codydh)

    Just wanted to report back that this works!

    Perhaps this would be a good suggestion for the Import coders to make something along these lines an option by default, or perhaps that WordPress should use something other than hard URLs when inserting images?

    Nice, Glad you solved it.
    WordPress does have a way to get around hard coding individual image sizes, I’ve always used the galleries and auto generated attachment images which do have global size settings. Gallery plugins like NextGen also extend managenment of large numbers of pics.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Changing all image sizes’ is closed to new replies.