Crossposting Doesn’t Work for a Custom Post Type

Let’s say you have a registered a custom post type and you would like it to be crossposted to other sites. If your custom post type is not configured properly, you could run into several issues.

Issue 1. Broken Checkboxes

What to do if you got either a broken checkboxes like on a screenshot below or the checkboxes values won’t stay checked after publishing or updating a custom post.

gutenberg checkboxes bug

If you check your browser console, you can also see some React.js errors there. Like “An error occurred while running ‘mapSelect’ : getEditedPostAttribute( … ) is undefined”.

mapselect browser console error in Gutenberg
You may find this error in browser console.

And of course, crossposting for those custom posts doesn’t work.

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

register_post_type(
	'articles',
	array(
		
		...
		
		'supports' => array( 'title', 'editor', 'custom-fields' )
	)
);

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

It is done similarly in another custom post type plugin – Pods. Just edit pod and then switch to 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

Issue 2. Crossposting Interface Isn’t Displayed At All

Another thing that could happen is when the section “Publish on” isn’t displayed at all for your custom post types.

crossposting does not work for custom post type

First things first please check that this custom post type is allowed for crossposting in plugin settings Network Admin > Settings > Crosspost for multisite version or just Settings > Crosspost for a regular version.

custom post types allowed for crossposting
Crossposting settings of the multisite version of the plugin.

It is also super easy to fix and once again, please check your register_post_type() function.

register_post_type(
	'articles',
	array(
		'public' => true, // here it is
		
		...
		
		'supports' => array( 'title', 'editor', 'custom-fields' )
	)
);

Yes, seems quite obvious, if a post type is hidden we shouldn’t crosspost it, but sometimes when doing their post type configuration, clients use public => false, show_ui => true. So it doesn’t change anything in admin UI, but my plugin thinks another way.

That’s all.

Need more help?