Clear page-to-package binding
const url = 'https://example.com/wp-json/wp2lms-pro/embed-packages/v1/pages/128/package?blog_id=1';const options = {method: 'DELETE', headers: {'X-WP-Nonce': '<X-WP-Nonce>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url 'https://example.com/wp-json/wp2lms-pro/embed-packages/v1/pages/128/package?blog_id=1' \ --header 'X-WP-Nonce: <X-WP-Nonce>'Clears replace: PagePackageReplace::save($page_id, false, 0, false) — the page renders Gutenberg/Turbo again. Package files on disk and the CPT post stay. page_id is the WordPress page ID, not blog_id and not the package id. Not a page — 404 embed_packages_page_not_found.
Requires manage_network (multisite) or edit_pages. Cookie + X-WP-Nonce or Application Password.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”WordPress page ID (post_type=page) the embed package is bound to. Not blog_id and not the package id. If the post is not a page — 404 embed_packages_page_not_found.
Example
128Query Parameters
Section titled “Query Parameters”Network site ID (switch_to_blog). Optional: defaults to the request current blog. Not a package id and not page_id. Minimum 1; on a single site it must match the current site — otherwise 400 embed_packages_invalid_blog. In a network an unknown site or a site from another network is 404 embed_packages_unknown_blog.
Example
1Responses
Section titled “Responses”Binding cleared. Body is { page_id, enabled: false, cleared: true }.
object
WordPress page ID the binding was cleared from. Not blog_id and not the package id.
Always false — replace is off.
Always true on HTTP 200 — binding meta was deleted.
Example
{ "page_id": 128, "enabled": false, "cleared": true}Embed_packages_invalid_blog — blog_id < 1, or on a single site it does not match the current site.
object
WP_Error code (get_error_code()), e.g. embed_packages_not_found.
WP_Error text (get_error_message()).
WP_Error data. Usually { "status": 404 }. Ingest/materialize errors without status are returned by WordPress REST as 500.
object
Example
{ "code": "embed_packages_not_found", "message": "Package not found.", "data": { "status": 404 }}Not authenticated. WordPress REST: rest_forbidden (status 401) when there is no cookie session. Cookie + X-WP-Nonce or Application Password.
object
WP_Error code (get_error_code()), e.g. embed_packages_not_found.
WP_Error text (get_error_message()).
WP_Error data. Usually { "status": 404 }. Ingest/materialize errors without status are returned by WordPress REST as 500.
object
Example
{ "code": "embed_packages_not_found", "message": "Package not found.", "data": { "status": 404 }}Missing manage_network (multisite) or edit_pages (single site), or invalid REST nonce (rest_cookie_invalid_nonce).
object
WP_Error code (get_error_code()), e.g. embed_packages_not_found.
WP_Error text (get_error_message()).
WP_Error data. Usually { "status": 404 }. Ingest/materialize errors without status are returned by WordPress REST as 500.
object
Example
{ "code": "embed_packages_not_found", "message": "Package not found.", "data": { "status": 404 }}Embed_packages_page_not_found — no WordPress page with this page_id; embed_packages_unknown_blog — unknown blog_id in the network.
object
WP_Error code (get_error_code()), e.g. embed_packages_not_found.
WP_Error text (get_error_message()).
WP_Error data. Usually { "status": 404 }. Ingest/materialize errors without status are returned by WordPress REST as 500.
object
Example
{ "code": "embed_packages_not_found", "message": "Package not found.", "data": { "status": 404 }}