前言介紹
- 這款 WordPress 外掛「Change OG URL To HTTP」是 2017-08-24 上架。
- 目前有 100 個安裝啟用數。
- 上一次更新是 2018-07-17,距離現在已有 2483 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.1 以上版本才可以安裝。
- 有 2 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
inorbit |
外掛標籤
http | og url | og url yoast | og url aioseo | retain facebook likes |
內容簡介
當你將博客從HTTP轉換為HTTPS時,所有的帖子/頁面都會失去Facebook的讚和分享數。唯一重新獲得這些讚和分享數的方法是添加一個‘OG URL’標籤,並將其指向舊的‘HTTP’ URL,如Facebook所述,詳見此處。
這個WordPress外掛可以幫助你實現這一點。
例如,如果你使用像Yoast這樣的SEO插件,OG URL標籤會自動反映HTTPS版本的URL。這個外掛會添加一個過濾器到‘OG URL’的輸出中,並將所有現有的帖子/頁面都更改回‘HTTP’版本。啟用此外掛後添加的新帖子/頁面不會受到影響。
同樣地,正版URL標籤保持不變,為‘HTTPS’。這個標籤由搜索引擎如Google使用,因此當涉及到SEO時你不需要擔心。
這個外掛會更改以下流行插件的OG URL輸出:
Yoast SEO插件
ALL In One SEO Pack
WP Facebook開放圖形協議by Chuck Reynolds
Facebook開放圖形、Google+和Twitter卡片標籤插件by Webdados
注意
此外掛僅會更改在安裝時已經存在的帖子/頁面中的‘OG URL’標籤。這樣所有新發布的帖子都會有正常的OG URL標籤,並且都為‘HTTPS’。
實現外掛的步驟
你需要按照以下步驟來實現此外掛:
步驟1:下載並安裝此外掛。
步驟2:如果你使用了緩存插件(例如:WP Super Cache),請刪除緩存。
步驟3:在你的.HTaccess文件中排除Facebook機器人免受HTTP到HTTPS重定向的影響。以下是一個示例:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_USER_AGENT} !facebookexternalhit/[0-9]
RewriteRule ^(.*)$ https://sitename.com/$1 [R=301,L]
上述重寫規則排除了Facebook機器人的重定向。
步驟4:等待30天,直到Facebook重新抓取您的網頁。當Facebook重新抓取您的頁面時,您的分享計數將返回。
檢測外掛是否有效
你可以立即檢查你是否已經正確實現此外掛,強制Facebook重新抓取一個或多個頁面。具體操作如下:
登錄Facebook帳戶,進入Facebook調試工具
輸入一個你的頁面/帖子的‘HTTPS’ URL,然后點擊‘Debug’按鈕。
如果你收到了“此URL尚未在Facebook上分享。”的消息,請點擊‘Fetch New Information’按鈕。
現在點擊‘Scrap Again’。你現在應該能夠看到所有你頁面的‘讚’,你也可以在‘Redirect path’標題下看到兩個URL,反映了您的og:url元標籤和原始的HTTPS URL。
即使您沒有手動重抓您的URL,Facebook 也會在30天內自動重新抓取你的URL。所以你的所有‘分享計數’都會在30天內恢復。
想添加新功能?
如果你想添加新功能到這個外掛中,只需發送一封電子郵件給我。 點此找到我的郵件地址。
原文外掛簡介
When you shift your blog from HTTP to HTTPS, all your posts/pages lose facebook likes/share count. 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.
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. This plugin adds a filter to the ‘OG URL’ output and changes it back to ‘HTTP’ for all existing posts/pages. New posts that you add after this plugin is activated will not be affected.
Similary, the canonical URL tag remains unchanged as ‘HTTPS’. Canonical tag is used by search engines like Google. So you are good when it comes to SEO.
This plugin changes the OG URL output for the following popular plugins:
Yoast SEO Plugin
ALL In One SEO Pack
WP facebook open graph protocol by Chuck Reynolds
Facebook Open Graph, Google+ and Twitter Card Tags plugin by Webdados
Note
This plugin only changes the ‘OG URL’ tags for posts that existed when this plugin is first installed. This way all new posts will have the regular OG URL tags with ‘HTTPS’.
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.
Step 2: If you are using a Cache plugin (eg: WP Super Cache), delete the cache.
Step 3: Exclude facebook bot from the HTTP to HTTPS redirection in your HTaccess file. Here’s an example:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_USER_AGENT} !facebookexternalhit/[0-9]
RewriteRule ^(.*)$ https://sitename.com/$1 [R=301,L]
The above rewrite rule excludes facebook bots from the redirect.
Step 4: Wait for 30 days for facebook to rescrape your pages. Your ‘share count’ will return when facebook rescrapes your page.
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. Here’s how you can do that:
Login to your facebook account and go to Facebook debugger tool
Enter the ‘HTTPS’ url of one of your pages/posts and click the ‘Debug’ button.
If you get the “This URL hasn’t been shared on Facebook before.” message,click on the ‘Fetch New Information’ button.
Now click ‘Scrap Again’. You should now be able to see all your ‘likes’ to the page. You would also see two URLs under the ‘Redirect path’
heading which reflects your og:url meta tag and your original HTTPS URL.
Even if you do not manually rescrape your URLs, facebook will automatically rescape your URLs within 30 days. So all your ‘share counts’ will return within 30 days.
For detailed information on these steps, check out this article
Want any new features?
Want any new features added to this plugin? Just send me an email. You can find my email here.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Change OG URL To HTTP」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Mailgun for WordPress 》Mailgun 是超過10,000名網站和應用程式開發人員信任的電子郵件自動化引擎,用於發送、接收和追踪郵件。藉助Mailgun強大的郵件API,開發人員可以更多時間建立...。
WordPress Force HTTPS 》強制整個站點都使用 HTTPS。, 如有任何錯誤或功能需求,請至下方連結回報。, 錯誤回報:, , 至 Github 問題追蹤器 回報, , 問題/意見:, , http://www.kaiarm...。
Remove HTTP: Fix Mixed Content Warning 》, Remove HTTP 是一個外掛,可以自動掃描並從所有連結中刪除 http: 和 https: 協議。這有助於解決網站出現 "mixed content warnings" 的問題,這種問題通常是...。
Cache-Control 》良好的快取策略是提高效能的最佳方法之一,而它也可以成為您的新朋友。透過控制您的 WordPress 網站的 HTTP Cache-Control 標頭,讓中介伺服器和瀏覽器快取功...。
WP Cron HTTP Auth 》這個外掛可在使用 HTTP 授權的網站上啟用 WP Cron。, 使用方式:訪問外掛設定,輸入您的 HTTP 授權憑證,保存更改,完成。, 所有工作在背景中靜默且自動進行...。
Remote Content Shortcode 》使用 [remote_content url="http://www.example.com"] 短碼來使用 cURL 將遠端主機上的內容匯入文章或頁面中。支援 HTML 的 GET 與 POST、BASIC 驗證、HTML ...。
Lucas String Replace 》Lucas String Replace 可以在任何 WordPress 處理的頁面上將任何字符串替換為其他字符串。, 它會在 WordPress 的最終輸出中替換定義的字符串為其他字符串。, ...。
WP HTTP Compression 》這個外掛可以讓您的 WordPress 網誌在支援壓縮的瀏覽器中以 gzip 格式輸出頁面。, HTTP 壓縮通常會使網頁大小減少 60-80%(對於寬頻用戶),並且下載速度提高...。
Domain Theme 》Domain Theme 外掛能讓你在 WordPress 的安裝中指定多個網域名稱,並為每個網域名稱選擇一個特定的佈景主題 (theme)。這樣,你可以讓你的網站在不同的網域名...。
osTicket Connector 》此 WordPress 外掛支援透過 osTicket API 創建新的 osTicket 系統問題單。本外掛只支援採用 wp_mail 函數發送電子郵件的聯絡表單,以便獲取表單資料。, 注意...。
Simple Redirection 》這個 WordPress 外掛可以簡單地將所有頁面重新導向到指定的 URL,可用於暫時或永久性的重新導向。。
WP Serverless Forms 》將 PHP 表單動作替換為 API 和 WebHook 驅動的服務,例如 IFTT、Basin、FormKeep、Formspree、自訂端點等。, WP Serverless Forms 的主要功能包括:, , 適用...。
WP htaccess Optimize (beta) 》使用 WP htaccess Optimize,您可以輕鬆地透過幾個點擊設置您的htaccess,以優化您網站的性能。, 優化選項包括:, , 時區選擇, 防止未包含 index.php 的文件...。
WordPress Force HTTP 》這個 WordPress 外掛可以強制讓你的網站前端採用 HTTP 協議,而只讓管理員使用 HTTPS 協議。, 如果你發現任何錯誤或是想提出新功能的建議,請到下面的連結回...。
"SEO-HEADERS-Easy" Protocol HTTP 1.1 》英文, 此外掛可發送 Last Modified、Cache Control 和 304 Not Modified 標頭 - 此為根據「客戶端 - 服務器 - 客戶端」原則發送的 HTTP 標頭。如有缺少相應標...。