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
9 votes
2 answers
7k views

Commenting in user profile page?

I am trying to build custom user profile with the guidance of this tutorial: How to make a WordPress profile page I have successfully implemented it to my theme, everything is working well. Now what ...
Towfiq's user avatar
  • 485
24 votes
5 answers
30k views

How to rearrange fields in comment_form()

Im using a custom filter to change the fields, but can´t figure out how to change the order of the fields in the comment form. Desired order: comment field (first/top) name email website This is ...
jrutter's user avatar
  • 343
10 votes
1 answer
5k views

Filtering the Admin Comments List to Show Only Comments from the Current User?

In the Comments page (/wp-admin/edit-comments.php), every logged in user can see all the site comments. I'd like the users to see only his/her own comments and the comments that are left to his/...
moonvader's user avatar
  • 332
10 votes
4 answers
48k views

Why are the comments disabled by default on my custom_post_types?

I am using a custom post type + taxonomies in a podcast solution for a client. The setting (settings >> discussion) for comments is set to "allow comments". When I add / edit posts under the "posts" ...
timshutes's user avatar
  • 1,010
10 votes
1 answer
20k views

Change HTML Produced by wp_list_comments()

I am developing a WordPress theme for which I would like each comment's timestamp wrapped in in a <span> element for the sake of styling it with CSS rules. However, the wp_list_comments() ...
marlakash's user avatar
  • 113
8 votes
4 answers
8k views

Removing the "Website" Field from Comments and Replies?

In an effort to combat comment spam, I'd like to hide or remove the "Website" field from the "Leave a Reply" section for page and site comments. I have no desire to increase others page rankings by ...
cpuguru's user avatar
  • 277
7 votes
1 answer
3k views

How to enable comments for pending and draft posts?

I have a custom post type with comments enabled. The comments metabox in the admin only appears when the post is published. I'm wanting to use the comments system as more of a discussion between ...
Andrew's user avatar
  • 1,163
7 votes
3 answers
5k views

Comment Walker vs. Comment Callback

I've been messing around with custom comments this week and I'm trying to figure out when I'd want to use a walker and when I'd use a callback... There's some things I can't quite figure out how to ...
Bryan Willis's user avatar
  • 4,419
6 votes
2 answers
12k views

Paginate result set from $wpdb->get_results()

Is there an easy way to paginate the result set coming from $wpdb->get_results()? I want to get a paginated list of a user's comments on the author_archive page - some of the users of the community ...
anu's user avatar
  • 9,552
3 votes
2 answers
255 views

Top Commenters: exclude admin

I'm using the following code in my function.php to display the top commenters in my theme: function top_comment_authors($amount = 5){ global $wpdb; $results = $wpdb->get_results(' ...
japanworm's user avatar
  • 567
34 votes
6 answers
42k views

Is there ANY way to remove comments function and section totally?

I don't want any comment querys to run. I don't wont anything about comments to be shown in wordpress admin area. Is this possible in any way? EDIT: Remove all links to the comments from admin bar, ...
Peter Westerlund's user avatar
21 votes
7 answers
8k views

setting comments off as default for pages and custom post types?

I want to turn the comments off by default with pages and custom post-types Initially I simply used conditionals in the comments display function to avoid displaying the block on these pages, but I ...
Mild Fuzz's user avatar
  • 4,180
6 votes
1 answer
7k views

How to limit users to one comment per post

I am using WordPress as a petition site and hacking the comments system to work as the petition signup. I would like to find out how I can limit a user to post only one comment per post. So far I can ...
cmsdeployed's user avatar
4 votes
1 answer
6k views

How to enable truly anonymous posting in bbPress forums? [closed]

I have bbpress-post-topics plugin installed so that my comments forms are replaced by a bbpress forum topic, it's working but I would like to enable anonymous posting. Currently, as you can see above,...
Dave Hilditch's user avatar
3 votes
1 answer
15k views

Comment form validation

