Home › Forums › Support › Comment form: Add URL label but keep placeholder This topic has 3 replies, 2 voices, and was last updated 3 years, 5 months ago by Tom. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts October 28, 2020 at 10:47 am #1508292 George I want to add a URL field label but also keep the placeholder text on the URL field, like in the example provided. Is this possible? October 28, 2020 at 2:04 pm #1508533 TomLead Developer Lead Developer Hi there, You could try this: add_filter( 'comment_form_default_fields', function( $fields ) { $commenter = wp_get_current_commenter(); $fields['url'] = sprintf( '<label for="url">%1$s</label><input placeholder="%1$s" id="url" name="url" type="url" value="%2$s" size="30" />', esc_html__( 'Website', 'generatepress' ), esc_attr( $commenter['comment_author_url'] ) ); return $fields; } ); October 28, 2020 at 2:15 pm #1508541 George Perfect, it works, had to raise the priority: add_filter( 'comment_form_default_fields', function( $fields ) { $commenter = wp_get_current_commenter(); $fields['url'] = sprintf( '<label for="url">%1$s</label><input placeholder="%1$s" id="url" name="url" type="url" value="%2$s" size="30" />', esc_html__( 'Website', 'generatepress' ), esc_attr( $commenter['comment_author_url'] ) ); return $fields; }, 20 ); Thanks, Tom! October 29, 2020 at 9:55 am #1509883 TomLead Developer Lead Developer No problem! 🙂 Author Posts Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In