[Resolved] Disabling Website Field in Blog Comments

Home Forums Support [Resolved] Disabling Website Field in Blog Comments

Home Forums Support Disabling Website Field in Blog Comments

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1174897
    Michael

    Hi guys

    Please can you tell me if there is a snippet I could use (or some other means available) to disable/hide the Website field on blog comment forms?

    https://www.dropbox.com/s/cnhptmco67xwp9q/blog-comment-website-field.jpg?dl=0

    #1175128
    David
    Staff
    Customer Support

    Hi there,

    try adding this PHP snippet:

    add_action( 'after_setup_theme', 'tu_add_comment_url_filter' );
    function tu_add_comment_url_filter() {
        add_filter( 'comment_form_default_fields', 'tu_disable_comment_url', 20 );
    }
    
    function tu_disable_comment_url($fields) {
        unset($fields['url']);
        return $fields;
    }

    For reference: https://docs.generatepress.com/article/remove-e-mail-and-url-field-from-comment-form/

    #1175135
    Michael

    Awesome David – that worked, thank you very much. I really appreciate the assistance 🙂

    #1175306
    David
    Staff
    Customer Support

    You’re welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.