• hello,
    i want to remove the url field from the comment form, would you please explain how to do it?

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Leo

    (@leohsiang)

    Hi there,

    Try this snippet:

    add_filter('comment_form_default_fields','generate_disable_comment_url');
    function generate_disable_comment_url($fields) {
        unset($fields['url']);
        return $fields;
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Let me know 🙂

    Thread Starter marties

    (@marties)

    hi,
    i pasted it in functions.php but no luck, still appears…

    Theme Author Tom

    (@edge22)

    Hi there,

    Which method did you use to add the code?

    If you used Code Snippets, you may need to do this instead:

    add_action( 'after_setup_theme', 'tu_add_comment_fields_filter' );
    function tu_add_comment_fields_filter() {
        add_filter( 'comment_form_default_fields', 'tu_disable_comment_url' );
    }
    
    function tu_disable_comment_url( $fields ) {
        unset( $fields['url'] );
        return $fields;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘remove url from comment form’ is closed to new replies.