I want to import into the media library, all the images & videos referenced in my blog posts.
get_attached_media()to get the images referenced on a page, even if they're not formally attached?
media_handle_sideload()to insert the media into the library?
I've moved hosts, all my blog posts are available and all my images are in
I have around 13,000 images across ~120 subfolders (10 years of blogging ☺).
Here's what I've tried that hasn't worked:
All I want is something to scan my posts, find any
<img src="https://example.com/..., then import that into the media library - leaving the media in the same location. Attachment to the post & regeneration of thumbnails would be a bonus, but not essential.