The NGFB WordPress REST API v2 module extends the returned /wp-json/wp/v2/posts (including custom post types), terms, and users JSON with a new head
array field consisting of html
and parts
arrays. The html
array includes all HTML meta tags as individual array elements, along with the Person / Organization JSON-LD scripts. The parts
array includes the individual components that make-up the HTML meta tags. Each parts
element contains an array of 6 elements describing the HTML meta tag (the 6th element is an optional comment).
Here’s a simplified REST API response example showing the new head
array field:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
{ "head": { "html": [ "<!-- og:image:1 --><meta property=\"og:image\" content=\"http://test.surniaulula.com/wp-content/uploads/2011/07/michelle_049-1200x1200.jpg\"/>\n", "<!-- og:image:1 --><meta property=\"og:image:width\" content=\"1200\"/>\n", "<!-- og:image:1 --><meta property=\"og:image:height\" content=\"1200\"/>\n", . . . "parts": [ { "1": "meta", "2": "property", "3": "og:image", "4": "content", "5": "http://test.surniaulula.com/wp-content/uploads/2011/07/michelle_049-1200x1200.jpg", "6": "og:image:1" }, { "1": "meta", "2": "property", "3": "og:image:width", "4": "content", "5": "1200", "6": "og:image:1" }, { "1": "meta", "2": "property", "3": "og:image:height", "4": "content", "5": "1200", "6": "og:image:1" }, { "1": "meta", "2": "property", "3": "og:image:cropped", "4": "content", "5": "0", "6": "og:image:1" }, { "1": "meta", "2": "property", "3": "og:image:id", "4": "content", "5": "766", "6": "og:image:1" }, . . . } |
Here’s a complete REST API response example showing the new head
array field:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
{ "_links": { "author": [ { "embeddable": true, "href": "http://test.surniaulula.com/wp-json/wp/v2/users/1" } ], "collection": [ { "href": "http://test.surniaulula.com/wp-json/wp/v2/posts" } ], "http://v2.wp-api.org/attachment": [ { "embeddable": true, "href": "http://test.surniaulula.com/wp-json/wp/v2/media?post_parent=3131" } ], "http://v2.wp-api.org/meta": [ { "embeddable": true, "href": "http://test.surniaulula.com/wp-json/wp/v2/posts/3131/meta" } ], "http://v2.wp-api.org/term": [ { "embeddable": true, "href": "http://test.surniaulula.com/wp-json/wp/v2/posts/3131/terms/category", "taxonomy": "category" }, { "embeddable": true, "href": "http://test.surniaulula.com/wp-json/wp/v2/posts/3131/terms/tag", "taxonomy": "post_tag" }, { "embeddable": true, "href": "http://test.surniaulula.com/wp-json/wp/v2/posts/3131/terms/post_format", "taxonomy": "post_format" } ], "replies": [ { "embeddable": true, "href": "http://test.surniaulula.com/wp-json/wp/v2/comments?post_id=3131" } ], "self": [ { "href": "http://test.surniaulula.com/wp-json/wp/v2/posts/3131" } ], "version-history": [ { "href": "http://test.surniaulula.com/wp-json/wp/v2/posts/3131/revisions" } ] }, "author": 1, "comment_status": "closed", "content": { "rendered": "<p>An example post with a large featured image (1600x1200px) of a beach at Big Sur, CA.</p>\n<p><b>Big Sur</b> is a sparsely populated region of the <a class=\"mw-redirect\" title=\"Central Coast of California\" href=\"https://en.wikipedia.org/wiki/Central_Coast_of_California\">Central Coast</a> of <a title=\"California\" href=\"https://en.wikipedia.org/wiki/California\">California</a> where the <a title=\"Santa Lucia Range\" href=\"https://en.wikipedia.org/wiki/Santa_Lucia_Range\">Santa Lucia Mountains</a> rise abruptly from the <a title=\"Pacific Ocean\" href=\"https://en.wikipedia.org/wiki/Pacific_Ocean\">Pacific Ocean</a>. Although it has no specific boundaries, many definitions of the area include the 90 miles (140\u00a0km) of coastline from the <a title=\"Carmel River\" href=\"https://en.wikipedia.org/wiki/Carmel_River\">Carmel River</a> in <a title=\"Monterey County, California\" href=\"https://en.wikipedia.org/wiki/Monterey_County,_California\">Monterey County</a> south to the <a class=\"mw-redirect\" title=\"San Carpoforo Creek\" href=\"https://en.wikipedia.org/wiki/San_Carpoforo_Creek\">San Carpoforo Creek</a> in <a title=\"San Luis Obispo County, California\" href=\"https://en.wikipedia.org/wiki/San_Luis_Obispo_County,_California\">San Luis Obispo County</a>,<sup id=\"cite_ref-1\" class=\"reference\"><a href=\"https://en.wikipedia.org/wiki/Big_Sur#cite_note-1\">[1]</a></sup><sup id=\"cite_ref-2\" class=\"reference\"><a href=\"https://en.wikipedia.org/wiki/Big_Sur#cite_note-2\">[2]</a></sup> and extend about 20 miles (30\u00a0km) inland to the eastern foothills of the Santa Lucias. Other sources limit the eastern border to the coastal flanks of these mountains, only 3 to 12 miles (5 to 19\u00a0km) inland. Another practical definition of the region is the segment of <a title=\"California State Route 1\" href=\"https://en.wikipedia.org/wiki/California_State_Route_1\">California State Route 1</a> from <a title=\"Carmel-by-the-Sea, California\" href=\"https://en.wikipedia.org/wiki/Carmel-by-the-Sea,_California\">Carmel</a> south to <a title=\"San Simeon, California\" href=\"https://en.wikipedia.org/wiki/San_Simeon,_California\">San Simeon</a>. The northern end of Big Sur is about 120 miles (190\u00a0km) south of <a title=\"San Francisco\" href=\"https://en.wikipedia.org/wiki/San_Francisco\">San Francisco</a>, and the southern end is approximately 245 miles (394\u00a0km) northwest of <a title=\"Los Angeles\" href=\"https://en.wikipedia.org/wiki/Los_Angeles\">Los Angeles</a>.</p>\n<p>The name “Big Sur” is derived from the original Spanish-language “el sur grande”, meaning “the big south”, or from “el pa\u00eds grande del sur”, “the big country of the south”. This name refers to its location south of the city of <a title=\"Monterey, California\" href=\"https://en.wikipedia.org/wiki/Monterey,_California\">Monterey</a>.<sup id=\"cite_ref-3\" class=\"reference\"><a href=\"https://en.wikipedia.org/wiki/Big_Sur#cite_note-3\">[3]</a></sup> The terrain offers stunning views, making Big Sur a popular tourist destination. Big Sur’s Cone Peak is the highest coastal mountain in the contiguous 48 states, ascending nearly a mile (5,155 feet/1571\u00a0m) above sea level, only 3 miles (5\u00a0km) from the ocean.<sup id=\"cite_ref-4\" class=\"reference\"><a href=\"https://en.wikipedia.org/wiki/Big_Sur#cite_note-4\">[4]</a></sup></p>\n<p>The name <i>Big Sur</i> can also specifically refer to any of the small settlements in the region, including <a title=\"Posts, California\" href=\"https://en.wikipedia.org/wiki/Posts,_California\">Posts</a>, <a title=\"Lucia, California\" href=\"https://en.wikipedia.org/wiki/Lucia,_California\">Lucia</a> and <a title=\"Gorda, California\" href=\"https://en.wikipedia.org/wiki/Gorda,_California\">Gorda</a>; mail sent to most areas within the region must be addressed “Big Sur”.<sup id=\"cite_ref-5\" class=\"reference\"><a href=\"https://en.wikipedia.org/wiki/Big_Sur#cite_note-5\">[5]</a></sup></p>\n" }, "date": "2015-06-06T14:18:19", "excerpt": { "rendered": "<p>An example post with a large featured image (1600x1200px) of a beach at Big Sur, CA. Big Sur is a sparsely populated region of the Central Coast of California where the Santa Lucia Mountains rise abruptly from the Pacific Ocean. Although it has no specific boundaries, many definitions of the area include the 90 miles […]</p>\n" }, "featured_image": 766, "format": "standard", "guid": { "rendered": "http://test.surniaulula.com/?p=3131" }, "head": { "html": [ "<meta name=\"generator\" content=\"NGFB Pro 8.7L +UM\"/>\n", "<meta property=\"og:url\" content=\"http://test.surniaulula.com/2015/06/big-sur-featured-image-example/\"/>\n", "<meta property=\"og:type\" content=\"article\"/>\n", "<meta property=\"og:locale\" content=\"en_US\"/>\n", "<meta property=\"og:site_name\" content=\"Surnia Ulula (Test)\"/>\n", "<meta property=\"og:title\" content=\"Big Sur Featured Image – Surnia Ulula (Test)\"/>\n", "<meta property=\"og:description\" content=\"An example post with a large featured image (1600x1200px) of a beach at Big Sur, CA. Big Sur is a sparsely populated region of the Central Coast of California where the Santa Lucia Mountains rise abruptly from the Pacific Ocean. #featured #image #large\"/>\n", "<!-- article:tag:1 --><meta property=\"article:tag\" content=\"featured\"/>\n", "<!-- article:tag:2 --><meta property=\"article:tag\" content=\"image\"/>\n", "<!-- article:tag:3 --><meta property=\"article:tag\" content=\"large\"/>\n", "<meta property=\"article:published_time\" content=\"2015-06-06T14:18:19+00:00\"/>\n", "<meta property=\"article:modified_time\" content=\"2015-08-17T18:45:12+00:00\"/>\n", "<!-- og:image:1 --><meta property=\"og:image\" content=\"http://test.surniaulula.com/wp-content/uploads/2011/07/michelle_049.jpg\"/>\n", "<!-- og:image:1 --><meta property=\"og:image:width\" content=\"1600\"/>\n", "<!-- og:image:1 --><meta property=\"og:image:height\" content=\"1200\"/>\n", "<meta name=\"twitter:domain\" content=\"test.surniaulula.com\"/>\n", "<meta name=\"twitter:title\" content=\"Big Sur Featured Image – Surnia Ulula (Test)\"/>\n", "<meta name=\"twitter:description\" content=\"An example post with a large featured image (1600x1200px) of a beach at Big Sur, CA. Big Sur is a sparsely populated region of the Central Coast of California. #featured #image #large\"/>\n", "<meta name=\"twitter:creator\" content=\"@jsmoriss\"/>\n", "<meta name=\"twitter:card\" content=\"summary_large_image\"/>\n", "<meta name=\"twitter:image\" content=\"http://test.surniaulula.com/wp-content/uploads/2011/07/michelle_049.jpg\"/>\n", "<meta itemprop=\"name\" content=\"Big Sur Featured Image – Surnia Ulula (Test)\"/>\n", "<meta itemprop=\"headline\" content=\"Big Sur Featured Image – Surnia Ulula (Test)\"/>\n", "<meta itemprop=\"datepublished\" content=\"2015-06-06T14:18:19+00:00\"/>\n", "<meta itemprop=\"description\" content=\"An example post with a large featured image (1600x1200px) of a beach at Big Sur, CA. Big Sur is a sparsely populated region of the Central Coast of California where the Santa Lucia Mountains rise abruptly from the Pacific Ocean. #featured #image #large\"/>\n", "<meta itemprop=\"url\" content=\"http://test.surniaulula.com/2015/06/big-sur-featured-image-example/\"/>\n", "<!-- image:1 --><meta itemprop=\"image\" content=\"http://test.surniaulula.com/wp-content/uploads/2011/07/michelle_049.jpg\"/>\n", "<script type=\"application/ld+json\">{\n\t\"@context\":\"http://schema.org\",\n\t\"@type\":\"WebSite\",\n\t\"url\":\"http://test.surniaulula.com\",\n\t\"name\":\"Surnia Ulula (Test)\",\n\t\"potentialAction\":{\n\t\t\"@type\":\"SearchAction\",\n\t\t\"target\":\"http://test.surniaulula.com?s={search_term_string}\",\n\t\t\"query-input\":\"required name=search_term_string\"\n\t}\n}</script>", "<script type=\"application/ld+json\">{\n\t\"@context\":\"http://schema.org\",\n\t\"@type\":\"Organization\",\n\t\"url\":\"http://test.surniaulula.com\",\n\t\"logo\":\"\",\n\t\"image\":\"\",\n\t\"sameAs\":[\n\t]\n}</script>\n" ], "parts": [ { "1": "meta", "2": "name", "3": "generator", "4": "content", "5": "NGFB Pro 8.7L +UM", "6": "" }, { "1": "meta", "2": "property", "3": "og:url", "4": "content", "5": "http://test.surniaulula.com/2015/06/big-sur-featured-image-example/", "6": "" }, { "1": "meta", "2": "property", "3": "og:type", "4": "content", "5": "article", "6": "" }, { "1": "meta", "2": "property", "3": "og:locale", "4": "content", "5": "en_US", "6": "" }, { "1": "meta", "2": "property", "3": "og:site_name", "4": "content", "5": "Surnia Ulula (Test)", "6": "" }, { "1": "meta", "2": "property", "3": "og:title", "4": "content", "5": "Big Sur Featured Image – Surnia Ulula (Test)", "6": "" }, { "1": "meta", "2": "property", "3": "og:description", "4": "content", "5": "An example post with a large featured image (1600x1200px) of a beach at Big Sur, CA. Big Sur is a sparsely populated region of the Central Coast of California where the Santa Lucia Mountains rise abruptly from the Pacific Ocean. #featured #image #large", "6": "" }, { "1": "meta", "2": "property", "3": "article:tag", "4": "content", "5": "featured", "6": "article:tag:1" }, { "1": "meta", "2": "property", "3": "article:tag", "4": "content", "5": "image", "6": "article:tag:2" }, { "1": "meta", "2": "property", "3": "article:tag", "4": "content", "5": "large", "6": "article:tag:3" }, { "1": "meta", "2": "property", "3": "article:published_time", "4": "content", "5": "2015-06-06T14:18:19+00:00", "6": "" }, { "1": "meta", "2": "property", "3": "article:modified_time", "4": "content", "5": "2015-08-17T18:45:12+00:00", "6": "" }, { "1": "meta", "2": "property", "3": "og:image", "4": "content", "5": "http://test.surniaulula.com/wp-content/uploads/2011/07/michelle_049.jpg", "6": "og:image:1" }, { "1": "meta", "2": "property", "3": "og:image:width", "4": "content", "5": "1600", "6": "og:image:1" }, { "1": "meta", "2": "property", "3": "og:image:height", "4": "content", "5": "1200", "6": "og:image:1" }, { "1": "meta", "2": "property", "3": "og:image:cropped", "4": "content", "5": "0", "6": "og:image:1" }, { "1": "meta", "2": "property", "3": "og:image:id", "4": "content", "5": "766", "6": "og:image:1" }, { "1": "meta", "2": "name", "3": "twitter:domain", "4": "content", "5": "test.surniaulula.com", "6": "" }, { "1": "meta", "2": "name", "3": "twitter:title", "4": "content", "5": "Big Sur Featured Image – Surnia Ulula (Test)", "6": "" }, { "1": "meta", "2": "name", "3": "twitter:description", "4": "content", "5": "An example post with a large featured image (1600x1200px) of a beach at Big Sur, CA. Big Sur is a sparsely populated region of the Central Coast of California. #featured #image #large", "6": "" }, { "1": "meta", "2": "name", "3": "twitter:creator", "4": "content", "5": "@jsmoriss", "6": "" }, { "1": "meta", "2": "name", "3": "twitter:card", "4": "content", "5": "summary_large_image", "6": "" }, { "1": "meta", "2": "name", "3": "twitter:image", "4": "content", "5": "http://test.surniaulula.com/wp-content/uploads/2011/07/michelle_049.jpg", "6": "" }, { "1": "meta", "2": "itemprop", "3": "name", "4": "content", "5": "Big Sur Featured Image – Surnia Ulula (Test)", "6": "" }, { "1": "meta", "2": "itemprop", "3": "headline", "4": "content", "5": "Big Sur Featured Image – Surnia Ulula (Test)", "6": "" }, { "1": "meta", "2": "itemprop", "3": "datepublished", "4": "content", "5": "2015-06-06T14:18:19+00:00", "6": "" }, { "1": "meta", "2": "itemprop", "3": "description", "4": "content", "5": "An example post with a large featured image (1600x1200px) of a beach at Big Sur, CA. Big Sur is a sparsely populated region of the Central Coast of California where the Santa Lucia Mountains rise abruptly from the Pacific Ocean. #featured #image #large", "6": "" }, { "1": "meta", "2": "itemprop", "3": "url", "4": "content", "5": "http://test.surniaulula.com/2015/06/big-sur-featured-image-example/", "6": "" }, { "1": "meta", "2": "itemprop", "3": "image", "4": "content", "5": "http://test.surniaulula.com/wp-content/uploads/2011/07/michelle_049.jpg", "6": "image:1" } ] }, "id": 3131, "link": "http://test.surniaulula.com/2015/06/big-sur-featured-image-example/", "modified": "2015-08-17T18:45:12", "modified_gmt": "2015-08-17T18:45:12", "ping_status": "closed", "slug": "big-sur-featured-image-example", "sticky": false, "title": { "rendered": "Big Sur Featured Image" }, "type": "post" } |