Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

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

comments_template() doesn't work with ajax call

I want to load comments by ajax. I can't call comment_template() functions using an ajax request. I don't want create a new query because I'll lost all inherited args (like all settings option in the ...
Stefano's user avatar
0 votes
2 answers
30 views

Hide comments from admin comments.php that user can't edit or manage

I am running into a problem in that I have users that can edit comments, but only those placed onto their own posts. Which is what I want. Unfortunately the edit-comments.php page shows all comments. ...
Klein's user avatar
  • 11
1 vote
1 answer
21 views

Allow unregistered users to post embeded images from other sites in comments

how can I allow unregistered users to post embeded images from other sites in comments? Right now the wordpress strips any image html tag for unregistered users. Thanks.
purpleyellow422's user avatar
0 votes
1 answer
23 views

Remove rel="ugc" from links in comments

I am trying to Remove rel="ugc" from links in comments, but nothing is working. I even tried Remove rel="nofollow ugc" from links in comments I also tried many plugins like: UGC ...
Jimmy's user avatar
  • 1
0 votes
0 answers
8 views

Paste URL In comment It auto turn to default title of page with link

Looking something like: when i comment a url on my wp post it will auto convert to its default title with hyper link. example: Right now when i comment URL https://www.google.com/ it looks like: https:...
Jimmy's user avatar
  • 1
0 votes
2 answers
28 views

Pre_get_comments and orderby comment_karma

I have ratings on a custom comment type that stores the ratings in the comment_karma meta of the comment. Now I want to pull up the comments for a specific user and sort them by rating. Here is what I ...
Aristocles's user avatar
0 votes
0 answers
15 views

How to hide newly added comments after 24h?

Hy would like to know how can I hide newly added comments after 24h? So in details what I would like to achieve is that when someone comment something his comment is visible 24h, after 24h that ...
LookaZD's user avatar
0 votes
0 answers
7 views

Posting a comment on a blog post loads another blog post and comment is linked to the new blog post

Each time a new comment is added to a blog post, another blog post is loaded, and the comment added is linked to the blog post loaded.
tbfp's user avatar
  • 1
1 vote
1 answer
55 views

Nofollow the date/time hyperlink in comment

Where the date and time of sending each comment is displayed in the comments, it is also a hyperlink. I want to nofollow this a tag. I was able to do this through this file in this path: wp-includes/...
Monoor's user avatar
  • 13
0 votes
1 answer
120 views

Remove rel="nofollow ugc" from links in comments

WordPress automatically adds rel="nofollow ugc" to all links posted in comments. In our case we use comments to link to relevant articles in a website and need them to be followed. How to ...
AJD's user avatar
  • 349
0 votes
1 answer
38 views

How to use: WP_AJAX_GET_COMMENTS

I just found out WP_AJAX_GET_COMMENTS($action) function to retrieve comments on WordPress. Someone know how to use it? Thank you so much Stefano
Stefano's user avatar
0 votes
0 answers
10 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
22 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
25 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
58 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
12 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
32 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
31 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
49 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,867
0 votes
0 answers
25 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
38 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
2 answers
347 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
65 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
112 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
1 vote
1 answer
104 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
61 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
1 answer
29 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,111
0 votes
1 answer
30 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
3 votes
1 answer
178 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
35 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
2 answers
309 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
272 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
1 answer
34 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
133 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
300 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
120 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
53 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
178 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
99 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
51 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
78 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
40 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
198 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
163 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
17 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
22 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
112 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
1k 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
61 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
2 3 4 5
39