Skip to content

Decoupled set up

If you’re using WordPress as a content management system (CMS) but presenting the content through a separate front-end application (like Next.js or Gatsby), you can use the Parse.ly plugin.

With Parse.ly, you can either work with REST API or GraphQL. In either case, you’re responsible for:

REST API

The plugin automatically adds a parsely field to REST API endpoints corresponding to the Tracked Post Types and Tracked Page Types selected in the plugin settings. By default, this would be the /wp-json/wp/v2/pages and /wp-json/wp/v2/posts endpoints along with the corresponding single resource endpoints. You may adjust the choice of object types by using the wp_parsely_rest_object_types filter:

// Disable REST API output from pages, but enable for term archives.
add_filter(
	'wp_parsely_rest_object_types',
	function( $object_types ) {
		$object_types = array_diff( $object_types, array( 'page' ) );
		$object_types[] = 'term';
		return $object_types;
	}
);

The parsely field contains the following fields:

  • version, a string that identifies the REST API output’s version. We’ll update this string whenever making changes to the output. This allows consuming applications to check the version to ensure compatibility or identify updates.
  • meta, an array of metadata for the specific post, page, or other custom post type.
  • rendered, the rendered HTML of the metadata for the post, page, or other custom post type. This will be a JSON-LD <script> tag, or a set of <meta> tags, depending on the format you’ve selected in the plugin settings. The decoupled code can consume and use this directly, instead of building the values from the meta field values.

The rendered field is a convenience field containing the HTML-formatted metadata which you may printed to a decoupled page as is. You can disable it by returning false from the wp_parsely_enable_rest_rendered_support filter.

// Disable rendered field output from the REST API output.
add_filter( 'wp_parsely_enable_rest_rendered_support', '__return_false' );

The REST API integration can be disabled by returning false from the wp_parsely_enable_rest_api_support filter.

// Disable all REST API output from the Parse.ly plugin.
add_filter( 'wp_parsely_enable_rest_api_support', '__return_false' );

GraphQL

If you’ve installed the WPGraphQL plugin, the wp-parsely plugin will register a parsely field on the ContentNode interface, which makes it available on most post types by default.

Here is an example GraphQL query for a post. Documentation for each field is provided via the GraphQL schema.

query PostWithMetadata {
 post(
  id: 1
  idType: DATABASE_ID
 ) {
  id
  parsely {
   isTracked
   jsonLd
   rawJsonLd:jsonLd(removeWrappingTag: true)
   repeatedMetas
   scriptUrl
   version
  }
  title
 }
}

You may disable the GraphQL integration by returning false from the wp_parsely_enable_graphql_support filter.

// Disable all GraphQL output from the Parse.ly plugin.
add_filter( 'wp_parsely_enable_graphql_support', '__return_false' );

Test

Following setup, review our testing instructions to validate your installation.

Last updated: November 13, 2025