• Resolved siberkaynak

    (@senturkkserkan)


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

    how do i add the above function code as amp?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • @senturkkserkan You can apply that function as you would normally to your themes functions.php file or preferably a custom plugin. It will apply to both AMP and non AMP.

    If you are looking to apply that filter to AMP URLs only you can include the is_amp_endpoint function.

    function disable_fields($fields) { 
        if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
    	unset($fields['1']);
    	unset($fields['email']);
    	unset($fields['cookies']);
    	  }
        return $fields;
    }
    add_filter('comment_form_default_fields','disable_fields');
Viewing 1 replies (of 1 total)

The topic ‘edit amp comments section’ is closed to new replies.