LearningSpot@Wordpress icon

LearningSpot@Wordpress

Consume Wordpress API

Page → Create

AI-generated

Summary

Create a new WordPress page with a required title and optional properties like content, author, status, template, and more. Optionally upload a featured media file linked to the created page.

Inputs

  • Title (required) — The title for the new page.
  • Featured Media — Whether to upload featured media for the page.
  • Binary Property (required) — The binary property name containing media data to upload if Featured Media is true.
  • File Name — The filename with extension for the media upload (e.g., example.jpeg).
  • Additional Fields — Optional additional page fields including content, author, slug, password, status, comment and ping status, template configuration (including Elementor options), menu order, parent page ID, and featured media ID.

Output shape

a single JSON object representing the newly created WordPress page, including an added 'featuredMediaId' field if media was uploaded

If featured media upload is selected, the binary data from the specified property is uploaded first, the media ID is associated with the page creation, and returned as 'featuredMediaId'. The operation uses the WordPress REST API endpoints '/pages' and '/media' accordingly.

Examples

Example 1: Create a page with title, content, and a featured image file

Set 'Title' to desired page title, enable 'Featured Media', choose 'Binary Property' referencing the binary data to upload, provide 'File Name' for the uploaded media, and set optional 'Additional Fields' like content and status.

Links

Discussion