Support » Fixing WordPress » Can you remove captions from images?

  • When I upload an image using the new image uploaded, it asks for a caption which is also the alt text. After adding the caption a grey box surrounds the image with the same caption text. Is there anyway I can stop that from happening? But I do want the alt text to come so I can’t keep the field empty

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have the same problem. I’ve seen certain posts saying that they fixed it but I haven’t been able to get rid of them yet. Does anybody have an answer for this?


    try this in the functions.php of your theme:

    function no_caption($deprecated, $attr, $content) { return $content; };
    add_filter('img_caption_shortcode', 'no_caption', 10, 3);

    You can change the CSS that adds the caption style so that it sets the display to none. In the styles.css file it is the stuff with .caption at the beginning.

    @monika: I tried your fix, but it nows give me the following code when I try to update a post in my editor:

    function no_caption($deprecated, $attr, $content) { return $content; }; add_filter(‘img_caption_shortcode’, ‘no_caption’, 10, 3);
    Warning: Cannot modify header information – headers already sent by (output started at /home/inspired/public_html/biggerboat/wp-content/themes/biggerboat/functions.php:2) in /home/inspired/public_html/biggerboat/wp-includes/pluggable.php on line 850

    Any thoughts? I’m on 2.7.1

    @curtismchale: I’m always a little loathe to use ‘display:none’ lest Google thinks the site is attempting to ‘keyword stuff’… am I being paranoid?


    This works:
    add_filter( 'disable_captions', create_function('$a', 'return true;') );

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can you remove captions from images?’ is closed to new replies.