Questions tagged [comments]

Comments allow your website's visitors to have a discussion with you and each other. When you activate comments on a Page or post, WordPress inserts several text boxes after your content where users can submit their comments.

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 views

How can comments be turned off for media attachments on Wordpress?

I want comments always turned off for media attachments. I wrote the following codes to accomplish this. But this code is not working. I've also reviewed many similar topics: Resource-1, Resource-2, ...
0 votes
1 answer
13 views

Replace Entire Comment Box with Text

I have a need to disable comments for a specific group of users. But I want to replace the entire comment box with a message like "Sorry, you are not allowed to enter a comment". Other users ...
0 votes
1 answer
16 views

Preferred method to get comment reply link for comments with a depth of 0

By default, get_comment_reply_link doesn't work for comments with a depth of 0, since the function contains the statement: if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] ) ...
0 votes
1 answer
19 views

comment_approved custom value

I want to modify comments with an additional 'comment_approved' value. This value will be used elsewhere in a plugin that uses wp_list_comments. Looking at the wp_set_comment_status function, I see ...
-1 votes
0 answers
18 views

How to convert my comment.html to comment.php

This is my comment form made by html..but I have no knowledge about php to make it dynamic in wordpress... <div class="mvrls-comment"> <h2>Leave a Comment</h2> ...
0 votes
0 answers
16 views

Comment turned Invisible

