How to automatically search my entire site for any content embedded using oEmbed?

WordPress Development Asked by cag8f on December 6, 2020

How can I carry out an automatic search of all pages/posts on my site for any content embedded using oEmbed (preferably Facebook/Instagram content)?

The reason I ask is because this WPBeginner post says that on October 24th, all Facebook or Instagram content embedded on a site using oEmbed will be deprecated, and such content will be (slightly) broken. I’d like to first determine how much oEmbed content I have on my site. My site is has a relatively large amount of pages/posts (content added by others), so manually searching each will be a bit tedious.

Would I perhaps need to carry out a database search? Or a text search through all the files?

FYI my site uses Classic Editor throughought–not Gutenberg.


One Answer

In case anyone else wants to know the answer, I was able to find it elsewhere. If you run this SQL query on your database:

SELECT * FROM wp_postmeta WHERE (meta_value LIKE '%facebook%') OR (meta_value LIKE '%instagram%')

the search results will contain, in-part, a list of all posts with FB/IG oEmbed content. You may have to change the prefix wp_ to whatever prefix matches your database (I had to). And you also may have to specify your database name in the query. I tested that query and it indeed works as advertised. I'm also told that this SQL query might contain only a list of all posts with FB/IG oEmbed content (but I haven't tested it):

SELECT * FROM wp_postmeta WHERE (meta_value LIKE '%fb-root%') OR (meta_value LIKE '%instagram-media%')

One last thing is that the SQL query results indicated that my site had one post with FB oEmbed content. But when I opened that post, it didn't contain any rich oEmbed content (i.e. content described in this article, e.g. nice image, nice icon, nice text formatting, etc) All that exists on the page is a standard link to a Facebook page (screenshot). Because of this, I took no action to fix the issue--based on the description of the issue, this particular content will be unaffected.

See this post on the WordPress forums for more info.

Correct answer by cag8f on December 6, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP