Webflow sync, pageviews & more.
NEW

Is there a way to obtain the internal Webflow Page ID and internal Webflow Item ID within a Webflow page or using custom code or HTML embeds?

TL;DR
  • Use the Webflow CMS API or export your CMS data as CSV to access internal Page and Item IDs.
  • To make IDs usable on the front end, manually copy them into a custom CMS field and insert it into your design.

You cannot directly access Webflow's internal Page ID or CMS Item ID using native features or custom code within a Webflow page. These internal IDs are not exposed in the front-end or through Designer/Editor by default.

1. Understanding Internal IDs

  • Page ID and CMS Item ID are internal identifiers used by Webflow’s backend and CMS system.
  • These values are not exposed in the page source code or in any JSON data accessible to client-side code.
  • Webflow's public CMS API does include these IDs, but only when querying from the server or authenticated applications.

2. Options to Obtain Internal ID Values

If you require internal IDs for integrations or development purposes:

  • Use Webflow CMS API:

  • Authenticate with your Webflow project via the Webflow CMS API.

  • Make a request to the Collections endpoint to retrieve CMS items and their metadata, including the internal _id field.

  • This method requires a server or tools like Postman; it cannot be done client-side due to API key exposure concerns.

  • Export the CMS via CSV:

  • Some CMS export tools (including Webflow’s internal CMS to CSV tool) may include the internal CMS ID in the export file.

  • This is useful for mapping external data without needing code.

  • Embed CMS ID into the Page Manually:

  • If you need to reference CMS Item IDs on the client-side, create a custom field in your CMS called “CMS ID” and manually populate it with the internal _id from the API or export.

  • Then, insert this field into your Webflow Designer (e.g., as a data-id attribute on an element).

3. What You Cannot Do

  • You cannot retrieve the Page ID or CMS ID using JavaScript DOM queries inside the published Webflow page.
  • You cannot use HTML embed elements or custom code on the front end to extract these IDs unless you've previously exposed them via a CMS field or similar method.

Summary

You cannot directly access internal Webflow Page ID or Item ID within a Webflow page using native features or client-side code. Use the Webflow CMS API or a CMS export to retrieve these IDs, and if needed on the frontend, store them in a custom CMS field.

Rate this answer

Other Webflow Questions