Yoast Duplicate Post (and other duplication plugins)

No matter if you’re using a multisite or non-multisite version of my crossposting plugin, in both cases meta fields are used to store information about a crossposted copy of the post on other sites.

And when you’re using any plugins to clone your posts or maybe some custom code, it may interrupt the connection between the original post and its copies on subsites.

Luckily it can be configured easy enough. All we need to do is to ask Yoast Duplicate Post to ignore some specific meta keys, these ones:

Here is how to configure it:

Yoast Duplicate Post plugin settings
Please go to Settings > Duplicate post and add _crosspost_to_* into “Do not copy these fields” (for non-multisite version of the plugin it should be _crsspst_to_*.

If you are using any other plugins to clone your posts, the idea is the same. In code you can use a condition:

// multisite
if( 0 === strpos( $meta_key, '_crosspost_to_' ) ) {
	// do nothing if the meta key starts with _crosspost_to_

// not multisite
if( 0 === strpos( $meta_key, '_crsspst_to_' ) ) {
	// do nothing if the meta key starts with _crsspst_to_

But what to do with the duplicates you have already made before configuring the plugin? Just remove them and duplicate once again – it would take a second (I recommend to double check that you have “Post deletion” unchecked in the settings when you going to do it).

Need more help?