[Resolved] How To Remove URL Field From WordPress Comment Form

Home Forums Support [Resolved] How To Remove URL Field From WordPress Comment Form

Home Forums Support How To Remove URL Field From WordPress Comment Form

Viewing 15 posts - 16 through 30 (of 31 total)
  • Author
    Posts
  • #629504
    Anoop Kumar Vaishya

    i have removed above code and now working fine

    #629505
    Anoop Kumar Vaishya

    one more question how to show only 10 comment in one time when there is more than 10 comment

    #629908
    Leo
    Staff
    Customer Support

    Can you open a new topic for a separate question?

    Thanks!

    #632207
    Narender

    It is easy. Just go to wordpress settings and then discussion. You can set your desired number to be displayed and sort accordingly

    #757156
    Bear

    Tom’s code is working. Thanks.

    #757172
    Tom
    Lead Developer
    Lead Developer

    Great to hear 🙂

    #1149960
    Ravi Dixit

    Hey, Tom!

    https://generatepress.com/forums/topic/how-to-remove-url-field-from-wordpress-comment-form/#post-589904

    I have tried the same code but it is not working for me…

    I am using Code Snippets Plugin to add this PHP code.

    #1149963
    Leo
    Staff
    Customer Support
    #1149964
    Ravi Dixit

    I don’t want to remove the email field.

    Only want to remove URL

    #1149966
    Leo
    Staff
    Customer Support

    What if you remove this line from the code?
    unset($fields['url']);

    #1149985
    Ravi Dixit

    It worked but also removed the Email…

    But I don’t want to remove email

    #1150613
    Leo
    Staff
    Customer Support

    Sorry so what if you remove this line from the code instead?
    unset($fields['email']);

    #1150986
    Ravi Dixit

    It is adding the URL field, and Email still not showing.

    #1150997
    Leo
    Staff
    Customer Support

    Can you try this exact code?

    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;
    }

    It’s working for me:
    https://wordpress-202309-991531.cloudwaysapps.com/?p=1

    #1151000
    Ravi Dixit

    I’ve added the exact code and but still not working… SEE here https://prnt.sc/qvx0u7

    Updated: After clearing the cache, it is working…

    Thanks for the help.

Viewing 15 posts - 16 through 30 (of 31 total)
  • The topic ‘How To Remove URL Field From WordPress Comment Form’ is closed to new replies.