SQL to remove
-
Hello! One of the developers made a mistake and instead of setting the default OG image for the whole site, he set the same picture for every post/page separately. Now we wanted to change the default OG for the whole site, but because he did it this way we have several hundreds of posts/pages with the same OG image set manually. I found out in the DB all the posts that have this image set with the following query:
SELECT * FROM 'dbname'.'wp_postmeta' WHERE (CONVERT('meta_key' USING utf8) LIKE '_yoast_wpseo_opengraph-image' AND CONVERT('meta_value' USING utf8) LIKE '%image_name.jpg%')
which gives me a list of few hundreds of posts/pages with this image set as the OG.My question is – what is a safe way of clearing these in bulk via SQL? Can I just remove the value from “meta_value” in “wp_postmeta” for these posts? Or do I need to clean something else too? Or should I rather remove the OG images manually for each post/page, because doing it in bulk like this isn’t very safe and I might miss some places?
Thank you!
The topic ‘SQL to remove’ is closed to new replies.