Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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
15 views

How can I remove "Leave a comment" Section [closed]

I would like to remove a remove "Leave a comment" section at the bottom of my pages but I still need people to comment on my posts. I just like to be guided how I can just hyperlink the &...
user avatar
0 votes
1 answer
12 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 ...
user avatar
0 votes
1 answer
32 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 , '...
user avatar
0 votes
1 answer
27 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( '...
user avatar
0 votes
0 answers
8 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 ...
user avatar
  • 1
0 votes
0 answers
19 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 ...
user avatar
0 votes
1 answer
15 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 ...
user avatar
  • 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 ( '...
user avatar
0 votes
0 answers
16 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 ...
user avatar
  • 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 ...
user avatar
  • 117
0 votes
0 answers
15 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 ( $...
user avatar
0 votes
1 answer
33 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'); //...
user avatar
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' ); //...
user avatar
0 votes
0 answers
9 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.
user avatar
0 votes
0 answers
5 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 ...
user avatar
0 votes
0 answers
14 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....
user avatar
  • 1
0 votes
0 answers
10 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 ...
user avatar
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 ...
user avatar
  • 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 ...
user avatar
0 votes
1 answer
37 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 ...
user avatar
0 votes
1 answer
33 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 ...
user avatar
  • 119
1 vote
1 answer
30 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?
user avatar
0 votes
0 answers
18 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 ...
user avatar
0 votes
0 answers
49 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 = ...
user avatar
  • 83
0 votes
0 answers
70 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 ...
user avatar
  • 1
0 votes
0 answers
51 views

Re-Direct After Comment Submit IF Comment Comes from Sign-Up Page

After having successfully done a custom version of the WordPress comments form into a "sign up" page, I now need to re-direct the user to a custom page upon submitting the "form". ...
user avatar
0 votes
1 answer
27 views

How to block comments and pings?

Some scum are trying to post spam comments about viagra/casinos to my site. I have comments disabled at Settings > Discussion Somehow they manage to send comments and pings to my site. I want to ...
user avatar
  • 101
0 votes
1 answer
29 views

Changing the Comment Fields using Filter (without success)

Am I doing this all wrong or should this be working? No matter what post I visit, it's thrown into an endless loop.. This is the code: add_filter('comment_form_fields', 'comment_form_args'); function ...
user avatar
0 votes
0 answers
115 views

How to show comments from different Plugins to same post type?

I have two different comments, but both are related to the same post type. The first comments in this way: <?php if (isset($_POST['submit_tickets'])){ $tickets_reply = $_POST['...
user avatar
1 vote
1 answer
57 views

Trying to implement Ajax comments in WordPress, getting WP error

I'm trying to implement Ajax for my comments in WordPress, using this tutorial. But I'm running into issues when integrating the code from the tutorial into my own pre-built theme. The issue is that I ...
user avatar
0 votes
0 answers
17 views

Is there a way to only allow certain user ranks to comment on a post

I have a suggestion page on my WordPress site and I would like for a moderator to create comments giving updates on the progress. However, I only want that rank to be able to comment. Is this possible?...
user avatar
0 votes
1 answer
39 views

How to check if `comment_meta` exists before inserting the comment?

I am inserting comments via wp_insert_comment and while doing so I am adding email replies only. Now, I want to check if the comment is already present or not before inserting and if does exist do not ...
user avatar
0 votes
2 answers
52 views

How to get the `comment_post_ID`?

I have extracted the reply emails. The original emails are saved as CPT and work as Tickets in my plugin. I want the reply email to go as a comment to the original email. for($j = 1; $j <= $total; ...
user avatar
1 vote
1 answer
30 views

wp_comments table really big casuing /wp-admin/edit-comments.php to slowly load

Our wp_comments has millions of rows. When we load /wp/wp-admin/edit-comments.php it would timeout. Looking at mysql, this simple query is taking a long time SELECT wp_comments.comment_ID FROM ...
user avatar
  • 121
0 votes
0 answers
7 views

Show content if user left comment / non-logged visitors?

im trying to hide content/show content based on comments. i tried this to achieve what i want. but i want to hide/show content from non-logged visitors also.. this is my final code: // the user may ...
user avatar
0 votes
1 answer
18 views

Name of comment field differs on different sites

I have a question regarding the „name“ of the comment field of wordpress blogs. I have 2 sites, that are just available locally on my LAN. On the first site, if I inspect the comment field in firefox, ...
user avatar
  • 11
0 votes
1 answer
35 views

Who approved a comment, to show up in dashboard

About 10 years ago (!) this message was posted Find out which moderator approved comment? That perfectly works but I would like the "Approved by [---]" to show up in the "comments" ...
user avatar
  • 1
0 votes
0 answers
39 views

SQL command to delete "pending comments" doesn't work...?

This is the SQL command: DELETE FROM wp_comments WHERE comment_approved = 0 This, as you can see in the screenshot below, says that the operation was executed ok but no rows affected....which is odd ...
user avatar
  • 985
0 votes
0 answers
20 views

Post comments don't show

Recently I found out the post's comments don't display in post url. for example this post https://akhbarejadid.com/196055/ has more than 50 comments as you can see in image below I don't know when ...
user avatar
0 votes
0 answers
19 views

how to show comments only author which send own posts in wordpress

I am trying to make things work like where author can see only them post comment in admin comment section . While admin should have all permission. I am having author's post comments in comment ...
user avatar
0 votes
0 answers
18 views

How to add comments to my custom post type but hide it from default WordPress Comments section?

<?php if (isset($_POST['submit_tickets'])){ $tickets_reply = $_POST['tickets_reply']; $faqpress_tickets_comment_data = array( ...
user avatar
0 votes
0 answers
43 views

How to rename/change the comment labels in WordPress backend?

The screenshot shows what to change.
user avatar
0 votes
0 answers
22 views

How do I change where "You must be logged in to comment" directs users?

I've seen a few answers to this question on this site, but none are current and none are very well explained. Is there any definitive answer to this question? It seems like a lot of folks want to know!...
user avatar
0 votes
0 answers
33 views

How can I hide comment of the authors from their published posts?

How can I hide the comment of my authors about their own posts? I used plugins and it was successful, but the comments are displayed somewhere onthe posts of authors themselves and i cant do anything ...
user avatar
0 votes
0 answers
39 views

How to customize 'children comments' in Wordpress?

Hey i am using a callback for wp_list_comments. I took the Code from here - 5balloons.info/custom-html-for-comments-section-in-wordpress-theme/ Now children comments are out of main comment (means ...
user avatar
0 votes
0 answers
36 views

Modify author url display in edit-comments.php

On our site the author url is almost always an IP. I want to show a visual flag next to the IP url if it matches a certain pattern. I just need to understand how to modify the output in the author ...
user avatar
  • 103
0 votes
1 answer
55 views

How to remove some author fields from the edit comment page in wp-admin?

For a custom role, I've to remove/hide the email and URL fields in the author box inside the Edit Comment area in WP admin. Only the name field should be visible there. I've to keep the URL and email ...
user avatar
  • 101
0 votes
0 answers
53 views

comment_post (if comment is approved OR $comment_approved === 1) not working?

I am working on a code through which I can send emails to the user when his/her comments get approved. then I get to know about comment_post. but it is not working. comment_post is working for the ...
user avatar
0 votes
1 answer
58 views

Wordpress Spam Comment Filter

I would like to filter wordpress comment!! I've just little knowledge about Php. I write a simple code to filter spam comment. But, I failed. Below my code! Can you please help me? add_action('...
user avatar
1 vote
0 answers
26 views

Control panel loads slowly due to 2 slow queries on comment table

Our WP site’s control panel loads very slowly. Analyzing this with the Query Monitor plugin, I see that it is slowed down by two queries, both on the comment table. First one: SELECT comment_approved, ...
user avatar
  • 11

1
2 3 4 5
38