-
Hi,
I am changing my whole website to https instead of http. (this is my site http://www.new-synapse.com/aps/wordpress/)
This means my Facebook Comments and all share counts (FB, Pinterest etc.) will not load anymore(collected over 9 years).
I found your page about Filters (https://rankmath.com/kb/filters-hooks-api-developer/).Filter to change OpenGraph URL ( og:url ).
/**
* Allows the output of the canonical URL as OpenGraph URL, consolidating likes and shares.
*
* @link https://developers.facebook.com/docs/reference/opengraph/object-type/article/
* @param $url Canonical URL
*/
add_filter( ‘rank_math/opengraph/url’, function( $url ) {
return $url;
});Can you explain how I would get this to work?
I understand how to create the functions file rank-math.php.
But do I have to change the canonical url in all posts (95 posts and pages) to the http url first?
Or would I create a list of all 95 post urls, and then add that add_filter code to the rank-math.php file for 95 lines with the urls?
I read changing canonical urls for every url might have a problem – “However, this might not be ideal as the canonical URL wouldn’t output the correct reflection of it being HTTPS.”
Also, I hope it would work with Elementor Pro and the share button plugin…
FYI this is the official Facebook method: https://developers.facebook.com/docs/plugins/faqs#faq_1149655968420144
Thank you!
You must be logged in to reply to this ticket.