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 描述。 p>
This plugin helps you do just that.
此插件可以帮助您做到这一点。 p>
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.
您激活此插件后添加的新帖子将不受影响。 p>
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方面表现不错。 p>
This plugin changes the OG URL output for the following popular plugins:
此插件更改以下流行插件的OG URL输出: p>
- Yoast SEO Plugin
- Yoast SEO插件 li>
- ALL In One SEO Pack
- 全部包含在一个SEO包中 li>
- WP facebook open graph protocol by Chuck Reynolds
- Chuck Reynolds的WP facebook开放图协议 li>
- Facebook Open Graph, Google+ and Twitter Card Tags plugin by Webdados
- Webdados的 Open Graph,Google +和Twitter Card Tags插件 li>
ul>
Note
注意 h4>
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标签。 p>
Steps to make this work
完成这项工作的步骤 h3>
You need to follow these steps in order for the plugin to work:
您需要按照以下步骤操作,插件才能正常工作: p>
Step 1: Install and activate the plugin.
第1步: em>安装并激活插件。 p>Step 2: If you are using a Cache plugin (eg: WP Super Cache), delete the cache.
步骤2: em>如果您使用的是Cache插件(例如:WP Super Cache),请删除该缓存。 p>Step 3: Exclude facebook bot from the HTTP to HTTPS redirection in your HTaccess file.
第3步: em>在HTaccess文件中,将Facebook bot从HTTP重定向到HTTPS排除在外。Here’s an example:
这是一个示例: p>
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] p>
The above rewrite rule excludes facebook bots from the redirect.
以上重写规则将Facebook漫游器从重定向中排除。 p>
Step 4: Wait for 30 days for facebook to rescrape your pages.
步骤4: em>等待30天,以便Facebook重新抓取您的页面。Your ‘share count’ will return when facebook rescrapes your page.
当Facebook重新抓取您的页面时,您的“共享数”将返回。 p>
Test to see if this works
测试一下是否可行 h3>
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:
操作方法如下: p>