How to delete posts that does not have a thumbnail?

I have a problem with my blog. The thing is this, all the posts have a thumbnail in this address: wpbv_postmeta-->meta_key-->thumb

And several (A LOT) of posts don’t work, because I have made a script that takes videos from a website and publishes in mine.

So, I need to find (I have search in google and here but couldn’t find anything) a way to do this:

SELECT * FROM wpbv_postmeta WHERE meta_key='thumb' 

And with the results I have to find which images doesn’t exist anymore (they are alocated in a different website).

Once I have located all the images that doesn’t exist delete posts where that images are, with the help of post_id

Obviously I don’t want that you do all the work, but I have no idea how to do it, if you can explain it to me, or give me links to search will be awesome.

0

Leave a Comment