Search code examples
wordpresscanonical-linkpost-update

can we auto update posts in wordpress site 1 to wordpress site2 using any plugin?


I have 2 wordpress sites with same content (posts) and different backend.Is it possible for me to update the contents of site 2 when i update posts in site 1 using plugin or any other method other than manually doing?

Domain names of the websites are different.it is not a subdomain also.

Also how do i update canonical link for all the blogs of site 2 to that of site 1 for original content at a stretch

Any help would be appreciated.


Solution

  • I think there is a way that I can suggest which should solve this. But its not a plugin but a third party automation tool.

    First thing you will need is to setup zapier.

    What is zapier ?

    Zapier is a tool that helps you automate repetitive tasks between two or more apps—no code necessary. When an event happens in one app, Zapier can tell another app to perform (or do) a particular action.

    Setup zapier and add both the wordpress sites in that account.

    Now you have to create a zap. You will use this zap which is called as Create WordPress posts from other new WordPress posts.

    Depending on how many of these posts you want to automate, or how many zaps you require you may have to get a PAID plan from them.


    How do i update canonical link for all the blogs of site 2 to that of site 1 ?

    This can be done installing a plugin The SEO Framework. After you have installed this plugin in site 2 you need to do the following.

    add_filter( 'the_seo_framework_rel_canonical_output', function( $url , $id ) {
    
        // perform other checks, if it is a post or not
    
        // $url = "https://siteA.com/post-slug"; // suppose this was the URL
    
        str_replace("https://siteA.com","https://siteB.com",$url); // Chnage the link
    
        return $url;
    }, 10, 2 );