You need to first download those external images then you can attach and set them as the post thumbnail.
To download and attach you can use the media_handle_sideload()
function.
I wrote a plugin that will search through all your posts and pages and download and attach any external image into the media library. It also has the option of setting the first image as the featured image.
Related Posts:
- Filter to remove image dimension attributes?
- Stop wordpress from hardcoding img width and height attributes
- How to automatically add rounded corners to thumbnails?
- WordPress adding scaled images that don’t exist (1536×1536 and 2048×2048)
- Is there a hook which fires after all thumbnails are generated?
- Featured image shortcode
- How to find attachment by it’s name?
- Cropped featured image replaces original image in gallery
- Image Scaling using get_the_post_thumbnail issue in WordPress
- Remove title attribute from images
- How to create thumbnails with a fixed width, so all of them will have the same width?
- How to limit number of images being printer out in “Set Featured Image” pop up?
- Black and White thumbnails
- How can I add the “Use as featured image” to a custom metabox?
- How to output placeholder image if no featured image set?
- Featured Images on Front Page
- Download button for Featured Image in every post – automatically
- Removing Title Tag from Thumbnails
- Show prev and next post links for parent post of current image in attachment page?
- Add a featured image in my theme?
- Get original image from thumbnail URL
- Featured Image .svg height and width 1px only
- How to check if user is uploading/setting an image as a featured image?
- Images are randomly deleted from server
- attach unattached featured images to respective posts
- Thumbnails are bigger in size than the original image
- Remove image classes from post thumbnail output
- Lazyload post thumbnails
- Exclude featured image from gallery in wp-admin
- Special purpose photos with each post
- SVG Featured image not shown in twitter
- Featured images not displaying at full resolution
- Big Image on Featured Post, Normal on Single Post
- offload media to external services [closed]
- Update old Post image metadata to ‘thumbnail’ wp_attached_file
- How to stop wordpress always displaying full-res images
- WP keeps looking up post thumbnail on https even though wp-config says http
- Images stopped loadding after adding SSl
- WordPress PNG compression issue
- How to replace images?
- Fixing image names for a site being restored
- Setup Featured image on all posts from thesis thesis_post_image custom field?
- Export xml use/import images from theme directory
- Get custom thumbnail sizes [duplicate]
- Should I not compress my jpeg files before uploading to avoid double compression?
- Custom responsive ‘featured image’ sizes
- Is it possible to preserve original images in order to change image size later?
- the_post_thumbnail(‘medium’) setting some images width=1 height=1
- Generating a certain sized thumbnail on the fly?
- How do you import images from a URL in your post?
- How to set uploaded image as featured image wordpress
- What can i do add title to ‘large’ image?
- Retrieve Image Attachments Getting Post Thumbnail Image First
- Height and width attribute not setting by the_post_thumbnail
- How to display original unmodified thumbnail
- How to force WordPress to upscale images?
- What sense makes medium_large_size_h => 0?
- How to set minimum required size for featured image?
- All Images not calling alt text
- How do I link a featured photo to it’s post?
- Hide Featured Image box – isn’t working?
- Can we use featured image as third party website image URL
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- Show (print) featured image all dimensions (height, width)
- Use default image as var
- add_image_size not working
- Serve different images per screen size and cache possible?
- Product Images Low Quality After Updating From WP 3.5 to 4 [closed]
- adding image to post thumbnail from another server
- Set Featured Image not opening – Stuck at loading
- Convert featured images into “product images”
- Resize uploaded images [duplicate]
- How to use the thumbnail size with catch_that_image
- Using different size thumbnails on different parts of my site… with functions.php?
- Thumbnail and image management
- attach several images to post + gallery
- my featured image of wordpress are not showing in the front end though image are uploaded in media library
- How to change Gallery image url in product page ? In function.php?
- How is called this thumbnail slider feature
- Custom image size not displaying with wp_get_attachment_image()
- How to use default image as featured image by implement some code in function.php
- How to delete original image file after upload and resize
- attachment_fields_to_save first parameter is null
- An error has occurred during the upload process in wordpress version 5.3.2
- Force WordPress to always generate a thumbnail for original image
- Show featured image in all posts
- Get post thumbnail in specific size
- I cannot upload images to post or the media library in wordpress
- featured image in custom poste type (backend)
- Custom Background for each page and post
- Using custom field to change alt text for a featured image
- Delete post if featured image is smaller than Y pixels by Y pixels
- How to display image thumbnails on the search results page?
- Declare global variable that can be used on other function
- Get custom size of thumbnails
- Url link to feature image in the portfolio [closed]
- Black and White Thumbnail in WordPress Gallery
- Making a thumbnail if there exist a link with. jpg or .png extension in WordPress
- Getting top Image From the Gallery and printing out a thumbnail with Exact Dimensions
- Edit multiple posts featured image