WordPress 3.5 and the deathly auto-embeds

A few days ago I was searching my site for something and landed on this page about archiving tweets with IFTTT. It didn’t have what I was looking for, but as I was looking through it, I saw that the extract of my archive was formatted wrong. Instead of looking like this,

Before WordPress 3.5

it looked like this.

With WordPress 3.5

I assumed that WordPress was embedding tweets because of the Twitter URLs (this was correct) and that I’d find some switch in the WP admin pages to turn this off (this was incorrect). When I couldn’t find any such switch and my initial Google searches came up empty, I asked for help on Twitter and started digging through the WordPress source code.

I soon learned that this behavior goes by the name “auto-embed” or “oEmbed,” and that its functionality can be found—in part, at least—in wp-includes/class-oembed.php and wp-includes/class-wp-embed.php. The best explanation of what had happened to my post is found on this page in the WordPress Codex, where I learned that this behavior has been around since WP 2.9, and that it works this way:

All you need to do to embed something into a post or page is to post the URL to it into your content area. Make sure that the URL is on its own line and not hyperlinked (clickable when viewing the post).

The tweet URLs that were turning into embedded tweets were, in fact, on their own lines. But why hadn’t I run into this before? The Codex had the answer to that, too:

As of 3.5, Auto-embeds are automatically enabled and there is no setting to turn them off in the WordPress admin pages. Prior to 3.5, there was an “Auto-embeds” checkbox in Administration > Settings > Media SubPanel.

Apparently I had that option turned off back when it was still possible to do so. I have no memory of fiddling with any such checkbox—maybe it was off by default.

At this point, I had a explanation for the behavior, but no way to change it back to the way it was. Fortunately, friend of ANIAT Matt McVickar (who goes by the extra-long, reply-limiting handle @matthewmcvickar), came to my rescue by pointing me to this suggestion, which led to this plugin. I copied the code, saved it in a file called auto-embeds-disabler.php in the wp-content/plugins directory, and activated it in the WordPress Plugins admin panel. Soon my site was back to normal.

I, however, was not back to normal. I was pissed. Auto-embedding (which also works for Flickr, YouTube, and other media sites) is the kind of behavior that belongs in a plugin, and here I was, forced to install a plugin to get rid of it. Worse yet, the embedding was being done inside a <pre><code> block, which ought to be considered sacrosanct.

It’s dumbfuckery like this, more than the promise of a faster-loading site, that makes a baked blog so appealing. How wonderful it would be to have a site that can’t be messed up by someone else’s stupid decisions. Only by my own stupid decisions. Which are legion. Which is why I’m still with WordPress. It’s more fun to be pissed at someone else than at yourself.


3 Responses to “WordPress 3.5 and the deathly auto-embeds”

  1. ckunte says:

    You’re a nerd, and you know python, so what preventing you from running something like chisel1 to make it your own problem and not anyone else’s?

  2. Dr. Drang says:

    Chisel, Pelican, Jekyll, Hyde, Blogofile, Frank, … There are a million static blog generators in the Naked City, and there’s something I dislike about every one.

    Actually, the biggest sticking point is comments. I know I could move the old comments over to Disqus (in theory, anyway, I don’t know how well it works in practice), but I have no confidence that Disqus will be maintained.

  3. Andy Seabrook says:

    An eye opening piece of text. At least I can see how auto-embeds are supposed to work now, and I actually want them to, but for me they are not.

    I am on WP 3.5, the URL’s are on their own line, neither URL or shortcode method is working.

    If you get to hear of any reasons why they might not be functioning please let me know, I am just about to go through the motions of disabling plugins and installing the default theme if need be.

    I will come back to you for the sake of others if a light comes on during the process. Most irritating!

    All the best, Andy