I am switching all my sites to https this week and am running into an issue. We use AddThis for our sharing widgets and according to their support all our social metrics will be reset to zero once the switch happens and they have no work round. We have 1000's of likes and shares on many pages and I really do not want to lose those metrics.

Are there any other techniques I can try to preserve the share/like counts? All sites run on WordPress.


1 Answer 1


The buttons are attached to the original URL and will not follow redirects. However, my understanding is that this is possible, that is - so save your shares.

For posts created prior to the SSL upgrade:

function buttons(){ var kCanonical = document.querySelector("link[rel='canonical']").href; window.kCompositeSlug = kCanonical.replace('https://','http://'); return; } buttons();

The above code changes the https:// part of the canonical link for http:// and stores it in a new variable.

What if you are completely changing your domain name? Then try this:

function buttons(){ var kCanonical = document.querySelector("link[rel='canonical']").href; window.kCompositeSlug = kCanonical.replace('https://newdomain.com','https://olddomain.com'); return; } buttons();

Triggering that javascript can be automated to run based on the date the post was published, so all posts published before a scheduled transition are automatically updated, see below:

{% if widget.oldPost %} Tweet document.write('</script>'); document.write(''); document.write(''); {% else %} Tweet {% endif %}

The above was made to be used within Hubspot, but it should be easy for a developer to chime in & help modify.

For wordpress, try a plugin called Warefare - I cannot attest to the validity of this, and it will cost you as it's a subscription-based service.

This page from addthis academy could also be useful.

I've also been told that support will help you preserve your shares as well, do try reaching out to them.

Best of luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.