Please help me with this problem. People can comment, and the database shows the commented data. but the website is not displaying them. They are just showing blank space. (Just the username of the ...
0 votes
1 answer
10 views

get Discussion setting in wordpress

I am writing a shortcode for comments i need to know if admin wants users to logged in for commenting i need to know this option user must be registered and logged in for commenting is there any ...
0 votes
1 answer
13 views

How t Remove Labels from comment Box

I am learning to create custom theme. I have enabled default WordPress Comment for but I dont like how labels are appearing. Is there any way to remove labels and put placeholder text instead? ...
0 votes
0 answers
23 views

How to auto-generate names for guest users who leave comments?

Along with disabling the URL and email fields in comments, I'm experimenting with auto-generating random names (e.g. nicknames like "Harry" or "Larry") for guest users in order to ...
0 votes
1 answer
25 views

How to hide and disable URL and email fields from comments?

How can I hide and completely disable (in case of bots) the URL and email fields in comments? There are a few free plugins that seem to do this, but most of them only hide the URL field and not the ...
0 votes
1 answer
33 views

Auto delete WordPress comments

Is there a way to delete pending WordPress comments after X days? I looked into do_action( 'wp_set_comment_status', $comment->comment_ID, 'delete' ); but now sure how to take it from here.
  • 11
1 vote
1 answer
31 views

Are There Comment Text Revisions

Assume that users have the ability to edit their own comments. Or administrators can also do that. Do comments have revisions like posts and pages? If so, how would you access those revisions? The &...
0 votes
0 answers
16 views

Refresh individual comment text via API

Assume that I am viewing the comments on the front end. And that I have added a 'refresh' link next to the 'edit' link that appears because I am logged in as admin. I need to be able to refresh that ...
0 votes
0 answers
29 views

How to load new posts from wordpress db into wordpress homepage without refreshing the site?

4.5 Hasan Mahmud to Madhevere, no run 4.4 Hasan Mahmud to Madhevere, no run, good length delivery outside off stump, Madhevere defends off the back foot 4.3 Hasan Mahmud to Madhevere, no run, full ...
0 votes
0 answers
14 views

how show attachment image in comments query

I have a website where users can post comments for posts and attachments, with this code show last 3 comments in footer, comments for posts shown good with thumbnail as image but for attachments image ...
  • 1
0 votes
0 answers
11 views

displaying the last product comment in the woocommerce category

Good day! The task was set to display the last comment on woocommerce products in the parent category. Each product has its own last comment, if there are no reviews, nothing is displayed. As an ...
0 votes
0 answers
47 views

Why will comments not remain open on custom post types?

I have a WP install which makes use of default posts and of one custom post type (reviews). Discussion settings allow comments on both these post types. The comment form is present when viewing posts ...
  • 29
0 votes
1 answer
67 views

Delete/Spam Comment Button

To add a 'spam/delete' button to an individual comment, you can use code similar to this $link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->...
0 votes
0 answers
29 views

Allow / show post comments in category pages

Is there any way to allow the users of a website to write comments (and also see the already published comments) on one post when it's displayed in a category page? I'm not looking to let the category ...
  • 1
0 votes
1 answer
16 views

Check if user has comment on current post

Hello I have multiauthor website and I need to create a condition to check if defined user ( no current user ) has comment on current post. Here is my code but I can not complete this $userid = "...
0 votes
1 answer
75 views

reCaptcha doesnt appear in comment (manual or plugin)

I tried the following: https://www.quora.com/How-can-I-insert-Captcha-code-in-WordPress-theme-without-using-any-plugin https://codeforgeek.com/add-google-recaptcha-wordpress/ https://pluginsforwp.com/...
  • 61
0 votes
1 answer
25 views

How do I add <div> tags to entire comments, not just their text

Thanks to some wonderful help here at stack exchange, I have built a comment section with a dropdown menu that adds comment_meta to the comments. I currently have a working filter that uses GET to ...
0 votes
1 answer
33 views

wp_delete_comment takes two tries to delete - then deletes all comments

I'm trying to add a button to my comments that allows a user to delete them. I have a form declared like so: <form method="post"> <input type="submit" name="btn-...
0 votes
0 answers
10 views

Comment Reply Link Reloading Page Instead of Moving Comment Form [duplicate]

In my comments.php, I loop through the comments like this: if (have_comments()) : ?> <ol class="post-comments"> <?php wp_list_comments(array( '...
0 votes
1 answer
34 views

How to filter comments by comment_meta

EDIT: Yay, solved it! I needed to use new WP_Comment_Query( $args ) and set my $args to only include the current post and the meta chosen. Thanks! Thanks to the wonderful help of the community here, I ...
-1 votes
1 answer
57 views

Clicking Comment "Reply" Button only replies to first comment

I'm editing my comments.php, and within it I've added a reply button like this: <div class="reply"> <a rel="nofollow" class="comment-reply-link" ...
0 votes
1 answer
18 views

comments_where Hook

Is there a similar replacement of the hook posts_where for comments (WP_Comment_Query)? I need to modify the where clause for a comments query like it is shown in this tutorial (“4. Sub custom field ...
0 votes
1 answer
51 views

How to get comment images stored as serialized comment meta

I want to display images under for each comment but images store in database as serialized a:3:{i:0;i:775;i:1;i:776;i:2;i:777;} I wrote this code print_r (get_comment_meta( $comment->comment_ID , '...
0 votes
1 answer
36 views

Get all comments of author's posts

Hello I have multi author website. I want to display all comments of posts created by author in author page. Please help me. I found this code but fatal error <?php $args = array( '...
0 votes
0 answers
13 views

Prevent users to delete comments from trash

As told in the title, I am looking for a way to prevent users to delete comments from the trash. Only admins should be able to. I tested the scripts at: Function to prevent users from trashing ...
  • 1
0 votes
1 answer
24 views

Comment Table Size Results in Slow Page Loads and 500 Errors

I manage a small site that has a very active comment area. The site is on shared hosting. There is a daily post entry, then a robust comment area. It is not untypical to have more than 100 comments on ...
0 votes
1 answer
37 views

Rewrite comment form post ID on submit

I have a WordPress comment form, with a custom field (added with the Advanced Custom Field plugin) where the visitor can chose from a options (these are page IDs). When submitting the form, I want ...
  • 1
0 votes
0 answers
4 views

show comment with statuse

i show the user comments in profile page with below shortcode. so i need to show the comments status to that users can see that the camment are stay in what statuse add_shortcode ( '...
0 votes
0 answers
20 views

Wordpress comment processing . Default unapproved comments detection before posting

I am working on wordpress comment section. I understand that when we are posting some comments for example comments with many links, then WordPress storing this comment in to the database with ...
  • 25
0 votes
1 answer
16 views

Hide comments on specific pages, not just disable future comments

When I consult Google about how to remove or hide comments on certain pages, the answers seem to be "all or none." That is, there are plenty of explanations as to how to disable further ...
  • 117
0 votes
0 answers
19 views

Insert ads between comments

I want to insert ads between comments. function wpse_comments_ads_injection( $comment, $args, $depth ) { static $count = 0; if ( $count == 2 ) { echo "AD 1"; } if ( $...
0 votes
1 answer
76 views

get_query_var('paged') for WP_Comment_Query always return 1 when using paginate_comments_links()

I'm having a problem getting 'paged' query_var for my comments section in CPT post. I'm using this code to query comments: // Comments per page $comments_per_page = get_option('comments_per_page'); //...
0 votes
0 answers
4 views

comment_notification_text filter not working

I want to customize notification for post author when comment is posted. My code in functions.php is : //add notifications when comment add_action( 'wp_insert_comment', 'wp_notify_postauthor' ); //...
0 votes
0 answers
22 views

Why the internal link get converted into a comment?

Well, whenever I change my internal links, just out of nowhere a new comment is generated, so how can I prevent it from happening.
0 votes
0 answers
10 views

Sort post comments from newest to oldest in pagination

I searched for a whole day before asking this question, but couldn't find anything to help me. How can I sort the comments on all my posts from most recent to oldest? I made a custom theme and that's ...
0 votes
0 answers
17 views

Critical error - can't post comments

I've been building a website (not a professional and don't know much about coding). Everything looks good, except for I can't post comments on my blog posts. I get a "critical error" message....
  • 1
0 votes
0 answers
12 views

How to only show current user's comments and comments on current user's posts in wp admin

I want "Comments" in wp admin to only show comments that the current user made and comments made on current user's posts, also comment count should only show count for current user. How can ...
0 votes
0 answers
15 views

How to fix broken URL - https://mywebsite.com/comments/feed/

I ran a site audit on SEMrush and it says I have a ton of broken URLs that are https://mywebsite.com/comments/feed/ I have installed a plugin called Disable Comments running. How can I fix this issue ...
  • 1
0 votes
0 answers
10 views

How to make author comment name to "Editorial Staff" no matter which ever author is replying to comments from his/her account?

We know that by default WordPress shows the author display name in the comments. But I want to make make it turn the name to "Editorial Staff" for every author who posts comments from their ...
0 votes
1 answer
77 views

How to make comments private for commentor and post author

I am trying to make comments private. I mean comment must be visible for post author and comment author. I create custom comment section "better-comment.php". I have used pre_get_comments ...
0 votes
1 answer
40 views

How to delete post comments from the database via SQL statement?

So, I've taken over management of a Wordpress site that hasn't been maintained very well. We currently have approximately 12,000+ spam comments on various posts. The default UI isn't very helpful at ...
  • 119
1 vote
1 answer
47 views

count the total number of comments the user has received for his published posts

I want to count the total number of comments the user has received for his published posts. for example show: total comments of your all posts : 47 Is there a way to do this? Can you help me?
0 votes
0 answers
21 views

Count the total views of all user posts published

I have 1 essential questions I want to count the total views of all posts published by a user (login user). for example show: total view of your all posts: 485 Is there a way to do this? Can you help ...
0 votes
0 answers
102 views

How to output comments in Descending order by date using wp_list_comments?

I am using the following code to output comment html: $args = array ( 'post_id' => 805, 'status' => 'approve' ); $comments = get_comments( $args ); $comments_html = ...
  • 83
0 votes
0 answers
190 views

Oops! That page can’t be found

I have designed site juicerhunter.It was going well but suddenly an error is showing: “Oops! That page can’t be found. It looks like nothing was found at this location. Maybe try searching?” This ...
  • 1

1
2 3 4 5
38