Title: Change post comment button link
Last modified: March 30, 2021

---

# Change post comment button link

 *  Resolved [baedyllion](https://wordpress.org/support/users/baedyllion/)
 * (@baedyllion)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/change-post-comment-button-link/)
 * Hello, I’m enjoying the plugin a lot, both free version and the premium version.
   But I need to solve a problem of mine.
 * I have a couple of code snippets I integrated with the plugin. One is I set a
   quota for the comments per post as in If the post gets 5 comments , the comment
   form will not be displayed. Second is I prevented my users to comment more than
   once per post. It’s looking good so far but the problem is these rules are only
   applied when the page is refreshed. If a user does not refresh the page , he 
   can comment unlimited messages. So I’m looking for a way to solve this problem
   and the only think I could think of is change the post comment link. I was wondering
   If it is possible to change the link for post comment button.
 * I need this button to comment the message and refresh the page at the same time.
   
   Is it possible to achieve this? I’d really appreciate any help. Thanks in advance.
   Cheers

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [gVectors Support](https://wordpress.org/support/users/gvectorssupport/)
 * (@gvectorssupport)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/change-post-comment-button-link/#post-14252973)
 * Hi baedyllion,
 * >  I need this button to comment the message and refresh the page at the same
   > time.
 * Please follow the solution below:
 * 1. Put this code in the active theme JS files.
 *     ```
       jQuery(document).ready(function ($) {
          wpdiscuzAjaxObj.refreshPageWhenCommentPosted = function (r) {
             if (r.success) {
                location.reload();
             }
          };
       });
       ```
   
 * 2. Then put the code below in the active theme functions.php file:
 *     ```
       add_filter("wpdiscuz_comment_post", function ($r) {
           $r["callbackFunctions"][] = "refreshPageWhenCommentPosted";
           return $r;
       });
       ```
   
    -  This reply was modified 5 years, 2 months ago by [gVectors Support](https://wordpress.org/support/users/gvectorssupport/).
 *  Thread Starter [baedyllion](https://wordpress.org/support/users/baedyllion/)
 * (@baedyllion)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/change-post-comment-button-link/#post-14256789)
 * Hello,
 * Thank you for the quick reply. I did as you instructed. It’s working great now.
 * I appreciate the help.
 * Cheers.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Change post comment button link’ is closed to new replies.

 * ![](https://ps.w.org/wpdiscuz/assets/icon-256x256.png?rev=1076265)
 * [Comments - wpDiscuz](https://wordpress.org/plugins/wpdiscuz/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdiscuz/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdiscuz/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdiscuz/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdiscuz/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdiscuz/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [baedyllion](https://wordpress.org/support/users/baedyllion/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/change-post-comment-button-link/#post-14256789)
 * Status: resolved