Title: SQL to remove
Last modified: January 16, 2020

---

# SQL to remove

 *  Resolved [exponeaacc](https://wordpress.org/support/users/exponeaacc/)
 * (@exponeaacc)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/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!
    -  This topic was modified 6 years, 4 months ago by [exponeaacc](https://wordpress.org/support/users/exponeaacc/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [devnihil](https://wordpress.org/support/users/devnihil/)
 * (@devnihil)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/sql-to-remove/#post-12353907)
 * [@exponeaacc](https://wordpress.org/support/users/exponeaacc/) Unfortunately 
   we can’t offer support on custom code. Since we don’t want to take the risk that
   we break your website by suggesting incorrect or incomplete code, we cannot advise
   you on how to make such changes. Maybe someone watching these forums can assist
   you further, but if your topic is inactive for 7 days, we’ll mark it as resolved
   to keep the overview.
 * Thank you for your understanding.
 *  [Jerlyn](https://wordpress.org/support/users/jerparx/)
 * (@jerparx)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/sql-to-remove/#post-12371635)
 * Closed. No other concerns.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘SQL to remove’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Jerlyn](https://wordpress.org/support/users/jerparx/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/sql-to-remove/#post-12371635)
 * Status: resolved