• Resolved exponeaacc

    (@exponeaacc)


    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.
Viewing 2 replies - 1 through 2 (of 2 total)
  • @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.

    Closed. No other concerns.

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

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