How can I set the validation rules for the comment field? I change the value of commenter name/e-mail/homepage onmouseover and onblur (I use this instead of labels - so if the field is empty it ...
Kilgore_Trout's user avatar
2 votes
3 answers
277 views

Can I seperate comments from post?

I have a type of attachments that need full screen display. So, I need to put the comments form somewhere else. How can I tell WP those comments belongs to a post?
Jenny's user avatar
  • 1,757
1 vote
2 answers
19k views

Add Comment Custom Field

I searched a lot of thread regarding my problem, but unfortunately I found nothing works, and this my final option. I want to add some custom fields on my comment form. How can I do that?
markyeoj's user avatar
  • 507
1 vote
1 answer
241 views

disable comments if array exists

This is the code which is registering the function for rewrite_endpoints(): function wpa121567_rewrite_endpoints(){ add_rewrite_endpoint( 'comments', EP_PERMALINK ); add_rewrite_endpoint( 'stats', ...
agis's user avatar
  • 421
0 votes
1 answer
271 views

how to have 2 comments_template() in one post

I have an issue in my new theme. my website is about Education for teachers and students. every post belongs to one teacher that students can talk to her/him via comments. now, i want to add a special ...
sh.dehnavi's user avatar
0 votes
2 answers
513 views

How do you remove the ability for a user to make a comment or post on a page?

I am building a new website on Wordpress, and all my pages have the add comment box at the bottom. I wish fo rthis to be removed from pages such as Home, Contact Us, About etc etc, but want it to ...
Graeme Hutchison's user avatar
16 votes
5 answers
639 views

how to reduce the number of spam comments

I've got the Akismet plugin on my WordPress site but I've been getting more and more spammy comments (that get caught). I'm amazed at the number as the site isn't that popular and doesn't have much ...
tombull89's user avatar
  • 287
10 votes
1 answer
8k views

Approve comment hook?

I'm looking to send out emails to subscribers when a comment has been approved. The two actions in the Codex are: 1. add_action('comment_post', 'callback', $priority, $accepted_args); Where the ...
AlxVallejo's user avatar
  • 1,441
9 votes
1 answer
752 views

comment_post_ID 0 (cannot remove from dashboard)

Ran across something a bit odd that I haven't seen before. A client has a pretty active blog and uses Akismet (paid) to protect against spam. At least once a day, they're reporting a spam comment that ...
Zach's user avatar
  • 1,923
9 votes
1 answer
15k views

How to change "You must be logged in to post a comment."

Some of my users have mentioned that my site is confusing for them. As this is the case, I would like to actually make links to Login/Register for my unregistered visitors to quickly do so if they ...
Aidan Knight's user avatar
7 votes
2 answers
4k views

WP_Comment_Query pagination, delving into the unknown

I am aiming to pagination WP_Comment_Query(). It appears this is either taboo or there is no viable information about it online, not anything. Why? Is it possible? If so, how?
Christine Cooper's user avatar
  • 8,798
5 votes
1 answer
446 views

Writing a plugin that notify my friends of new post that mentions(@) them

For example, I write a new post with content "Today I'm happy, because I finally met the girl that @David told me about bla blah..." Once the post is published, there should be an email notification ...
Arch1tect's user avatar
  • 197
5 votes
2 answers
468 views

One comment per user per post but be able to reply to existing comments

I want to restrict my users to be able to comment only once per post but be able to reply to existing comments. How can I do that? I found this code which will do the half trick. With this code the ...
Michael Papadopoulos's user avatar
5 votes
3 answers
19k views

Post Comments using WP REST API v2 in WordPress

I am using an AngularJS application with WordPress backend. I am able to retrieve comments using WP REST API v2., using the following url /wp-json/wp/v2/comments?post=1324 But is there a way to post ...
Merlin's user avatar
  • 51
4 votes
1 answer
307 views

How to allow the reply link to remain on the comment form after I have reached my 10 nested comment limit?

Is there a way to allow the reply link to remain on the comment form after I have reached my 10 nested comment limit? I don't necessarily need nested comments I just need the reply link to be always ...
Pete's user avatar
  • 998
4 votes
2 answers
988 views

What are the current recommended best-practices for comments.php?

I'm getting ready to submit a theme to the .Org repo and wanted to make sure that everything is in ordnung. One of the biggest holes left in my design is the comments template. I've taken a look at ...
ZaMoose's user avatar
  • 1,670
4 votes
1 answer
6k views

How to add filter in "Comments" at the admin panel?

I found so many information and most of the tutorials only talk about adding filter in post/custom post only. I want to do something similar to this tutorial in 'Comments' area in admin panel. Add ...
user19815's user avatar
4 votes
2 answers
2k views

Get comments for more than one post

I would like to get all the comments for a group of post (not only one post. I tried $comment_args = array('number' => '14', 'post_id' => '10,20,30,40' ); $comments = get_comments($...
Francesco's user avatar
  • 283
3 votes
1 answer
3k views

Add comments meta fields to comments metabox on post edit screen

I have few custom fields in comment form. How can I add these fields to comments metabox? I divide my question on 3 parts: 1) How to remove url field and add custom comment fields to comment quick ...
anton's user avatar
  • 1,033
3 votes
2 answers
2k views

Disable wordpress comments API

We're using the disqus plugin on our wordpress site, so anyone commenting should have a login through disqus. Yet, I'm still seeing spammers trying to post through the regular comments API. They're ...
ChrisJ's user avatar
  • 133
3 votes
3 answers
3k views

How to make comment text field un-required?

My requirements are bit different I was able to hide email and website field with filter but what I want to know is there a way to make comment text un-required when I am giving comment without ...
Cid Ubaid's user avatar
3 votes
3 answers
2k views

Linking comments from registered users to their profile pages

I am trying to find a way to link the 'username' in comments from registered and logged in users to their profile pages instead of their website URL. And comments from unregistered users to their ...
theshorttree's user avatar
3 votes
1 answer
3k views

Can I store my custom comment_type into wp_comments table?

I'm developing a system where a post can have multiple replies/feedbacks. As of now I's storing each of the comments as a serialized postmeta. But just today I figured out that I can use the existing ...
Mayeenul Islam's user avatar
3 votes
2 answers
2k views

Disable Comments Feed

I am working on a private site where the comments need to be hidden. I know how to remove the comments feed from the header, but can anyone give me some instructions on how to disable the comments ...
weston deboer's user avatar
3 votes
1 answer
3k views

How to remove or replace the log-in link for comment replies?

I need to edit the function get_comment_reply_link() in wp-includes/comments-template.php. All I really wanna do is take out the "log in to reply" text is puts in every comment for logged out users ...
Pollux Khafra's user avatar
2 votes
2 answers
2k views

count number of user comments with a specific comment meta value

I am using the code below to count the number of comments by a certain user: global $wpdb; $count = $wpdb->get_var( 'SELECT COUNT( comment_id ) FROM '. $wpdb->comments .' ...
whiteletters in blankpapers's user avatar
2 votes
1 answer
915 views

Allowing logged in users to comment without moderation across a multisite installation

I currently do web admin for an internet community based on BuddyPress and Multi Site, and use the Comment author must have a previously approved comment setting to make it easier for users to comment ...
ToniWidmo's user avatar
  • 335
2 votes
3 answers
3k views

Add delete, approve, spam Links to Comments

Anyone know how to add quick comment moderation links for users who have permission to add/edit posts and comments? (Upprove / Unappove / Edit / Spam / Trash ). Note: in my comments.php I call the ...
Arg Geo's user avatar
  • 429
2 votes
1 answer
1k views

Exclude post_type from admin comments_list

I'm trying not to show comments from a certain custom post type int the comments list on the admin interface. I went to the "wp-admin/includes/class-wp-comments-list-table.php" and tried to play with ...
Bachir Messaouri's user avatar
2 votes
1 answer
692 views

"Leave a comment" link even when you can't

On http://wordpress.barrycarter.info/index.php/page/7/ I disabled comments for "USDCAD options vs CADUSD options arbitrage?", but it still has a "Leave a Comment" link. Clicking the link takes you ...
user avatar
2 votes
2 answers
2k views

Custom Field Added In Comment Form Not Showing In Edit

This is my code in functions.php for adding the custom field in comment form add_filter( 'comment_form_default_fields', 'add_phonenumber_field' ); function add_phonenumber_field($fields) { $...
Ruby Ann Rosales's user avatar
2 votes
2 answers
2k views

Update post date on every new comment?

I would like to update a post on every new comment, so that the Last Modified Date is always up to date on the sitemap. How can i do this? Thanks.
boorock's user avatar
  • 61
2 votes
2 answers
2k views

Getting $comments outside the comment template

I have a ajax request hooked on "template_redirect" (the ajax requests the post's url), and I want to display only the comment template: function get_comm(){ if(isset($_GET['get_my_comments'])): ...
Alex's user avatar
  • 1,081
2 votes
1 answer
1k views

Can't add default comments to custom post type

I am trying to add defualt comments to my custom post type. I have added to my supports argument: 'supports' => array('title','editor','thumbnail','tags','post-formats','comments','revision'), I'...
aido14's user avatar
  • 117
1 vote
2 answers
1k views

How can I allow editors to leave comments on posts that have not yet been published?

On my NFL football blog all users are allowed to make blog posts. New registrants are given contributor status. When users make a post it is reviewed by an editor, then the editor schedules the post ...
Travis Pflanz's user avatar
1 vote
1 answer
674 views

Change comments form title on a page by page basis

I'm looking to change the comments form title (my theme defaults this to "Leave a Comment" or "Leave a reply to"). I thought perhaps I could add a hook to comment_form_defaults but my snippet below ...
themerlinproject's user avatar