--- title: pageUpdate - GraphQL Admin description: |- Updates an existing page's content and settings. For example, merchants can update their "Shipping Policy" page when rates change, or refresh their "About Us" page with new team information. Use the `pageUpdate` mutation to: - Update page content and titles - Modify publication status - Change page handles for URL structure - Adjust template settings The mutation supports partial updates, allowing specific changes while preserving other page properties. api_version: unstable api_name: admin source_url: html: https://shopify.dev/docs/api/admin-graphql/unstable/mutations/pageupdate md: https://shopify.dev/docs/api/admin-graphql/unstable/mutations/pageupdate.md --- # page​Update mutation Requires Any of `write_content`, `write_online_store_pages` access scopes. Updates an existing page's content and settings. For example, merchants can update their "Shipping Policy" page when rates change, or refresh their "About Us" page with new team information. Use the `pageUpdate` mutation to: * Update page content and titles * Modify publication status * Change page handles for URL structure * Adjust template settings The mutation supports partial updates, allowing specific changes while preserving other page properties. ## Arguments * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required The ID of the page to be updated. * page [Page​Update​Input!](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/PageUpdateInput) required The properties of the page to be updated. *** ## Page​Update​Payload returns * page [Page](https://shopify.dev/docs/api/admin-graphql/unstable/objects/Page) The page that was updated. * user​Errors [\[Page​Update​User​Error!\]!](https://shopify.dev/docs/api/admin-graphql/unstable/objects/PageUpdateUserError) non-null The list of errors that occurred from executing the mutation. *** ## Examples * ### Updates a page #### Query ```graphql mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { code field message } } } ``` #### Variables ```json { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/unstable/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { code field message } } }", "variables": { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } } }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { code field message } } }`, { variables: { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } }, }, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { code field message } } } QUERY variables = { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { code field message } } }`, "variables": { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } }, }, }); ``` #### Response ```json { "pageUpdate": { "page": { "id": "gid://shopify/Page/602767277", "title": "This is the Title", "handle": "this-is-the-handle" }, "userErrors": [] } } ``` * ### Updating a page to have a new title #### Description Updates a page's title successfully. #### Query ```graphql mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { field message } } } ``` #### Variables ```json { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/unstable/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { field message } } }", "variables": { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } } }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { field message } } }`, { variables: { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } }, }, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { field message } } } QUERY variables = { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { field message } } }`, "variables": { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } }, }, }); ``` #### Response ```json { "pageUpdate": { "page": { "id": "gid://shopify/Page/602767277", "title": "This is the Title", "handle": "this-is-the-handle" }, "userErrors": [] } } ``` * ### pageUpdate reference [Open in GraphiQL](http://localhost:3457/graphiql?query=mutation%20UpdatePage\(%24id%3A%20ID!%2C%20%24page%3A%20PageUpdateInput!\)%20%7B%0A%20%20pageUpdate\(id%3A%20%24id%2C%20page%3A%20%24page\)%20%7B%0A%20%20%20%20page%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20title%0A%20%20%20%20%20%20handle%0A%20%20%20%20%7D%0A%20%20%20%20userErrors%20%7B%0A%20%20%20%20%20%20code%0A%20%20%20%20%20%20field%0A%20%20%20%20%20%20message%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D\&variables=%7B%0A%20%20%22id%22%3A%20%22gid%3A%2F%2Fshopify%2FPage%2F602767277%22%2C%0A%20%20%22page%22%3A%20%7B%0A%20%20%20%20%22title%22%3A%20%22This%20is%20the%20Title%22%2C%0A%20%20%20%20%22handle%22%3A%20%22this-is-the-handle%22%0A%20%20%7D%0A%7D) ##### GQL ```graphql mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { code field message } } } ``` ##### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/unstable/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { code field message } } }", "variables": { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } } }' ``` ##### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { code field message } } }`, { variables: { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } }, }, ); const json = await response.json(); return json.data; } ``` ##### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { code field message } } }`, "variables": { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } }, }, }); ``` ##### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { code field message } } } QUERY variables = { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } } response = client.query(query: query, variables: variables) ``` ## Input variables JSON ```json { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } } ``` ## Response JSON ```json { "pageUpdate": { "page": { "id": "gid://shopify/Page/602767277", "title": "This is the Title", "handle": "this-is-the-handle" }, "userErrors": [] } } ```