Custom Post Types

Custom post types are fully supported by my crossposting plugins. But in some cases a little bit of configuration is required.

“Publish on” Section Doesn’t Appear for a Custom Post Type

In this part of the article we will figure out why “Publish on” section/meta box is visible for regular Posts or Pages but is not displayed for a custom post type.

If it is not visible for Posts and Pages as well, then maybe:

1. Check “Allowed Post Types” in plugin settings

In order to do so please go to Network Admin > Settings > Network Crosspost if you’re using my Simple Multisite Crossposting:

custom post types allowed for crossposting in WordPress Multisite

Or just Settings > Crosspost is you’re using Simple WP Crossposting:

custom post types allowed for crosssposting

Please pay attention to a post type name – if it is registered as book or event, you shouldn’t use books or events. I know it is obvious, but it is a common mistake.

In case you decided to leave “Allowed Post Types” option empty, then the crossposting is going to work for all post types available in your WordPress admin by default. It means that when this custom post type is registered, its show_ui parameter should be set to true (or if not provided, the public parameter should be true).

2. Enable “Custom Fields” when registering a CPT

This may happen only for the Block Editor (Gutenberg), so if you’re using Classic Editor, feel free to skip this part.

Right now we’re going to talk about this error message:

Custom post type is not configured for crossposting

Good news – it is super-easy to fix. All you need to do is to add custom-fields value to the supports parameter while registering a custom post type. Example:

		'supports' => array( 'title', 'editor', 'custom-fields' )

CPT UI example

Or if you’re using a third party plugin for that, for example CPT UI, then just make sure that you have an appropriate checkbox checked.

CPT UI custom fields support

Pods example

It is done similarly in another custom post type plugin – Pods. Just edit a pod and then switch to the Advanced Options tab.

configure custom post type in Pods plugin
Do not worry about what they are saying about slow performance. If you care about site performance, you’d better register custom post types in functions.php

Post type is registered inside another plugin and you don’t want to change its code

In this case the filter hook register_post_type_args is here to help you. Example:

add_filter( 'register_post_type_args', function( $args, $post_type ) {
	if( 'POST TYPE NAME' === $post_type ) {
		// we just add 'custom-fields' to an existing array of supported stuff
		$args[ 'supports' ][] = 'custom-fields';
	return $args;
}, 10, 2 );

Or you can use the add_post_type_support() function.

add_action( 'init', function() {
	add_post_type_support( 'POST TYPE NAME', 'custom-fields' );
}, 999 );

3. Deactivate broken plugins

Sometimes a conflict can be created by another plugin. So if you tried everything mentioned in this article and nothing helped, please try to deactivate your website plugins one by one and see if it makes any difference.

The list of the broken plugins already found by me is below:

Not so many yet and that’s great 😁

Posts of a Custom Type Don’t Appear on the Other Sites

This part is only related to Simple WP Crossposting plugin, not Simple Multisite Crossposting, becase the first one interacts with the other sites using the REST API and we need to have a proper configuration of our CPT.

If “Publish on” section is displayed but crossposting is still not working for your custom post type, it usually doesn’t happen silently and you will get an error message like this:

add a custom post type into the REST API

It means that you need to check a couple of things on “Misha Test” site (in our case).

  1. First of all make sure that a custom post type is registered there with the same name.
  2. Make sure that it is added to the REST API, show_in_rest set to true.
  3. If you’re using REST API base slug parameter, it should be the same on all sites.

In code it may look like this:

		'show_in_rest' => true,
		'rest_base' => 'our-books', // if used, should be the same on all sites

In CPT UI plugin:

show_in_rest parameter when registering a custom post type using CPT UI plugin
REST API Base slug is not required to use, I am just showing you an example in case you’re using it.

Need more help?