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

How can I change the 'Caption' text input to text area, to allow for multi line captions on media uploads?

share|improve this question

I don't think you can do that, however you can implement this code in your functions file to at least allow for line breaks in single image captions

Note: doesn't work for gallery images (I am trying to find a way to make it work in galleries)

Function to allow multi-line photo captions.
This function will split captions onto multiple lines if it detects
a "|" (pipe) symbol.
/* Override existing caption shortcode handlers with our own */
add_shortcode('wp_caption', 'multiline_caption');
add_shortcode('caption', 'multiline_caption');

/* Our new function */
function multiline_caption($attr, $content = null) {
'id' => '',
'align' => 'alignnone',
'width' => '',
'caption' => ''
), $attr));

if ( 1 > (int) $width || empty($caption) )
return $content;

if ( $id ) $id = 'id="' . esc_attr($id) . '" ';

$new_caption = str_replace("|", "<br />", $caption);

return '<div ' . $id . 'class="wp-caption ' . esc_attr($align) . '" style="width: ' . (10 + (int) $width) . 'px">'
. do_shortcode( $content ) . '<p class="wp-caption-text">' . $new_caption . '</p></div>'; }

Original code by Mark Wood: http://digitalnotions.net/multi-line-captions-in-wordpress

share|improve this answer
Did that work for you? If that's helpful, please accept! Thanks – Sol Mar 14 '12 at 20:51

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.