• Hi,

    I am working on my localhost and want to remove website field from the comment form by add_filter(). Please let me know if it is possible. I have used this filter

    function remove_comment_website_field($fields) {
    unset($fields[‘url’]);
    return $fields;
    }
    add_filter(‘comment_form_default_fields’, ‘remove_comment_website_field’);

    but nothing changes. So I think its not working.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @horendra,

    Thank you for reaching out,
    Currently, we do not have a filter that allows you to remove the website field from the comment form. Alternatively, you can use custom CSS to remove the website input, which is a simpler method. We will keep your suggestion in mind and might add the filter in the future. So, you can use the CSS below in Customizing > Custom CSS/JS > CSS Code instead of that filter:

    #respond .comment-form-url {
        display: none;
    }
    
    #respond .comment-form-email {
        padding-right: 0;
    }
    
    @media(min-width:780px) {
        #respond .comment-form-author, #respond .comment-form-email {
            width: 50%;
        }
    }

    Result: https://postimg.cc/mtbxpdtn.

    Please read this link for more information about the CSS/JS code on the customizer: https://docs.oceanwp.org/article/354-add-custom-css-and-js-to-your-website.

    Note: If you have any cache plugin or server cache(CDN / Browser Cache and Cookies and …), you need to clear its cache contents or disable them to see your changes. Also, remember to click on the regenerate all assets file and data in Elementor > Tools(if you have Elementor).

    I hope that helps.
    Best Regards

    Thread Starter Horendra

    (@horendra)

    Hello @shahin,

    Thank you for your reply. I was thinking if it can be done by filter and not by CSS but since this feature is not available right now so I hope this can be done in future. Till then, I will try this CSS.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove website field from the comment form’ is closed to new replies.