GET /sites/$site/comments/

Get a list of recent comments.

Resource Information

Method GET
Requires authentication? No

Method Parameters

Parameter Type Description
$site (int|string) Site ID or domain

Query Parameters

Parameter Type Description
context (string)
(default) Formats the output as HTML for display. Shortcodes are parsed, paragraph tags are added, etc..
Formats the output for editing. Shortcodes are left unparsed, significant whitespace is kept, etc..
http_envelope (bool)
Some environments (like in-browser JavaScript or Flash) block or divert responses with a non-200 HTTP status code. Setting this parameter will force the HTTP status code to always be 200. The JSON response is wrapped in an "envelope" containing the "real" HTTP status code and headers.
pretty (bool)
Output pretty JSON
meta (string) Optional. Loads data from the endpoints found in the 'meta' part of the response. Comma-separated list. Example: meta=site,likes
fields (string) Optional. Returns specified fields only. Comma-separated list. Example: fields=ID,title
callback (string) An optional JSONP callback function.
number (int) The number of comments to return. Limit: 100. When using hierarchical=1, number refers to the number of top-level comments returned. Default: 20.
offset (int) 0-indexed offset. Not available if using hierarchical=1.
page (int) Return the Nth 1-indexed page of comments. Takes precedence over the offset parameter. When using hierarchical=1, pagination is a bit different. See the note on the number parameter.
order (string)
(default) Return comments in descending order from newest to oldest.
Return comments in ascending order from oldest to newest.
hierarchical (bool)
(BETA) Order the comment list hierarchically.
after (iso 8601 datetime) Return comments dated on or after the specified datetime. Not available if using hierarchical=1.
before (iso 8601 datetime) Return comments dated on or before the specified datetime. Not available if using hierarchical=1.
type (string)
(default) Return all comments regardless of type.
Return only regular comments.
Return only trackbacks.
Return only pingbacks.
Return both trackbacks and pingbacks.
status (string)
(default) Return only approved comments.
Return only comments in the moderation queue.
Return only comments marked as spam.
Return only comments in the trash.
Return comments of all statuses.

Response Parameters

Parameter Type Description
found (int) The total number of comments found that match the request (ignoring limits, offsets, and pagination).
site_ID (int) The site ID
comments (array) An array of comment objects.

Resource Errors

These are the possible errors returned by this endpoint.

HTTP Code Error Identifier Error Message
403 unauthorized User cannot view post
403 unauthorized User cannot access this private blog.
403 unauthorized User cannot access this restricted blog
403 unauthorized User cannot read unapproved comment
403 unauthorized User cannot edit comment
404 unknown_comment Unknown comment
403 unauthorized User cannot read non-approved comments
400 invalid_context Invalid API CONTEXT
404 unknown_post Unknown post
400 invalid_number The NUMBER parameter must be less than or equal to 100.


curl ''
$options  = array (
  'http' => 
  array (
    'ignore_errors' => true,

$context  = stream_context_create( $options );
$response = file_get_contents(
$response = json_decode( $response );


    "found": 127130,
    "site_ID": 3584907,
    "comments": [
            "ID": 291364,
            "post": {
                "ID": 39056,
                "title": "The Best of Summer Edition",
                "type": "post",
                "link": "https:\/\/\/rest\/v1\/sites\/3584907\/posts\/39056"
            "author": {
                "ID": 42962821,
                "login": "furryfriendsfotos",
                "email": false,
                "name": "Helen Potter Photography",
                "first_name": "Helen",
                "last_name": "Potter",
                "nice_name": "furryfriendsfotos",
                "URL": "http:\/\/",
                "avatar_URL": "https:\/\/\/avatar\/aa74b3aaeceb627d87a0ed66cdd6a8c9?s=96&d=retro",
                "profile_URL": "https:\/\/\/furryfriendsfotos",
                "site_ID": 87058944
            "date": "2017-07-20T06:45:23+00:00",
            "URL": "http:\/\/\/2017\/07\/10\/best-of-wordpress-com-summer-edition\/#comment-291364",
            "short_URL": "http:\/\/\/pf2B5-a9W%23comment-291364",
            "content": "<p>Hi, hoping you can help. <\/p>\n<p>I have two WordPress sites but they have different menus!@ <\/p>\n<p>1.     <a href=\"http:\/\/\" rel=\"nofollow\">http:\/\/<\/a>   I can find sharing and add his Facebook page but on  <\/p>\n<p>2.     <a href=\"http:\/\/\" rel=\"nofollow\">http:\/\/<\/a>   the list if different. It does not give me an option for My sites and I can\u00e2\u0080\u0099t find sharing.  <\/p>\n<p>3.     Can you assist please? <\/p>\n<p>4.     Thanks Helen Potter<\/p>\n",
            "status": "approved",
            "parent": false,
            "type": "comment",
            "like_count": 0,
            "i_like": false,
            "meta": {
                "links": {
                    "self": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/291364",
                    "help": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/291364\/help",
                    "site": "https:\/\/\/rest\/v1\/sites\/3584907",
                    "post": "https:\/\/\/rest\/v1\/sites\/3584907\/posts\/39056",
                    "replies": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/291364\/replies\/",
                    "likes": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/291364\/likes\/"
            "ID": 283824,
            "post": {
                "ID": 39142,
                "title": "Join Us in the Fight for Net Neutrality",
                "type": "post",
                "link": "https:\/\/\/rest\/v1\/sites\/3584907\/posts\/39142"
            "author": {
                "ID": 124528225,
                "login": "huckleberrypiaward",
                "email": false,
                "name": "huckleberrypiaward",
                "first_name": "simon",
                "last_name": "says",
                "nice_name": "huckleberrypiaward",
                "URL": "http:\/\/",
                "avatar_URL": "https:\/\/\/avatar\/b17aa4d0836dcdae3ca543a5f43b2dd0?s=96&d=retro",
                "profile_URL": "https:\/\/\/huckleberrypiaward",
                "site_ID": 132175717
            "date": "2017-07-17T18:06:27+00:00",
            "URL": "http:\/\/\/2017\/07\/11\/join-us-in-the-fight-for-net-neutrality\/#comment-283824",
            "short_URL": "http:\/\/\/pf2B5-abk%23comment-283824",
            "content": "<p>I like your ethics!<\/p>\n",
            "status": "approved",
            "parent": false,
            "type": "comment",
            "like_count": 0,
            "i_like": false,
            "meta": {
                "links": {
                    "self": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/283824",
                    "help": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/283824\/help",
                    "site": "https:\/\/\/rest\/v1\/sites\/3584907",
                    "post": "https:\/\/\/rest\/v1\/sites\/3584907\/posts\/39142",
                    "replies": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/283824\/replies\/",
                    "likes": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/283824\/likes\/"