As posts can’t have parents, there is no endpoint to get the parent ID of a post.
However, pages can have parents, so the page endpoint should return a parent ID, among other things. So, by getting mysite.com/wp-json/wp/v2/pages
, you should be able to get the parent
attribute, which is “The ID for the parent of the object.” If you want just the parent, you could use _filter
in your request.
Related Posts:
- How to add category to: ‘wp-admin/post-new.php’?
- WP Rest API v2 filter and display latest post with specific tag
- WP REST API, query total posts in a category
- Get post from custom REST endpoint in Gutenberg
- WordPress Rest API – Get all posts based on post_meta on custom endpoint
- Disable REST API for a user ROLE
- ping_status in JSON REST API
- WordPress blog posts api – get posts by author
- WP rest api returns 404 only when author param is used
- Exclude posts w/ specific post_meta on Rest API endpoint
- Add ajax load more function using WP API
- Transfer WordPress post to RoR site: is the REST Api the only and/or best solution?
- WordPress REST API not returning all posts
- Exclude post_meta from Rest API Endpoint
- WP Remote Request not returning all of content via request
- Get more than one author’s posts with REST API
- How to create a post using REST API with sending data as a JSON body?
- How can I get the media inside a post?
- WordPress Rest API Create Post
- Call Web Services on post first publish
- Getting featured image with PHP and not javascript from wordpress api _embed [closed]
- search blog posts by author first name and or last name
- Creating a WordPress Post via REST API – HTML or Markdown?
- How to get post with associated categories and tags names instead of ids with rest api?
- What date to use as a post date? date_gmt or modified_date_gmt
- Custom wp-query in wordpress rest api
- Filter out posts based on a certain post_meta on the WordPress REST API
- Optimal WP Web App Backend for mobile app development
- Delete Post but retain image of post [WP REST API]
- Pull in posts using post meta for REST API
- Rest API Paginate until all posts are imported
- Add a field in my rest api
- How do I assign an attachment to a post using only the REST API?
- Updating post status via rest api
- exclude particular category in api
- Weird problem occurs while using WordPress REST API to create new post
- How to set the post permalink using the WordPress REST API?
- How to prevent post update using transition_post_status
- REST API Working for GET but not for POST?
- Loading posts outside wordpress
- How to create REST Based JSON API(how to modify the code below)?
- Best Way to detect unique posts in wp rest api
- WP Rest API feature image breaking react component
- Changes done in admin panel are taking time to reflect in the REST api responses
- Fetch All Posts (Including Those Using a Custom Post Type) With WordPress API
- How to add metabox for post of specific category
- Is there any way of copy/pasting, duplicating, or auto-generating posts for fast testing?
- How to get a post content from another wordpress blog/site?
- Exclude category on blog list page
- How can I group posts by date on frontpage?
- Hide comments awaiting moderation from user who submitted the comments
- How to add custom content (text/image) at start of content (IN content ie the same line)
- How to display sorted posts in the ‘All Posts’ page
- Get post excerpt and title by specific post ID?
- Will removing tags move Posts to Trash?
- JSON – Permission Error?
- Is it possible to change post id for an already added menu item in WordPress?
- WP Bakery Load More Button loads the same posts
- How do I retrieve then print the currently viewed sub categories?
- WP Query – Posts Per Page not working in combination with category__in
- How to convert contact form 7 submission to post after submission? [closed]
- How to render taxonomy in loop of custom post_type
- Posting blog entries in screenplay format
- get_the_category listing in hierarchial order
- How to automate featured posts number? [duplicate]
- Getting only the URL of the post thumbnail
- Linking to pages/posts within the site
- Displaying posts that belong to a specific author
- Importing posts only – consequences?
- Add Post As a menu Item
- Navigate through the posts using keyboard arrows
- unique post in “$args” of wp_query display more than one post
- New Posts and Pages Won’t Save
- Why excerpt is Displaying same in Random Posts list
- How can I add 2 buttons with shortcode
- Show posts on front page only
- My post does not show up
- Set Default Post as Parent Child (Nested) Relation
- Create a List of Widgets, where each widget holds three attributes
- How to automate creating pages on a hosted wordpress from a local set of folders?
- How to fetch courses in all languages in WordPress?
- How do you change the permalink for posts for a single category?
- post thumbnails error
- Disaply products from category
- Add another feature image box
- Post not showing in the front page
- Ajax the create and edit post form into lightbox and get results
- Wp_query loop is not working as it should
- Blank page after changing number of post displayed in wp-admin
- Is there a global page/post/product/anything ID?
- Related posts not working in the index
- Add category selection to function request
- Correcting the content width when sidebar is inactive?
- How to show only Post titles on category pages
- Show Post number of specific Category
- Category pages vs single post pages
- How to limit post query to only return a total count of items with certain post statuses?
- Redirect posts to sub domain except pages
- Action while post is being published
- How do you order posts by type then term_id and then by date?