Relationships Custom Fields

If you’re using “Relationship” field types and wonder why these fields are empty on freshly crossposted posts, the answer is pretty simple – it is because the same posts (or terms) have different IDs on different websites.

ACF relation field
This is how “Relation” field looks like in ACF

If you’re using ACF, you just need to install and activate an add-on from here.

But what if you’re not using Advanced Custom Fields? Maybe your relationships fields were created with another custom fields plugin or maybe even coded in your WordPress theme.

First of all, please install one of the add-ons below depending on which plugin you’re using.

For Simple WP Crossposting:

Download Simple WP Crossposting – Relationships Custom Fields 1.1

For Simple Multisite Crossposting:

Download Simple Multisite Crossposting – Relationships Custom Fields 1.1

Once the add-on is installed and activated, you need to find out your relationships custom fields meta keys and add them into the snippet below.

For posts, pages or any other custom post types:

add_filter( 'rudr_crosspost_post_relationship_meta_keys', function( $meta_keys ) {
	// add first field
	$meta_keys[] = 'related_posts';
	// add second field
	$meta_keys[] = 'related_pages';

	return $meta_keys;
} );

For categories, tags and any other custom taxonomies:

add_filter( 'rudr_crosspost_term_relationship_meta_keys', function( $meta_keys ) {

	$meta_keys[] = 'related_categories';

	return $meta_keys;
} );

The snippet should be inserted to “Site 1” – the site you’re about to crosspost from. In case you don’t know how – please read this.

A couple more things to keep in mind:

If something remains unclear for you, please watch the video below:

Need more help?