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.

502 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
91 views

How to hide "Trackback" on paginated comments

My Setup: On my Single's page I have used this comments_template('', true); to separate Trackback's & regular comments. The Heading "Trackbacks for this post" shows up only if a post has ...
user avatar
3 votes
1 answer
110 views

Why Allow Script Commands in Comments?

I noticed that if you are an admin or editor, you are able to put in script code like this in comments (not in the page/post editor) for admin/editor roles: <script>alert("Danger, Wil Robinson!"...
user avatar
3 votes
1 answer
1k views

How to move comments form above comments list in wordpress

Please help me modify code to move Comments form above comments list in a WordPress blow. Below is the code of comments.php page <?php /** * The template for displaying Comments. */ ?> <?...
user avatar
  • 31
3 votes
0 answers
126 views

Comment count wrong with orphaned comments

I have a news site set up with nested comments enabled. When a comment is marked as spam it is correctly removed from the article page however so to are any replies to that comment. This makes sense ...
user avatar
  • 41
3 votes
1 answer
63 views

How to enable comments options?

On page --> Screen Options --> check Discussion --> Discussion --> Allow commets --> I have checked on discussion options. Settings --> Discussion --> I have checked on Allow people to post comments ...
user avatar
3 votes
1 answer
162 views

WordPress comment count to include attachment comments

How can I make the comment count on a post on my index page include comments that have been made on, in my case, individual gallery pictures that are included in the post? It seems that comments made ...
user avatar
  • 41
3 votes
2 answers
699 views

How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?

I added the following to my functions.php: add_action('pre_get_posts', 'keyl_get_emp_posts'); function keyl_get_emp_posts($query) { if ($query->is_main_query()) $query->set('...
user avatar
  • 797
2 votes
2 answers
143 views

Threaded commenting: how to show threads by last active first?

Hi all and happy holidays! I have a page on which I enabled threaded commenting. At present, the comments are ordered new to old by when the thread started: -Comment 3 -Comment 2 -Comment 5 -Comment ...
user avatar
  • 143
2 votes
1 answer
1k views

Uncaught TypeError: Cannot read property 'firstChild' of null after upgrading to WordPress 5.5

I am getting the following error from comment-reply.min.js (which seems to be a WordPress file): Uncaught TypeError: Cannot read property 'firstChild' of null at comment-reply.min.js?ver=...
user avatar
2 votes
0 answers
34 views

Draft / schedule comments?

I’d like to be able to draft and schedule comments, similar to how you can with posts/pages. Anyone know the best way to achieve this?
user avatar
  • 21
2 votes
1 answer
35 views

Why do comment moderators need to have all create/edit/delete toboth posts and pages?

I struggled quitea bit to be able to set up my moderator account. Until I allowed all posts and pages capabilities and now the can finally moderate comments. I didn't deactivate one by one precisely ...
user avatar
  • 29
2 votes
0 answers
227 views

How to insert Comment metadata via REST API

I am trying to insert comment from my android app , i am using REST API and POST method /wp-json/wp/v2/comments/ The method is working great , but I would like to include metadata when inserting ...
user avatar
2 votes
1 answer
717 views

How to add a title field in comments?

Just like WP posts have title and text, I want to have titles to my comments. Now how do I add it and show them above the comment texts like a title. I need it to have a css name as well. The title ...
user avatar
  • 198
2 votes
0 answers
122 views

Comment pagination - How to show determined number of comments on the first page?

I set 10 comments for every page. If I have 20 comments, it shows 10-10 on the first and last page. However if I have 11 comments, it shows 1 comment on the first page. How to display 10 comments on ...
user avatar
  • 33
2 votes
0 answers
27 views

Disable Post/Page comment emails for creators

I have a Wordpress based blog with several admin users, and many pages with comments. There is a main email account set up for all comments to be emailed to. We have noticed that besides the main ...
user avatar
2 votes
0 answers
41 views

How to allow a particular role like Contributor be able to only view pending comments and approve them?

I want to allow Contributor role, of which does not have access to Comments (if it was allowed I disabled with adminimizer), to be able to view only Pending comments, and be allowed to approve the ...
user avatar
2 votes
2 answers
36 views

stackexchange-like submit comment window

I am developing my comments submission form and i would like to create sth like http://wordpress.stackexchange.com window ( the one i am writting now in) with B, I, add hyper-link and photo, and ...
user avatar
2 votes
1 answer
308 views

Restore trashed posts with comments

When a WordPress post is trashed, all the comments are trashed as well. I would expect the "undo" button to restore both the post and the comments. However, all the comments seem to just disappear : ...
user avatar
  • 21
2 votes
0 answers
42 views

Comments not nesed with custom template

I have a custom template for to show my comments. For some reason, there are not nested while looking in the back-end of Wordpress, I see that some comments have a parent. They are simply displayed ...
user avatar
2 votes
0 answers
60 views

Show top level comments ordered by number of replies

I am trying to modify the comment loop initiated by wp_list_comments to change the order they are returned. Specifically I have 2 levels enabled on my comments (top level and replies), and I want to ...
user avatar
2 votes
0 answers
205 views

changing comment-page-# to something like review-page-#

When you enable pagination for comments in wordpress the typical pagination page for a comment is "comment-page-1" "comment-page-2" etc. what I want is this to appear like "review-page-1" "review-page-...
user avatar
  • 21
2 votes
0 answers
1k views

How to import only certain comments from post[s]

NOTICE: This is solely NOT a WordPress.com Question, but related to WordPress Migration and Export-Import. I started blogging in WordPress.com and then shifted my blog to a self-hosted site. But even ...
user avatar
2 votes
1 answer
75 views

Disable comments

I'm wondering if there's any way to prevent users from leaving comments but still display the comments form? So, whenever a new comment is posted, it should be automatically trashed or it shouldn't be ...
user avatar
  • 2,040
2 votes
1 answer
92 views

Users with custom roles can't read each other's comments

My site has a custom role ("coach") with its own set of capabilities (via map_meta_cap along with a few built-in roles). Each user is assigned a page on the site that they "own" and can edit (via a ...
user avatar
2 votes
1 answer
725 views

edit_comment capability for subscriber

I have given my site's subscriber role the following permissions (unserialized DB-query): [subscriber] => Array ( [name] => Reader [capabilities] => Array ( ...
user avatar
  • 125
2 votes
1 answer
265 views

"Allow Comments" box cannot be checked

I've registered a custom post type, ensured that 'supports' has 'comments', and comments are allowed on new posts under settings -> discussion. I do see the check boxes for allow comments and allow ...
user avatar
  • 121
2 votes
1 answer
2k views

Retrieve comments from current post using SQL

I am trying to use this code below to auto-refresh comments but at the moment it is displaying all comments. I would like to only show comments for the current post. I am not very experienced with SQL ...
user avatar
  • 21
2 votes
0 answers
94 views

Display posts with comments closed, with pagination?

i'm using a custom query, which needs to display all posts with closed comments. I have this <?php $the_query = new WP_Query('showposts=-1'); ?> <?php while ($the_query -> have_posts()) :...
user avatar
  • 185
2 votes
1 answer
168 views

What filter/action hook can I use to add a few links to the admin comments page?

I would like to add a link to every comment when it's displayed in the recent comments admin page (edit-comments.php). For the sake of this question, the link should just be this: <a href="mailto:[...
user avatar
2 votes
1 answer
1k views

Allow contributors to moderate comments comments on posts they write

I run a multi-author wordpress site where we have a large number of contributors that can write articles, which are published after they are reviewed by an editor. (This is all standard wordpress ...
user avatar
2 votes
2 answers
2k views

How to remove these comments and html tags from the content?

These are actually input fields. paragraph is the textarea field. i query the contents from database and try to show them in this textarea field. But the textarea field is showing me unwanted comments ...
user avatar
1 vote
0 answers
28 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 vote
0 answers
33 views

Sending data from custom inputs in Wordpress comment form in the admin notification email

I have added a number custom inputs to the standard Wordpress comment form. Currently, I don't send these values to the database, but I know I can send this data to commentmeta table if I need to. I ...
user avatar
1 vote
0 answers
69 views

Display complete comment section via post ID

what I want to achieve: I would like to display the complete comments (including answers and the comment form) of a certain Page ID in the middle of my home page (I use WPBakery Page Builder). These ...
user avatar
  • 11
1 vote
0 answers
13 views

Can comments by a logged-in user be displayed at the top?

EDIT: I answered my own question! I was able to do this using 3 lines of CSS - thanks, flexbox! leaving this here in the hopes that it helps someone else someday :) .comment-list{display: flex; flex-...
user avatar
  • 11
1 vote
0 answers
151 views

Comments invisible after moving Wordpress to new server, while commenting still works

I moved a wordpress installation from one server to another. I dumped the DB, copied over all the files, put all DB data into a new database, changed wp-config.php to the new database info, and after ...
user avatar
1 vote
0 answers
48 views

Why does my callback function not work with this custom filter hook?

I'm trying to add a new key/value pair to my comment in the database by using a filter found in a WordPress plugin. This is the function where the filter is defined: /** * Parse comment before db ...
user avatar
1 vote
0 answers
26 views

"You must be logged in to comment" but I am already logged in

Latest WP running on RHEL 6.10 PHP version 7.2.21 MySQL is old and should be updated, but I doubt it's the reason. I have a Multisite setup going. I have a primary, call it blog.world.com, with a ...
user avatar
1 vote
0 answers
125 views

change wp_login url and redirect users at the same time

i use woodmart theme for my woocommerce shop. but in mag(weblog) page if a user want to submit a comment it redirects user to wp-login-url instead of woodmart login page. i found my first part answer ...
user avatar
  • 11
1 vote
0 answers
19 views

Customize Theme comment template to Insert VoteUp and VoteDown buttons

I am using a theme that has an okay comment template that I would not want to change. However I just want to insert voteup and votedown button directly below the User avartar <ul class="...
user avatar
  • 131
1 vote
0 answers
23 views

Most commented post showing 2 records

I am trying to show the most commented post. Only one post should show but I am getting 2 even though the number of comments is not the same? <?php $args = array( 'orderby' => '...
user avatar
1 vote
0 answers
20 views

Wordpress comments - how to check if comment still needs to be approved?

I created a comments.php template and which contains the following code: <div class="amb-single-comments amb-container-parent override"> <div class="amb-single-comments-...
user avatar
1 vote
0 answers
22 views

Email notification to an email address other than admin for custom type post comments in wordpress

I have a customer post type called video. I want wordpress to send an email notification to one user who is going to check and approve the comments, when ever someone comments on that post type video. ...
user avatar
  • 11
1 vote
0 answers
86 views

PAIN. Comments Pagination

Sorry for flame, but i wasted 7-12 hours trying to understand how comments pagination works.... Never thought that simple step will take that much with WordPress :'(((( i output comments in my theme ...
user avatar
  • 121
1 vote
0 answers
21 views

Display only 1 comment and then option to show more

I want to display only 1 comment and then have an option to "show more" to show the rest of the comments. The story behind this is that I've on the homepage a feed with cards for blog posts ...
user avatar
1 vote
0 answers
18 views

Wordpress comments_open for specific user role or post type

comments_open is used for both post types, posts and products, the snippet below worked and allowed only (example) role users to comment enter code here add_action( 'init', function(){ $u = ...
user avatar
1 vote
0 answers
13 views

Filter out other users comments. Visualize only own comments and editor role users' comments

I have a similar request as per question but I am totally not into php and would not know where to start to make such edits based on the answer provided. Would be great if anyone could help here. ...
user avatar
  • 11
1 vote
0 answers
68 views

Notify post author for a new comment on his post?

I have a "support" post-type(private) where comments are text replies. The member adds a new ticket and the conversation goes with the comments. Currently, everything is normal, but I want to extend ...
user avatar
  • 198
1 vote
1 answer
226 views

Update all comments time to random dates?

I found this code snippet which randomly changes all the dates for all posts. (Original Post : Update existing post dates to random dates ) <?php /** * Plugin Name: WPSE 259750 Random Dates * ...
user avatar
  • 11
1 vote
0 answers
120 views

Comment Pagination Behavior wp_list_comments() - comment ordering and pagination

I am using wp_list_comments with a callback function to display a list of all comments, and it's working well. I am then using paginate_comments_links to create pagination links, which is also ...
user avatar
  • 143

1
2 3 4 5
11