How to add text to comment form #content textarea?

You can filter 'comment_form_defaults' to change the textarea. You get an array with the default fields as argument:

add_filter( 'comment_form_defaults', 'wpse_67503_textarea_insert' );

function wpse_67503_textarea_insert( $fields )
{
    if ( /* your condition */ )
    {
        $fields['comment_field'] = str_replace(
            '</textarea>',
            'EXTRA CONTENT</textarea>',
            $fields['comment_field']
        );
    }

    return $fields;
}

Leave a Comment