简体   繁体   English

我们可以使用任何插件将 wordpress 站点 1 中的帖子自动更新到 wordpress 站点2 吗?

[英]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?我有 2 个 wordpress 站点,它们具有相同的内容(帖子)和不同的后端。当我使用插件或任何其他方法而不是手动更新站点 1 中的帖子时,我是否可以更新站点 2 的内容?

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另外,我如何将站点 2 的所有博客的规范链接更新为站点 1 的原始内容的规范链接

Any help would be appreciated.任何帮助,将不胜感激。

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.您需要做的第一件事是设置 zapier。

What is zapier?什么是扎皮尔?

Zapier is a tool that helps you automate repetitive tasks between two or more apps—no code necessary. Zapier 是一种工具,可帮助您在两个或多个应用程序之间自动执行重复性任务——无需代码。 When an event happens in one app, Zapier can tell another app to perform (or do) a particular action.当一个应用程序中发生事件时,Zapier 可以告诉另一个应用程序执行(或执行)特定操作。

Setup zapier and add both the wordpress sites in that account.设置 zapier并在该帐户中添加两个 wordpress 站点

Now you have to create a zap.现在你必须创建一个zap。 You will use this zap which is called as Create WordPress posts from other new WordPress posts .您将使用这个称为从其他新 WordPress 帖子创建 WordPress 帖子的zap

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.根据您想要自动化的这些帖子中有多少,或者您需要多少 zaps,您可能必须从他们那里获得付费计划。


How do i update canonical link for all the blogs of site 2 to that of site 1?如何将站点 2 的所有博客的规范链接更新为站点 1 的规范链接?

This can be done installing a plugin The SEO Framework .这可以通过安装插件The SEO Framework来完成。 After you have installed this plugin in site 2 you need to do the following.在站点 2 中安装此插件后,您需要执行以下操作。

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 );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM