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

post comment dont show the pdf file wordpress

we use Wordpress6.4.1 and I would like to add a PDF document in Post Comment. I do it but I can't open the document. do you have a solution?
Herve Boris's user avatar
0 votes
0 answers
19 views

Fake email address with comment

Someone is claiming that, there was a comment on their WordPress website made by a friend of mine which was derogatory. Their proof is a screenshot of the comment, which shows my friend's work email ...
Alex's user avatar
  • 101
0 votes
0 answers
22 views

Change comments ordering by custom value

I added functionality to vote (up/down) on comments. I store the votes data in a custom table: CREATE TABLE comment_vote ( comment_vote_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, post_id ...
Abid's user avatar
  • 143
2 votes
3 answers
57 views

WP Plugin: How to avoid db access for each comment?

I'm writing a WP plugin which enables voting for comments. To store the votes a custom db table wp_comment_vote is being used. CREATE TABLE wp_comment_vote ( comment_vote_id bigint(20) UNSIGNED ...
Abid's user avatar
  • 143
0 votes
0 answers
10 views

How can I have the old comments moderation panel i Gutemberg?

In the old days was possible to moderate the comments from the post (or page) edit side, but it was removed when Gutenberg become the default. I know I can still use it if I use the classic editor, ...
darthcharmander's user avatar
0 votes
1 answer
25 views

Remove links to the comments section

I need to remove links to the comments section from every post and page on the site. Links to comments look like this: These links appear: In the post's byline as a speech bubble icon with the ...
Dave's user avatar
  • 119
0 votes
0 answers
23 views

They pass comments, when I have disabled everything related to comments

In my wordpress site I have comments disabled, but even so I am getting comments, I imagine that it is hacking. How can I block, override, disable everything related to comments from within a plugin?
Miguel Angel Salas8's user avatar
0 votes
0 answers
39 views

Why nested REPLY not working in WP Comments?

<section class="postcomments"> <div class="comlist"> <h3><span>—</span>Comments<span class="comcount"><?php echo ...
WordCent's user avatar
  • 1,827
0 votes
0 answers
23 views

Add a toggle show/hide spam button in comments

Is there a way to insert a button in the comments that will toggle show/hide spam statuses in the current posts while leaving the other comments unchanged?
Marko Maki's user avatar
0 votes
1 answer
36 views

Show/hide comment status in front-end

Is it possible to put a button in the comments(front-end) that would show/hide comments that are in spam status in the current post?
Marko Maki's user avatar
0 votes
1 answer
91 views

How to remove website url field from comment form completely?

I have this in my functions.php /*Remove website field from comment*/ function xyzmark_remove_url($fields) { if(isset($fields['url'])){ unset($fields['url']); } return $fields; } add_filter('...
sanjay ojha's user avatar
0 votes
0 answers
34 views

How to remove h3 tag from the reply-title

I would like to remove the h3 tag on "reply-title" I tried the following code : ob_start(); } add_action( 'comment_form_before', 'my_comment_form_before' ); function ...
Olivier Pallme's user avatar
0 votes
1 answer
51 views

How to add embed image in comments?

I'm looking for a way to display the images when the commenter adds a simple link to this image (without plugin, without upload, nor activate TinyMCE). For now, when the commenter adds a link to an ...
dragoweb's user avatar
  • 249
0 votes
0 answers
47 views

Show/Hide comments

I added a snippet for a show/hide function for the comments under a post: function agwp_footerarea() { ?> <script type="text/javascript"> jQuery(document).ready(function( $ ) { var ...
BeeCee's user avatar
  • 5
0 votes
0 answers
14 views

Are there any drawbacks to using comments as a child post type?

I am planning on making a website for users to post help requests for companies to bet on. So I will have a post type "help request" and thought of using comments for storing the price offer ...
Rihards Egle's user avatar
0 votes
0 answers
61 views

Make comment textarea input un-required

Goal: I need to hide/disable the text-area comment field, and only display author field. I've succeeded in doing this with the code below. Problem: Text-area comment input is hidden, but is still ...
Unloving1507's user avatar
1 vote
0 answers
58 views

Add pending for reply comment in console WordPress

How do I add a pending comment option when writing a reply comment in WP Admin? Reply to a comment, but keep it in "pending" status. Not a comment left by a visitor, but a comment written by ...
UserUser-name's user avatar
0 votes
0 answers
32 views

Best method for comment section associated with different images?

I would like to create a site where users can upload images and then all users can make comments associated with this image. Because users can upload multiple images I cannot make a new wordpress page ...
jdbrown444's user avatar
0 votes
0 answers
19 views

Add functionality to block comment authors in the Comment edit pag

I want to add an additional button to the Comments edit admin page, allowing me to ban the ips or emails in one click. After clicking the button, it should probably lead me to the Comment Moderation ...
karmeljuk's user avatar
0 votes
0 answers
33 views

Restrict users to see only own comments and the post author's replies

I've chosen to use the default WP comments as private messages between readers/users and post authors, so that users are restricted to only seeing their own comments and the post author's replies. ...
Yurié's user avatar
  • 1,101
0 votes
1 answer
20 views

Customize the new comment notifications sent to the post author after the comment is approved

I use the code below to customize the email notifications of new comments sent to the post author. This works fine for unmoderated comments, but not for moderated ones. In general, all comments are ...
Yurié's user avatar
  • 1,101
0 votes
1 answer
26 views

Guests comment form - prevent duplicate email addresses

I am trying to prevent guests (not users) from posting comments on one single page if they fill in the same email address. My further goal is to collect their unique addresses for a contest (The best ...
futurebreeze's user avatar
2 votes
1 answer
134 views

How to add a custom field to the comments "Quick Edit" screen?

How do you add a custom field to the comments "Quick Edit" screen? The code below only shows on the posts quick edit screen: function tips_quick_edit_fields( $column, $post_type ) { ?> ...
Brian Smith's user avatar
0 votes
0 answers
29 views

Permissions error when I use my plugin to delete comments in the front-end

I recently created a plugin for WordPress that allows you to delete comments from a front-end post, with an undo delete function and without having to reload the page each time (Ajax). However, when I ...
user avatar
0 votes
0 answers
20 views

Get approved comments or comments that the author is me

This is how we can get the approved comments. $comments_query = new \WP_Comment_Query([ 'status' => 'approve', ]); And this is how I can get my comments. $comments_query = new \...
Steve Moretz's user avatar
0 votes
2 answers
187 views

Get Comment Text via REST API

Added Note that this process is in a WP plugin, using thw WP API, so I believe this is appropriate for this SO and should not be closed. The following REST call is used to get a specific comment: var ...
Rick Hellewell's user avatar
0 votes
3 answers
150 views

How can I filter the user avatar displayed in comments? - get_avatar_url filter works everywhere but not in comments

I have always used the get_avatar_url filter to alter the user avatar where it's printed. add_filter( 'get_avatar_url', 'my\plugin\filter_get_avatar_url', 10, 3 ); function filter_get_avatar_url( $...
Álvaro Franz's user avatar
0 votes
0 answers
15 views

How can I add a check and not send an auto-reply to certain comments if the user fills in a custom field?

I'm using custom fields in the comment form "Did you like this book?" and "yes" and "no" values. I want to send 2 different auto-replies to a comment, if the user selects ...
Andrey Miller's user avatar
0 votes
0 answers
36 views

Show success message on comment submit when email and name is not required field

As you know in WordPress when you select "author must fill out name and email" and the user submit a comment it shows "is awaiting moderation". But when name and email is not ...
saraee's user avatar
  • 1
0 votes
1 answer
27 views

Easily invalidate form in comment_post hook

$GLOBALS['test'] = 'a'; function comment_post_check($comment_ID, $comment_approved, $commentdata) { $GLOBALS['test'] = 'b'; } add_action('comment_post', 'comment_post_check', 10, 3);...
anjanesh's user avatar
  • 111
0 votes
0 answers
16 views

The last comments of a post for the author of that post

I have a project that is managed by several authors. Our comments section receives thousands of comments daily and we need each author to be able to view the latest comments received on their ...
Navid's user avatar
  • 1
0 votes
0 answers
17 views

Page to view single comment and all replies

I often have comments that get dozens of replies where users end up having a discussion. I want to show only a few replies for a comment on the post page and give an option to "view full thread&...
user1889580's user avatar
0 votes
0 answers
95 views

Add ACF Quick Edit Columns on Comments

I'm using ACF to add a custom field to all comments. It's an optional checkbox with categories that the commenter can use to categorize their comment, which we use for filtering later on. From within ...
patricko's user avatar
  • 101
-4 votes
1 answer
273 views

Undefined Function Fatal Error with Shortcode [closed]

I asked AI ChatGPT: Can you develop a wordpress shortcode to create a list of users of a certain role and for each one show if they commented on a certain post (counting how many comments they left)? ...
Simone Bionda's user avatar
0 votes
1 answer
91 views

TinyMCE in comment reply form showing toolbar but can't edit reply

I have added the TinyMCE editor for comments using comment_form_defaults hook with wp_editor. It works great for the comment form, but when replying to the original comment, the new comment form shows ...
David Pol's user avatar
0 votes
1 answer
44 views

Simple shortcode to check if a user has commented on a certain post

Hi all (mi first question on StackExchange, sorry in advance for my inability) I want to make a shortcode to check if the current user has commented on a specific post. I found this code as a starting ...
Simone Bionda's user avatar
0 votes
1 answer
130 views

How do you fetch the authors email or IP from /comments? (REST API)

Does anyone know how to get the email and IP for Wordpress comments using the REST API? The docs. Are the fields just not provided in the response? "author_url" is there. But not "...
baldest_programmer's user avatar
1 vote
0 answers
64 views

Error 403 when posting comments to a custom post type from a different page

Im trying to make a simple ticket support system by using custom post type, comments and a page. So it works like this, User creates a ticket with details and it's inserted into the custom post type &...
CruzZ's user avatar
  • 11
0 votes
0 answers
34 views

How stop the process of submitting a comment if a fields are empty?

How stop the process of submitting a comment if a field is empty? <form action="http://localhost/test/wp-comments-post.php" method="post" id="commentform" class="...
Sercan Sevinçer's user avatar
0 votes
1 answer
49 views

How to disable comments on new blog post, but allow on new products?

Under the discussion setting, when I uncheck the “Allow people to submit comments on new posts” setting; it is disabling comments on new blog post. But it is also disabling review section of any new ...
Deb's user avatar
  • 3
0 votes
0 answers
28 views

How to make comments reply work in my website?

I am trying to make the threaded/nested comments work in my theme, but wiht no success. Tried code snippets, custom js codes and other alternatives, but cant make it work. Already enqueued the scripts ...
Wanderson Silva's user avatar
0 votes
1 answer
35 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 ...
Rick Hellewell's user avatar
0 votes
1 answer
132 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'] ) ...
elegant-solutions's user avatar
0 votes
1 answer
100 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 ...
Rick Hellewell's user avatar
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 ...
Shahi John's user avatar
0 votes
1 answer
17 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 ...
Ali Afzali's user avatar
0 votes
1 answer
77 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? ...
Amit Singh's user avatar
0 votes
1 answer
676 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 ...
Jesse Nickles's user avatar
0 votes
1 answer
56 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.
idomskt's user avatar
  • 11
1 vote
1 answer
34 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 &...
Rick Hellewell's user avatar

1
2 3 4 5
38