[wordpress插件] Change OG URL To HTTP将OG URL更改为HTTP

wordpress 插件 文章 2020-03-21 17:00 478 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

When you shift your blog from HTTP to HTTPS, all your posts/pages lose facebook likes/share count.

当您将博客从HTTP更改为HTTPS时,所有帖子/页面都将失去Facebook赞/分享数。

The only way to regain these likes/share counts is to add a 'OG URL' tag that points back to the older 'HTTP' urls as described here by Facebook.

#moving-urls“ rel =” nofollow“>在这里由Facebook 描述。

This plugin helps you do just that.

此插件可以帮助您做到这一点。

For example, if you use a SEO plugin like Yoast, the OG URL tag automatically reflects the HTTPS version for HTTPS URLs.

例如,如果您使用SEO插件(例如Yoast),则OG URL标记会自动反映HTTPS URL的HTTPS版本。

This plugin adds a filter to the ‘OG URL’ output and changes it back to ‘HTTP’ for all existing posts/pages.

此插件将过滤器添加到“ OG URL”输出中,并将其更改为所有现有帖子/页面的“ HTTP”。

New posts that you add after this plugin is activated will not be affected.

您激活此插件后添加的新帖子将不受影响。

Similary, the canonical URL tag remains unchanged as ‘HTTPS’.

Similary,规范的URL标记保持为“ HTTPS”不变。

Canonical tag is used by search engines like Google.

规范标签由Google等搜索引擎使用。

So you are good when it comes to SEO.

因此,您在SEO方面表现不错。

This plugin changes the OG URL output for the following popular plugins:

此插件更改以下流行插件的OG URL输出:

    • Yoast SEO Plugin
    • Yoast SEO插件

    • ALL In One SEO Pack
    • 全部包含在一个SEO包中

    • WP facebook open graph protocol by Chuck Reynolds
    • Chuck Reynolds的WP facebook开放图协议

    • Facebook Open Graph, Google+ and Twitter Card Tags plugin by Webdados
    • Webdados的 Open Graph,Google +和Twitter Card Tags插件

    Note

    注意

    This plugin only changes the ‘OG URL’ tags for posts that existed when this plugin is first installed.

    此插件仅更改首次安装此插件时存在的帖子的“ OG URL”标签。

    This way all new posts will have the regular OG URL tags with ‘HTTPS’.

    这样,所有新帖子都会使用带有“ HTTPS”的常规OG URL标签。

    Steps to make this work

    完成这项工作的步骤

    You need to follow these steps in order for the plugin to work:

    您需要按照以下步骤操作,插件才能正常工作:

    Step 1: Install and activate the plugin.

    第1步:安装并激活插件。

    Step 2: If you are using a Cache plugin (eg: WP Super Cache), delete the cache.

    步骤2:如果您使用的是Cache插件(例如:WP Super Cache),请删除该缓存。

    Step 3: Exclude facebook bot from the HTTP to HTTPS redirection in your HTaccess file.

    第3步:在HTaccess文件中,将Facebook bot从HTTP重定向到HTTPS排除在外。

    Here’s an example:

    这是一个示例:

    RewriteEngine On

    RewriteEngine开启

    RewriteCond %{SERVER_PORT} 80

    RewriteCond%{SERVER_PORT} 80

    RewriteCond %{HTTP_USER_AGENT} !facebookexternalhit/[0-9]

    RewriteCond%{HTTP_USER_AGENT}!facebookexternalhit / [0-9]

    RewriteRule ^(.*)$ https://sitename.com/$1 [R=301,L]

    RewriteRule ^(。*)$ https://sitename.com/$1 [R = 301,L]

    The above rewrite rule excludes facebook bots from the redirect.

    以上重写规则将Facebook漫游器从重定向中排除。

    Step 4: Wait for 30 days for facebook to rescrape your pages.

    步骤4:等待30天,以便Facebook重新抓取您的页面。

    Your ‘share count’ will return when facebook rescrapes your page.

    当Facebook重新抓取您的页面时,您的“共享数”将返回。

    Test to see if this works

    测试一下是否可行

    You can instantly check to see if you did everything right by forcing facebook to rescrape one or many of your pages.

    您可以通过强制Facebook重新抓取您的一个或多个页面来立即检查您是否做对了所有事情。

    Here’s how you can do that:

    操作方法如下:

安装步骤

Manually installing the plugin

手动安装插件

    1. Download the plugin zip file from WordPress.org
    2. 从WordPress.org下载插件zip文件

    3. Upload the zip file of the plugin by logging into your wordpress dashboard and going to ‘Plugins > Add New > Upload Plugin’.
    4. 通过登录到wordpress仪表板并转到“插件>添加新文件>上传插件”来上传插件的zip文件。

    5. Click on the ‘install’ now button.
    6. 点击“立即安装”按钮。

    7. After the installation is complete, click the ‘Activate’ button.
    8. 安装完成后,单击“激活”按钮。

    9. Once activated, the plugin automatically adds a filter to the OG:URL output.
    10. 激活后,插件会自动向OG:URL输出添加过滤器。

    Installing from WordPress dashboard

    从WordPress仪表板安装

      1. Login to your wordpress dashboard and go to ‘Plugins > Add New’.
      2. 登录到您的wordpress仪表板,然后转到“插件>添加新项”。

      3. Search for ‘Quick And Easy SEO’ and click on the ‘Install’ button.
      4. 搜索“快速简便的SEO”,然后单击“安装”按钮。

      5. Once the installation is complete, click on the ‘Activate’ button.
      6. 安装完成后,单击“激活”按钮。

      7. Once activated, the plugin automatically adds a filter to the OG:URL output.
      8. 激活后,插件会自动向OG:URL输出添加过滤器。

      9. Check your HTML source to see if all tags are being added properly.
      10. 检查您的HTML源代码,以查看是否已正确添加所有标签。

下载地址
https://downloads.wordpress.org/plugin/change-og-url-to-http.1.0.zip
-EOF-

AI助手支持GPT4.0