Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

nissimziv on "Bulk delete images while still using them as thumbnail (featured)"

$
0
0

I would like to delete all the images that were uploaded to posts and pages of a Wordpress site, while still using them as attachments/thumbnails (as featured images).
That’s why, I can’t bulk delete them from the media library, only from within posts and pages.
Since it’s a huge amount of images, I’d prefer using mysql command.
The string of the images is always written as follows - <img xxxx>, where xxx is varied based on the img location and other details such as alt, width and height etc.
The table is wp_posts and the fieldname is post_contnet
The closest command I came across to is –
UPDATE wp_posts SET post_content = REPLACE(post_content, '<img%>', '')
WHERE post_content LIKE '<img%>';
It doesn’t work.
Any clues?


Viewing all articles
Browse latest Browse all 8245

Trending Articles