Get a remote post ID via API given URL

by John Dee   Last Updated August 23, 2019 00:08 AM

Given you have a URL, how can you get the post ID of a post on a remote WordPress site?

As far as I can tell, you would have to:

HTTP GET /wp-json/v2/posts

And then look for your URL, but the problem is that this endpoint will only return 100 results by default.

I don't want to have to download the ENTIRE content of a site just to find the post ID of a given URL. In V1 you could submit a query, but I think that's been depreciated. Any better ways to do this?



Related Questions


Does pre_get_posts affect REST API responses?

Updated March 15, 2019 18:08 PM

Allow users to only CREATE one single (custom) post

Updated January 24, 2019 07:08 AM

Display post previews only to resistered users?

Updated April 04, 2015 06:03 AM


Wordpress restriction to the whole website

Updated July 11, 2016 08:03 AM