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
403 unauthorized User cannot read non-approved comments
404 unknown_comment Unknown comment
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": 126661,
    "site_ID": 3584907,
    "comments": [
            "ID": 233117,
            "post": {
                "ID": 38111,
                "title": "Unlimited Premium Themes Now Included in the Premium Plan",
                "type": "post",
                "link": "https:\/\/\/rest\/v1\/sites\/3584907\/posts\/38111"
            "author": {
                "ID": 8083301,
                "login": "davidalankennedy",
                "email": false,
                "name": "David A. Kennedy",
                "first_name": "David A.",
                "last_name": "Kennedy",
                "nice_name": "davidalankennedy",
                "URL": "http:\/\/\/",
                "avatar_URL": "https:\/\/\/avatar\/219860d3117df777c48f475d25e24fdd?s=96&d=retro",
                "profile_URL": "http:\/\/\/davidalankennedy",
                "site_ID": 7787948
            "date": "2017-03-24T21:19:52+00:00",
            "URL": "http:\/\/\/2017\/03\/23\/premium-themes-in-the-premium-plan\/#comment-233117",
            "short_URL": "http:\/\/\/pf2B5-9UH%23comment-233117",
            "content": "<p>I realized I gave you the wrong information. Sorry about that! All themes support WordAds. That list are the ones that support more than the one or two standard ad slots.<\/p>\n",
            "status": "approved",
            "parent": {
                "ID": 233071,
                "type": "comment",
                "link": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/233071"
            "type": "comment",
            "like_count": 0,
            "i_like": false,
            "meta": {
                "links": {
                    "self": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/233117",
                    "help": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/233117\/help",
                    "site": "https:\/\/\/rest\/v1\/sites\/3584907",
                    "post": "https:\/\/\/rest\/v1\/sites\/3584907\/posts\/38111",
                    "replies": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/233117\/replies\/",
                    "likes": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/233117\/likes\/"
            "ID": 233114,
            "post": {
                "ID": 38451,
                "title": "A New WordPress App Update, Designed for the iPad",
                "type": "post",
                "link": "https:\/\/\/rest\/v1\/sites\/3584907\/posts\/38451"
            "author": {
                "ID": 103051684,
                "login": "scrappyyoga",
                "email": false,
                "name": "scrappyyoga",
                "first_name": "",
                "last_name": "",
                "nice_name": "scrappyyoga",
                "URL": "http:\/\/",
                "avatar_URL": "https:\/\/\/avatar\/cb2caec6d7253ce45be44fe660e6a146?s=96&d=retro",
                "profile_URL": "http:\/\/\/scrappyyoga",
                "site_ID": 109242490
            "date": "2017-03-24T20:13:23+00:00",
            "URL": "http:\/\/\/2017\/03\/24\/a-new-wordpress-app-update-designed-for-the-ipad\/#comment-233114",
            "short_URL": "http:\/\/\/pf2B5-a0b%23comment-233114",
            "content": "<p>Your updates have been stellar lately!<\/p>\n",
            "status": "approved",
            "parent": false,
            "type": "comment",
            "like_count": 3,
            "i_like": false,
            "meta": {
                "links": {
                    "self": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/233114",
                    "help": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/233114\/help",
                    "site": "https:\/\/\/rest\/v1\/sites\/3584907",
                    "post": "https:\/\/\/rest\/v1\/sites\/3584907\/posts\/38451",
                    "replies": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/233114\/replies\/",
                    "likes": "https:\/\/\/rest\/v1\/sites\/3584907\/comments\/233114\/likes\/"