Regenerate Thumbnails
Attachments: Exactly what is going on. (1 post)

  1. wlindley
    Posted 5 years ago #

    After much digging into the internals of WordPress, I am confident to explain exactly what is going on with Attachments and sizes.

    When you upload an image attachment, WordPress makes various downsized images, according to the Media Settings (for thumbnail, medium, and large sizes) and also for whatever other sizes a plugin or theme registers through add_image_size(). Information about these, and only these, images is saved in the wp_postmeta table; where the post_id matches the attachment id, find meta_key equal to _wp_attachment_metadata and then the meta_value contains a serialized representation of the metadata. Look in the sizes array in the metadata and you will find the filename, width, and height for each downsized image.

    Running the Regenerate Attachments plugin does nothing more, and nothing less, than if you re-uploaded the attachments. The sizes array is erased and regenerated, and the downsized images (thumbnail, medium, large, and whatever others your theme or plugins have registered) are re-created.

    This plugin will not touch files for sizes which are not currently registered. This means: If you have images left over from previous media size settings, they will remain as-is. Specifically, if any of your posts or pages include a reference to such an "old" image, that image will NOT be re-created.

    This also means that if you use a theme or another plugin that manipulates the sizes array for an attachment, or any other image attachment metadata, that data will be lost. (Because _wp_attachment_metadata is re-created from scratch.)


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Regenerate Thumbnails
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

  • RSS feed for this topic
  • Started 5 years ago by wlindley
  • This topic is not a support question
  • WordPress version: 3.0.1