WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes embedding an item via oEmbed is not possible, for example when a YouTube video has embedding disabled. The oEmbed service will return a 401 Unauthorized, and the code will not be converted.

Is there a way to notify the user of this? The current workflow is non-intuitive (at least to me), and I would prefer a message on the WordPress page, or even better, in the editor, saying that the object could not be embedded.

share|improve this question

Not possible with current code.

WP_oEmbed object goes extra mile (more like miles) to sanitize input so it is either html or boolean false. All errors with fetching are discarded on output, there are no filters in there and only error (hardcoded) it handles is 501 not implemented.

Earliest you can mess with this is somewhere down in HTTP API.

share|improve this answer
Maybe instead of hooking into the HTTP API, we could override the WP_Embed class, and let it use our own version of the WP_oEmbed class. We only need to override the $wp_embed global variable (and unhook the handlers set up in the constructor). But indeed, there is no easy support for this. – Jan Fabry Sep 20 '10 at 13:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.