Support » Theme: OceanWP » remove website URL input from comments section

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    Please add the below code in functions.php file of your child theme.

    function oceanwp_modify_comment_form_fields( $fields ) {
        $commenter = wp_get_current_commenter();
        $fields['author'] 	= '<div class="comment-form-author"><label for="author" class="screen-reader-text">'. esc_html( 'Enter your name or username', 'screen reader text for comment author', 'oceanwp' ) . '</label><input type="text" name="author" id="author" value="'. esc_attr( $commenter['comment_author'] ) .'" placeholder="'. esc_attr__( 'Name', 'oceanwp' ) .'" size="22" tabindex="0" class="input-name" /></div>';
        $fields['email'] 	= '<div class="comment-form-email"><label for="email" class="screen-reader-text">'. esc_html( 'Enter your email', 'screen reader text for comment author email', 'oceanwp' ) . '</label><input type="text" name="email" id="email" value="'. esc_attr( $commenter['comment_author_email'] ) .'" placeholder="'. esc_attr__( 'Email', 'oceanwp' ) .'" size="22" tabindex="0" class="input-email" /></div>';
        return $fields;
    }
    add_filter( 'comment_form_default_fields', 'oceanwp_modify_comment_form_fields' );
    Thread Starter Ali

    (@golali)

    Hi, thank you for your reply.
    I inserted the snippet and cleared cache. the only change was that now the website URL section shows the text “website” as a title instead of placeholder.
    Maybe some plugin is overriding settings? however I’m not using woocommerce or any plugin that affects comments section

    Abhishek

    (@abhikr781)

    Hi,

    Please add the below code and check.

    function oceanwp_modify_comment_form_fields( $fields ) {
        $commenter = wp_get_current_commenter();
        $fields['author'] 	= '<div class="comment-form-author"><label for="author" class="screen-reader-text">'. esc_html( 'Enter your name or username', 'screen reader text for comment author', 'oceanwp' ) . '</label><input type="text" name="author" id="author" value="'. esc_attr( $commenter['comment_author'] ) .'" placeholder="'. esc_attr__( 'Name', 'oceanwp' ) .'" size="22" tabindex="0" class="input-name" /></div>';
        $fields['email'] 	= '<div class="comment-form-email"><label for="email" class="screen-reader-text">'. esc_html( 'Enter your email', 'screen reader text for comment author email', 'oceanwp' ) . '</label><input type="text" name="email" id="email" value="'. esc_attr( $commenter['comment_author_email'] ) .'" placeholder="'. esc_attr__( 'Email', 'oceanwp' ) .'" size="22" tabindex="0" class="input-email" /></div>';
        $fields['url']    = '';
    
        return $fields;
    }
    add_filter( 'comment_form_default_fields', 'oceanwp_modify_comment_form_fields' );
    
    Thread Starter Ali

    (@golali)

    this one did the trick! thank you

    Glad to hear that the issue has been fixed!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘remove website URL input from comments section’ is closed to new replies.