Use placeholders in comment form

/** * Change the comment area text * * @since 1.0.0 * @param array $args * @return array */ function ea_comment_text( $args ) { $args['comment_field'] = str_replace( 'textarea', 'textarea placeholder="Enter your message here"', $args['comment_field'] ); $args['fields']['author'] = str_replace( 'input', 'input placeholder="Your Name"', $args['fields']['author'] ); $args['fields']['email'] = str_replace( 'input', 'input placeholder="Your Email"', $args['fields']['email'] ); $args['fields']['url'] = str_replace( 'input', 'input placeholder="Your Website"', $args['fields']['url'] ); return $args; } add_filter( 'comment_form_defaults', 'ea_comment_text' );
Bill Erickson

Bill Erickson is a freelance WordPress developer and a contributing developer to the Genesis framework. For the past 14 years he has worked with attorneys, publishers, corporations, and non-profits, building custom websites tailored to their needs and goals.

Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk