Home Forums Backend Issues (wp-admin) Image Captions in WYSIWYG


Image Captions in WYSIWYG

  • I am having an issue when adding media to the wysiwyg editor. I need the caption text to be displayed but it isn’t being added automatically the way it does in the main editor window. Is there a way to have the image captions added in the wysiwyg editors? Thanks!

  • Hi @CakeAndEatItDesigns

    Thanks for the bug report. Are you able to explain the issue with more detail? Perhaps with a screencast or screenshots to show the issue?


  • Ok, here goes for a more in depth explanation.

    In the standard content editor when you go to insert media and upload an image. You are able to add caption text to the image. Once you click the insert into post button this text is displayed in the editor under the image as a caption(and then on the frontend it displays as a caption as well).

    When I switch to the text view on the standard editor I can see a caption shortcode wrapped around the image.

    However, when I am using a WYSIWYG field from ACF and I click insert media and upload an image, the caption doesn’t get added to WYSIWYG editor.

    And I don’t see the caption shortcode if I view the text version of the WYSWIG editor.

    Does that help any? Let me know if there is more information you need. Thanks for the help! And thanks for the plugin, it is the most useful plugin in my toolkit!

  • Hi @CakeAndEatItDesigns

    I wasn’t aware of this issue. I’ll check it out and get back to you


  • Hi @CakeAndEatItDesigns

    After some research, I think the issue is acually a bug with WP 3.7

    Are you able to update WP to 3.7.1? This should fix the issue


  • Hi Elliot

    I’m having this issue as well. In the default WP Editor you get the “wp-cation” class added when the content is outputted to the site. With an ACF WYSIWYG editor it outputs the following:

    <dl id="attachment_166">
    <dt><img title="Steve van Doren / BBC News" alt="" src="" width="600" height="400"></dt>
    <dd>Steve van Doren / BBC News</dd>

    I think it should output:

    <div id="attachment_166" class="wp-caption aligncenter"><img class="size-medium wp-image-166 " title="Steve van Doren / BBC News" alt="" src="" width="600" height="400"><p class="wp-caption-text">Steve van Doren / BBC News</p></div>

    Any thoughts?

  • Hi @CakeAndEatItDesigns

    The wp-caption class is only given if the image has a caption. I’m guessing the image you have inserted into the ACF WYSIWYG field doesn’t have a caption.

  • Is there any more movement on this issue.

    When our users add an image to a custom field (using add media), then add a caption to it, the output after updating (saving) ignores the WP img_caption_shortcode functon, so the raw code gets displayed.

    (See: )

  • Bump!

    I’ve just discovered that I’m also having this problem. Captions added to images in WYSIWYG field are not being assigned the .wp-caption class as they would be via the built in editor and calling the_content()

    This isn’t a plugin or theme conflict, core and plugins all up to date as of todays date.

  • Bump!

    My captions for images added into wysiwyg fields have suddenly stopped appearing. A few days ago they were fine, I think, but today they are suddenly gone. In fact, WordPress is no longer wrapping the captioned images in a <figure> tag so the whole layout has gone awry. It is basically treating captioned images as uncaptioned images. I am not 100% sure it is not due to something I have done, but if anyone can give advice would be v grateful. All my plugins and theme etc are up to date. THe site is not live, it is on mamp, still being built.

    If I add an image in the standard (non acf) wysiwyg, captions do appear.


    I think I may have found the cause. Plugin called wp typography, if I deactivate it, the captions reappear. Not sure yet, maybe there is a compatibility issue.

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

The topic ‘Image Captions in WYSIWYG’ is closed to new replies.