Home Forums General Issues oEmbed for WYSIWYG


oEmbed for WYSIWYG

  • oEmbed doesn’t work for me on a WYSIWYG-field.
    Any suggests how to activate it?

    Many thanks in advance!

  • Hi @Finvaron

    Your statement is a bit bold.

    oEmbed does work with the WYSIWYG field, however, it may be possible that you are not using the correct ACF function to allow the oEmbed functionality.

    Can you post the code you are using?

  • Thanks elliot for your answer.
    I created a WYSIWYG field and use in the template files this code <?php the_field('nameoffield') ?>

    With the standard editor oEmbed works.


  • May I ask why you stated that it didn’t work then?

  • Sorry, my english isn’t very well, maybe thats the problem. I try it again:

    If i create a WYSIWYG-Field with ACF and call it in the template files with: <?php the_field('nameoffield') ?> oEmbed doesn’t work. It only shows the video url.

    But if i used the standard editor from WordPress and i paste a video url in it, the oEmbed works as expected and i can see the video on the frontend.

    Tanks in advance!

  • Hi @Finvaron

    Thanks mate, can you please post the URL that you are using for the oembed?

    I’ll do some testing on my end

  • I tried it with the following vimeo link:
    But any other link for example from youtube etc. doesn’t work for me too.

    Many Thanks!

  • Hi @Finvaron

    Just one more question, what version of ACF are you using?

  • I am having the same issue: links to youtube videos are not showing up as embedded videos, they only show as the link.

    I am using ACF and WP 3.5.2. I’m showing the content by applying the the_content filter on the get_field.

    It’s strange, some videos are showing up, but if I go in and resave the post, then the videos do not show up anymore.

  • Hi @robnero

    Thanks mate. I’ll be running some tests this week to solve this issue. Any links you can post to help me will be great (youtube links that work / don’t work)

  • In case this helps, I took a look at the database values of each of those links…

    Working link:

    • Has an “_oembed_…” entry in the postmeta table for each video in the post.
    • The main “content” ACF field does not include any paragraph html tags, it just has line returns in the table entry.

    Not working link:

    • Does not have any “_oembed_…” entries.
    • Has all the paragraph html tags, along with other html tags too.


  • Hi @robnero

    Just looked at the URL and the video seems to be working. Did you find a work around?

    Do you have any new info?

  • @elliot I edited the database entry to remove the html paragraph tags, and then they showed up again.

    Still broken here though:

  • Hi @robnero

    I can’t replicate the issue locally which means this issue is circumstantial – the hardest to find and fix!

    So, if the ACF WYSIWYG field saves the value with <p> tags around the url, then the url is not converted?

    Can you try and find the cause of the issue?
    Perhaps it is caused when saving in the HTML / Text view?
    Had you used the HTML button to edit the HTML?
    What if you delete the text, and paste in the url again on a new line?
    Any other plugins running on the WYSIYWG such as tinymce advanced?

    Any debug info will be great!

  • @elliot Sorry to bother you on this one. The only fix I have is to use the iframe embed code, and paste it into the html view of the wysiwyg. I don’t have any other plugins running on the field. Tried all the other tricks you listed. Any chance of chatting offline?

  • Hi @robnero

    Sorry mate, I don’t offer support outside of this forum.

    I think there is a chance that your theme could be conflicting with ACF and preventing the url from converting. Are you able to try on a fresh install?

  • Now it works for me!

    I installed the Add-on WordPress Wysiwyg ( That did the job!

    : Can you explain me the difference between the “WYSIWYG-Editor-field” and the “WP WYSIWYG field”?
    Thanks in advance!

  • Hi @Finvaron

    No worries.

    The default WYSIWYG field uses the JS tinymce object to instantiate the field. This allows it to work within a repeater field.

    The add-on WordPress WYSIWYG field does not use JS to create itself, instead if uses PHP (wordpress function) to create the editor. This however does not work within a repeater.


  • Hi! Oembed works for fields on category page? For me it doesn’t.
    I can show the field (I am using the code presented here ) but the link looks like a regular one (https://hereyoutubelink), doesn’t get transformed into iframe. Theme is twenty twelve.

  • This reply has been marked as private.
  • Hi @formgiver

    I’ve done some debugging and found that WP is preventing the embed preview.
    There is some code within the WP preview function that prevents the embed form being loaded / returned (during ajax call) if the post being edited does not exist.
    The post will never exist because you are editing a term, not a post.

    This security measure is stopping the preview from working, however, the embed should still work when outputting the value on the template. Can you test this?

    I’ve added this to my to-do and may be able to trick WP into thinking it is editing a post instead of a term!

Viewing 22 posts - 1 through 22 (of 22 total)

The topic ‘oEmbed for WYSIWYG’ is closed to new replies.