• Been trying to get my head around how WordPress embeds work, mainly because I have a theme feature that adds embedding to comments (embeds from the whitelisted sources, YouTube etc…) and some of the more recently embed features are messing it up.

    As I was researching came across your plugin, so been testing it out and have a suggestion, add a Clear oEmbed Cache Feature.

    The issue is when the plugin is turned on, on sites that have previously embedded content the oEmbed cache still loads with the old data, but the iFrame part is hidden due to the relevant js file no longer being enqued. The plugin hides the content rather than removes it.

    Wrote a comment about it at http://stallion-theme.co.uk/understanding-wordpress-oembed-and-unknown-postmeta-entries/#comment-48290

    For those who use this plugin I suggest looking for a plugin like Oembed Cache https://ww.wp.xz.cn/plugins/oembed-cache/ which includes the ability to completely clear the oEmbed cache. I suggest after activating the Disable Embeds plugin, activate the Oembed Cache plugin and click the “Delete all embed cache” – “Seek and Destroy!” button. Then deactivate the Oembed Cache plugin (unless you want it’s other features).

    This will disable the WordPress 4.4+ embed features (via the Disable Embeds plugin) and the “Seek and Destroy!” button completely clears all cached embedded content and WordPress will rebuild the cache with the new settings (will only cache YouTube videos etc…).

    Note: if your site includes old content (created before WordPress 4.4) and you have plain text URLs on their own line to YouTube videos etc… after clearing the oEmbed cache WordPress will try to embed the YouTube URLs etc… If the URL are still valid the YouTube videos will be embedded.

    You could also use the Oembed Cache plugin if you ever decide to deactivate the Disable Embeds plugin. After running the Disable Embeds plugin for sometime your oEmbed cache will be propagated with unknown entries for any plain text URLs that link to sites that could be embedded (other WordPress sites for example). If you want those plain text links to now embed, you would have to clear the oEmbed cache first to rebuild the cache with the new settings.

    I have to say, I really do NOT like how WordPress handles embeds. Caused me no end of hassle this week, as a theme/plugin developer I post a lot of plain text URLs in posts/comments as code examples (in both pre and code tags and sometimes with no tags). After clearing the oEmbed cache some of my old code (pre WordPress 4.4) embedded: had to find them all and modify them one by one (plain text URLs inside code tags are not embedded, but within pre tags are!!!)! I really don’t like the semi-permanent PostMeta table entries concept.

    David Law

The topic ‘Clear oEmbed Cache Feature Suggestion’ is closed to new replies.