[Support request] Remove the website’s URL field in the comments section

Home Forums Support [Support request] Remove the website’s URL field in the comments section

Home Forums Support Remove the website’s URL field in the comments section

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2077654
    Torsten

    Hi.
    readers can also comment on my homepage.
    Can I remove the “website-url” field in Generatepress without a plugin?

    Thanks very much!

    Torsten

    #2077767
    David
    Staff
    Customer Support

    Hi there,

    this article explains removing fields from the comment form:

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

    To just remove the URL your snippet will look like:

    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;
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.