Start leveraging the latest WordPress core features with WordPress.com’s experimental Create Content Model plugin.
Create custom post types and custom fields directly in the Block Editor, and then export your data model and data entry UI as a standalone, maintenance-free plugin. Everything you build is using core WordPress functionality, so you can run the future-proof plugin or you can use filters and hooks to extend and adapt your data model.
To get started with the Create Content Model plugin, download the latest release, launch our WordPress Playground Blueprint, or test locally with Studio.
Quick.Start.with.audio.mov
A content model is a custom post type that you can register and build directly in WordPress core. As you design it, you select which blocks are editable and can add custom fields.
Creating a new content model includes:
- Registering a new post type.
- Designing the frontend template for your new post type and selecting which blocks in the template are editable by adding new “Bindings.”
- Adding custom fields to your post to collect additional data.
Note that custom taxonomy support is on the roadmap.
From the Content Models page:
- Click Add New Model.
- Name your content model.
- Manage the post type settings using the sidebar panel: Singular Label, Plural Label, Icon Name
Once you’ve created the post type, you can start designing the template.
As you add blocks to the template, they will not be editable by default. You’ll need to select which blocks include dynamic (aka editable) data by selecting Add Binding in the block sidebar controls.
Once a block is “bound,” it will be editable in the future, and any data entered will be automatically stored as postmeta, meaning you can use that data in different templates or query loops, view it in the REST API, bulk manage it via the database, and much more.
If you have the Gutenberg plugin and enable the "Block Binding UI" experiment enabled, you can view and use your custom fields registered as postmeta when you manually bind an attribute.
Since we’re using core WordPress’ Block Bindings API, the only blocks that are currently supported are the Paragraph, Heading, Image, and Buttons blocks.
This tool also allows you to bind the Group block to a post meta field, which creates a “rich text” or WYSIWYG area in your template where multiple blocks can be used. A bound group block will store its contents in a post meta field, or you can map it directly to the post_content
attribute.
All of your bound blocks will save their content to post meta fields, so you can redesign, remix, and filter your content model in the future and without losing the integrity of your data. Open the Post Meta sidebar panel to view.
Click the Manage Post Meta button to browse all of your block bindings and create your own custom fields that are available in the post editing screen.
Click Publish to see your new content model on your website.
Once your data model is published, it will show up as an additional post type beneath Posts and Pages in your WordPress dashboard.
Add new content just like you would add any other post content. You’ll notice that only the blocks you bound are editable, and the rest of the data model’s template is safe from being changed or edited.
Any custom fields that you’ve added will also be available in the post sidebar:
Click the Publish button to publish your post and view it on the front end.
Create Content Model is designed to work with the block editor and block-based themes. If you’d like to make changes to the design of the single or archive templates for your custom post type, you can do that inside of the Site Editor, just like you would for any other post type.
You can set up the single post layout in your custom post type template. Alternatively, you can create a new single-CPTNAME.html
template and add block variations from the block inserter.
Create a custom Query Loop on a page, archive-CPTNAME.html
template, or any other template (e.g. the theme’s home template). Pull in the posts from your data model, sort and filter them, and use the new block variations in the block inserter to pull individual pieces of data into your template.
Create Content Model is a development tool, but it’s not required to run on your site. If you’re done building your content model, you can “export” it as a standalone plugin:
- Click Content Models → Export.
- Export the data model plugin by clicking the Download ZIP file button.
- Install your data model plugin on a new site (or deactivate the main plugin on the current site and import the new plugin). Remember to upload it as the .zip file.
- Optionally, add version control for your own content model plugin to track changes and deploy your plugin across multiple sites.
Studio is WordPress.com's free, open-source local development environment.
- Download Studio.
- Add a site.
- Open WP Admin.
- Download the latest plugin release.
- Install and activate the plugin.