Doing this on your own is actually quite a lot of work. For the sole purpose of regenerating your custom image sizes I would recommend using this plugin:
It allows you to loop through your Image Library and regenerate the different image sizes that you selected.
Related Posts:
- Which filters or actions to use after a media upload and delete?
- add_image_size creating lots of images (of various sizes)
- WordPress won’t generate image sizes for certain images
- Site icons with alpha channel for self-hosted WordPress blog network
- Can I stop wordpress generating media sizes
- WordPress Media Library showing wrong preview size?
- Original image not saving?
- Issue with images which have no sizes available
- Images uploaded via Gutenberg image block are cropped
- Redimension thumbnail crop without creating new images
- No Thumbnails Generated
- How does WP media uploader create the 3 different sized images, and how can I duplicate it
- Reject upload of wrong-sized images using the Media Uploader
- How to delete resized (cropped) image uploads and prevent future resizing?
- How to show all available images in WP’s media library when using the Polylang plugin?
- Users can’t upload images on frontend if they haven’t got access to the wp backend
- Create image formats with different qualities when uploading
- Protecting direct access to PDF and ZIP unless user logged in (without plugin)
- How to restrict images in v3.5 Media Library modal to only those from a specific post id?
- Why are double-periods (“..”) invalid in a WordPress image filename?
- How can I speed up a slow loading media library?
- What to do with unattached logos and header uploaded via native wordpress uploader?
- How to prevent upload of a multiple sizes of images
- Impose a Maximum Limit on Image height and width upload size
- Force wordpress to see uploads folder media
- Append button to WordPress Image Details modal
- Add item to media library from blob or dataUrl
- Convert uploaded PNG to JPEG automatically
- WP3.5 Media Uploader – how to make it accept multiple images?
- WordPress function: limit size, only jpg, jpeg, limit of uploaded files per account
- Add new media uploader at frontend for wp 3.5+
- resize images not crop
- Trying to add filename over image in Media Browser
- How to disable WordPress Media resize different size version?
- Regenerate thumbnails after upload
- Media library storing files in uploads not folders within in uploads
- Adding a querystring to an image URL when clicking ‘insert into post’?
- Is there a limit on the number of attachments?
- How to host different file formats/types for a media attachment without creating multiple attachments?
- how to use media library [closed]
- Cannot upload .mp3 file to wordpress media
- HTTP Error when uploading files above 7mb unless using GD Image Editor
- Replacing Images in Media Library
- wordpress media library shows empty images
- WordPress Fancybox Resize Large Image
- Bulk edit of EXIF data for jpeg images uploaded in the media library?
- Restrict WordPress Media Library for a specific user role (users can only see/select own media)
- Error uploading image in WordPress
- Stop WordPress from generating redundant image size
- WordPress 4.9.8 Trying to add filename over image in Media Browser
- wordpress media upload given An error occurred in the upload. Please try again later
- Using wp_enqueue_media() with switch_to_blog() issue
- Media library only shows for admin. Doesn’t show editor or below [closed]
- Change media URL (images)
- Process uploads with phpThumb before generating thumbnails
- Redirect to another page using contact form 7? [closed]
- Large image upload size (using timthumb.php
- Storing WordPress Media Library Uploaded files onto a separate domain
- Media Library Won’t Display Any Images
- When does WP resize an image file
- Images are not showing up in “Uploaded to this post”
- Create a post from every image in my media gallery
- A link (not in the post) to download a specific PDF file
- More Fields & Media Upload
- How does wordpress handle media files?
- Set different max upload size limits based on file type/extension
- Change Image folder Locations
- Correctly using the root directory for media uploads?
- Resize uploaded original images to a minimum automatically
- What is the URL pattern for image thumbnails + sizes?
- Changing titles in Uploader for “Posts”
- How to detect when a file has been uploaded?
- Control resizing of uploaded images
- Multiple images are generated in WP-content in wordpress
- Removing extra large generated images disables all crops
- How Do I Change the File Permission For Uploaded Files in WordPress?
- MIME types not recognized by media library
- Restrict Users to Only Edit Media Owned by Users in Their Role
- unsharp thumbnails after uploading image
- image not display in media library and thumbnail not display in post
- Bulk upload images in upload folder does not show in media library
- Using Gravity Forms to upload media into library, then attach to post
- Issues with WordPress 3.9.6 media libraries on XAMPP
- Private file system for attachments
- How to split my uploaded media into directories?
- get the post thumbnail returns the full size
- Missing Images in Uploads Directory (Server Only)
- Metabox with file upload to custom directory
- How to force attachment size for every post
- Broken Media Library
- Transfered live site to new server and images are not showing
- Limit files uploaded per folder
- Is there a way to force Featured image to show as attachement?
- Link or button to open the media manager from frontend
- Bring up the media uploader on click
- How can comments be turned off for media attachments on WordPress?
- Question regarding the file path for media_sideload_image and wp_upload_dir()
- What does WordPress media uploader do to image files on upload?
- Upload to a specific media folder created by FileBird Lite
- Image in binary in the data to WordPress media library