Permalink change and loss of social sharings
-
Hello,
I have recently changed my permalink from the default (/?=postid) type to /%category%/%postname%/ and lost my social sharing counts.
Here are two link I was inspired to resolve that problem.
https://encosia.com/preserving-social-sharing-counters-through-a-url-change
https://lutfitorla.com/keeping-sharethis-digg-digg-social-counts-after-a-wordpress-permalink-change
Here is the code I tried to adapt (I’m a more than a newbie in this…)
and it’s not working… I try to paste it at the beggining of the Flare coding…If anyone had an idea of what is wrong…
Thank you !
$sharing_url = get_permalink(); $url_change_id =572; $post_id = get_the_ID(); $sharing_url = get_permalink(); if ($post_id < $url_change_id) { $url_id_postfix = "/?p=" . $post_id; $sharing_url = str_replace("://karinshibata.com" . ('Categories'), "://karinshibata.com" . $url_id_postfix, $sharing_url); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Permalink change and loss of social sharings’ is closed to new replies.