Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

comment 405

  • i get this warning that /wp-comments-post.php is getting 405 error
    Can you tell me why ?

  • Hi there,

    A 405 error indicates that the HTTP method used is not allowed for the requested URL. In the case of wp-comments-post.php, this usually occurs when the form on the page tries to submit a comment using an HTTP method (like POST) that the server is not configured to accept.

    Please contact your website host and let them check the server configuration to ensure that POST requests are allowed.

    Also check security plugins, as they may block certain POST requests as part of their firewall rules.

    There’re many other causes that I’m not familiar with, please check with your host.

  • I talked to the host- they are saying that the posts requests are enabled for this url. What the executive tells me is that “when you test with the browser you do a GET request – that is why you get a 405 response.” this is common for this kind of urls – is that correct?

    Currently i have these codes in the child theme related to comments
    Can you tell me if there is something in there that is not optimised or doing something wrong to what is intended?
    #Removing the <h3> tag from the “Leave a Comment” heading:
    add_filter( ‘comment_form_defaults’, ‘custom_reply_title’ );
    function custom_reply_title( $defaults ){
    $defaults[‘title_reply_before’] = ‘<strong id=”reply-title” class=”comment-reply-title”>’;
    $defaults[‘title_reply_after’] = ‘‘;
    return $defaults;
    }

    #Customizing the text for leaving a comment:

    add_filter( ‘generate_leave_comment’,’tu_custom_leave_comment’ );
    function tu_custom_leave_comment() {
    return ‘Your opinion is important here. Leave a comment’;
    }

    #Removing the author link and modifying the comment form fields (removing URL and email fields):
    add_filter( ‘generate_post_author_output’, ‘tu_no_author_link’ );
    function tu_no_author_link() {
    printf( ‘<span class=”byline”>%1$s <span class=”author vcard”>%2$s</span></span>’,
    __( ‘by’, ‘generatepress’ ),
    esc_html( get_the_author() )
    );
    }
    add_action( ‘after_setup_theme’, ‘tu_modify_comment_form_fields’ );

    function tu_modify_comment_form_fields() {
    add_filter( ‘comment_form_default_fields’, ‘tu_remove_url_email_from_comment_form’, 20 );
    }

    function tu_remove_url_email_from_comment_form($fields) {
    unset($fields[‘url’]);
    unset($fields[’email’]);
    return $fields;
    }

    #Removing the vcard class from the comment author:
    add_action(‘wp’, function(){
    remove_filter( ‘generate_comment-author_class’, ‘generate_do_comment_author_classes’ );
    });
    // add back the comment-author class that also got removed
    add_filter( ‘generate_comment-author_class’, function( $classes ) {
    $classes[] = ‘comment-author’;
    return $classes;
    },99 );

    #Disabling the comment date link:
    add_filter( ‘generate_add_comment_date_link’, ‘__return_false’ );

  • Hi there,

    None of the snippets are related to the issue. Do the comments still get posted even when this error appears?

  • yes, comments are posted

  • Do you have any security plugins active on the site? If so, try deactivating them to test, as these types of plugins tend to cause issues like this.

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