Hi John,
This feature is not available in the current version of WPeMatico or its addons, however you can add it manually to the functions.php file of your theme.
Then you have to assign a category to the campaign and use the slug of that category in the filter, replacing the text “category-slug” in filter.
After this, the posts created by WPeMatico and assigned to that category will have the rel=”canonical” to the sourcesite, you can check it in the source code of each post.
add_action( 'wp_head', 'etruel_add_meta_tag', 0 );
function etruel_add_meta_tag() {
global $post;
$post_id = $post->ID;
$post_permalink = get_permalink( $post_id, false );
$wpe_campaignid = get_post_meta( $post_id, 'wpe_campaignid', true );
$wpe_sourcepermalink = get_post_meta( $post_id, 'wpe_sourcepermalink', true );
if (has_category('category-slug',$post->ID)){
remove_action('wp_head', 'rel_canonical');
echo '<link rel="canonical" href="'.$wpe_sourcepermalink.'" />';
}
}
Regards,
Manuel