Create Custom Post Type with Air WP Sync
WordPress offers the flexibility of Custom Post Types to enrich content beyond standard posts and pages. Think of CPT as specialized content categories like events or portfolios. While they are similar to regular posts, they come with their unique features and labels. With the Air WP Sync plugin, you can easily create these CPTs on-the-fly. Let’s explore Air WP Sync features for CPT creation.
Features of Airtable WP Sync Plugin for creating CPT
- On-the-fly CPT creation for imported content.
- Mapping capabilities for WordPress fields such as Title, Content, Personalized slug, and Custom Field.
- Enables the creation of your custom fields.
- Compatible with ACF in Air WP Sync Pro+.
Airtable settings of your connection
- Create a new connection.
- Fill your Airtable access token in the Access Token field.
- Select your Airtable Base, Table, and View (optional) linked to your access token.
Setting-up your import
- In the Import as drop-down select Page or Post.
- In the Post Type drop-down select Create new post type.
- Enter a name for your Custom Post Type.
- Enter an Url Prefix which will be used in the url structure, like “http://yourwebsite.com/prefix/post-name”.
- Select the Default Post status in the drop-down.
- Select the Default Post author in the drop-down.
Fields mapping
In the Field Mapping section:
- Choose an Airtable Field: in the Airtable Field side, select your Airtable fields from the drop-down menu.
- Select a WordPress Field: in the Import As drop-down menu, select the basic WordPress fields such as the “Title”, “Slug”, “Category”, “Featured Image”, “Taxonomy”.
Add Custom Fields (Optional): if you want to incorporate unique fields, select Custom Field and enter a custom field name to map it with your Airtable field.
💡 Great news!! There is a way to customize the end of your URL. You can choose a field in the Airtable Field section that you want to display at the end of your URL, and select Slug in the Import As section.
If the text contains special characters (such as spaces, accented characters, quotation marks, etc.), it will be automatically sanitized, so they will be deleted.
Otherwise, the end of your URL will be set by default from the title of the CPT.
Import and sync
Once all your connection settings are done:
- Click on the Publish button in the top-right of the connection.
- Click on the Sync Now button in the Actions section of your connection to import and sync all your Airtable base content into your new Custom Post Type.
Reviewing imported posts
- In the WordPress dashboard, select your newly created Custom Post Type from the side menu.
- The list displays all posts imported from your Airtable base.
Reviewing custom fields
- Click on an imported post.
- To see your custom fields inside your CPT content, you can activate the Custom Fields feature from the Editor Preferences (see this documentation) or even download the free PureDevs Any Meta Inspector plugin for WordPress. Then, you can view your custom fields below the content of your CPT.
⚠️ Important considerations
If you choose to modify the configuration or stop using the CPT made via the Air WP Sync plugin, the on-the-fly created CPT will cease to exist in WordPress. Consequently, the associated imported content will become inaccessible.