IN THIS ARTICLE
Why does recovering your social share counts matter?
We all know how important it is to display share counts for your content. Share Counts establish social proof and credibility, making a big difference to boost visitor confidence.
But what if you need to move your site or blog to a new domain name or more likely, move from HTTP to secure HTTPS? (Google is pushing for a shift to SSL, there is no secret in this) If you've already done so, you may notice that all your Share Counts for your content disappear i.e. reset to zero as soon as you make the move…
To explain: Sharing destinations (like Facebook and Pinterest) typically track and report share counts separately for each URL pattern. When a site changes its URL pattern, the sharing destinations consider the new URLs as brand new pages, completely unrelated to the old URLs.
… and you’re left asking yourself how do I recover my share counts and all that hard-earned social proof you worked so hard for over months and years?! This can be incredibly frustrating. It is not a pleasant situation at all. So, what can you do?
What is Share Count Recovery
Fortunately, thanks to Shareaholic, you can now activate HTTPS and keep your Social Media Share Counts. You can even switch your domain (ex. moving from free.wordpress.com to customdomain.com, or www.name.com to just the domain name.com) or URL structure and keep all your social share counts!
Shareaholic’s Share Count Recovery feature enables you to recover any missing shares that may have been lost in the URL change. Once the Share Count Recovery feature is active, Shareaholic will begin to fetch share counts for both URLs, add them together, and display the combined total. Voilà – all your hard work and social proof will, again, be fully accounted for and only display for all to see!
Note: You do not need to have had Shareaholic installed before your domain, URL structure or SSL switch. Share Count Recovery should work on any site at any time and activates immediately. Switch now and recover your valuable share counts!
Share Count Recovery is an active process. What this means is that we look up share counts for various versions of the URL and add them up when appropriate. So if you deactivate the feature, this process will stop and your share counts will go back to what they would normally be without Share Count Recovery enabled.
Recover Your Shares When...
Scenario | Example(s) | |
1. | SSL migration |
http ⟹ https (ssl) http://domain.com ⟹ https://domain.com |
2. | Domain name migration | olddomain.com ⟹ newdomain.com |
3. | Sub-domain to domain migration | free.wordpress.com ⟹ customdomain.com |
4. | Domain to sub-domain migration | domain.com ⟹ blog.domain.com |
5. | Sub-domain to sub-domain migration |
www.domain.com ⟹ domain.com |
6. |
URL / Permalink structure migration
|
domain.com/2017/09/sample-post/ ⟹ domain.com/sample-post/ domain.com/?p=123 ⟹ domain.com/sample-post/ domain.com/sample-post ⟹ domain.com/blog/sample-post/ |
How to Enable Share Count Recovery
-
Login to your Shareaholic account and select a Site Profile from the My Sites dropdown on the top of the page.
Note: Share Count Recovery is available to Site Profiles that are on a premium plan. If you are a premium plan subscriber with multiple site profiles in your account, the Share Count Recovery feature will be available for the Site Profile for which the premium plan is active.
- Click on Settings on the left-hand side of the page.
- Select the Sharing tab, and then click on Share Counts.
- If you have or are about to move your site from HTTP to HTTPS (SSL), click on the toggle button next to Combine HTTP & HTTPS Protocols.
If you changed your base domain (for example, moved from 'mysite.org' to 'mysite.com'), click the toggle button next to Combine Previous Base Domain and enter your old base domain.
- Click 'Save Changes' and voilà - all your hard work and social proof will, again, be fully accounted for!
Combining Previous URL Structure
NOTE: This feature will only display recovered shares on the individual posts/pages - combined shares retrieved using this method will not be displayed on the index page or 'previews' of the posts.
- If you changed or are going to change the URL structure of your website, follow the above steps and click on the toggle button next to Combine Previous URL structure.
-
Next, specify the URL/permalink structure that you are migrating away from.
-
For WordPress Plugin users:
If the website is running Shareaholic's WordPress Plugin, you will see a number of additional preset options in the Shareaholic admin interface that are likely familiar to you. They are a direct reflection of the common permalink options available in the WordPress permalink settings menu. You can pick from Plain, Day and Name, Month and Name, Numeric, Post Category, Post name or specify a Custom format --
If you pick Custom Structure, you can use any of the following pre-built tokens:
WordPress Structure Tags Description 1 %year% The year of the post, four digits, for example 2004 2 %monthnum% Month of the year, for example 05 3 %day% Day of the month, for example 28 4 %hour% Hour of the day, for example 15 5 %minute% Minute of the hour, for example 43 6 %second% Second of the minute, for example 33 7 %post_id% The unique ID # of the post, for example 423 8 %postname% A sanitized version of the title of the post (post slug field on Edit Post/Page panel). So "This Is A Great Post!" becomes this-is-a-great-post in the URI. 9 %category% A sanitized version of the category name (category slug field on New/Edit Category panel). Nested sub-categories appear as nested directories in the URI.
Note: Let’s suppose you file your blog posts into multiple categories or subcategories. WordPress will only pull one category and one subcategory. If you didn’t choose a subcategory, then it will only show one parent category.
WordPress chooses the category alphabetically. For example, if you file a post in Apple and Technology categories, then WordPress will include apple in the URL because it comes first in alphabetical order.
http://example.com/apple/article-title-here/
If you file a post in Apple and a subcategory under that called Technology, then it will include both of them in the URL.
http://example.com/apple/technology/article-title-here/
If you selected a subcategory but didn’t specifically select parent category, then WordPress will still include parent category in the URL.
Another scenario is when you have a parent category, subcategory, and a sub-subcategory. WordPress will include all three of them in the URL.
http://example.com/apple/technology/events/article-title-here/
10 %author% A sanitized version of the author name -
For All Other Platforms:
Select "Custom Structure" and specify the previous URL structure in the Custom Structure settings.
For the above example to work, you'll need to define the value for %postname%, by inserting the following custom code into your site's HTML template in the <head> section above the Shareaholic.js script tag:
<script> _SHR_SETTINGS_CUSTOM = {"url_components":{"postname":"INSERT_VALUE"}}; </script>
You'll replace the 'INSERT_VALUE' text with your previous post URL structure. This section is fully customizable, and you can add and specify as many url_component tokens as you'd like! For example:
<script> _SHR_SETTINGS_CUSTOM = {"url_components":{"postname":"/blog/soup", "author":"jane"}}; </script>
-
Note: If you have selected both 'Previous Domain' and 'Previous URL Structure' in your Share Count Recovery settings, Shareaholic applies the Previous URL Structure to both your old and previous domains. This increases the number of calls that need to be made to fetch share counts. Keep this in mind as there may be page speed performance implications.
We encourage you to get creative! The possibilities are limitless.
Example 1:
The following is how you would recover social share counts after your WordPress blog is moved to SquareSpace. SquareSpace requires a folder slug for blog posts which leads to all counts being lost. Here's the solution to recover the counts -
<script>
// Removes "/blog" from current path and includes the URL for recovery
// Current: https://test.website.com/blog/2015/1/18/test/
// To Recover: https://test.website.com/2015/1/18/test/
var shr_path_name = window.location.pathname.split('/');
if (shr_path_name[1] == 'blog'){
shr_path_name.splice(0,2);
var shr_url = shr_path_name.join('/');
if (shr_url.substr(-1) != '/') shr_url += '/';
_SHR_SETTINGS_CUSTOM = {"url_components":{"postname":shr_url}};
}
</script>
Example 2:
You want to remove the ".html" while retaining your social Share Counts. To recover social share counts after you remove ".html" extension from your URLs -
<script>
// Adds ".html" to current path and includes the URL for recovery
// Current: https://www.luxurysocalrealty.com/blog/buying-equestrian-real-estate/
// To Recover: https://www.luxurysocalrealty.com/blog/buying-equestrian-real-estate.html
if (window.location.href.indexOf(".html") < 0) {
var shr_pathname = window.location.pathname;
if (shr_pathname.substr(-1) != '/') shr_pathname += '/';
_SHR_SETTINGS_CUSTOM = {"url_components":{"postname":shr_pathname.replace(/\/$/, '.html')}};
}
</script>
Example 3:
<script>
// Remove trailing "_postID" from current URL
// Current: https://blog.prusaprinters.org/recap-of-out-measures-during-the-covid-19-pandemic_33607/
// To Recover: https://blog.prusaprinters.org/recap-of-out-measures-during-the-covid-19-pandemic/
var shr_pathname = window.location.pathname;
if (shr_pathname.substr(-1) != '/') shr_pathname += '/';
_SHR_SETTINGS_CUSTOM = {"url_components":{"postname_custom":shr_pathname.replace(/_[^_]*$/, '/')}};
</script>
Example 4:
<script>
// Remove trailing "/" from current path and include the URL for recovery
// Current: https://blog.prusaprinters.org/recap-of-out-measures-during-the-covid-19-pandemic/
// To Recover: https://blog.prusaprinters.org/recap-of-out-measures-during-the-covid-19-pandemic
_SHR_SETTINGS_CUSTOM = {"url_components":{"postname_custom":window.location.pathname.replace(/\/$/, '')}};
</script>
Example 5:
<script>
// Blog directory changed from /blog (WP) to /blogs (Shopify)
// Current: https://test.website.com/blogs/post-name
// To Recover: https://test.website.com/blog/post-name
var shr_path_name = window.location.pathname.split('/');
if (shr_path_name[1] == 'blogs'){
shr_path_name.splice(0, 2, "blog");
var shr_url = shr_path_name.join('/');
if (shr_url.substr(-1) != '/') shr_url += '/';
_SHR_SETTINGS_CUSTOM = {"url_components":{"postname":shr_url}};
}
</script>
Example 6:
<script>
// Include older subdirectory "/holidays/halloween/" for recovery
// Current: https://www.website.com/blogs/holidays/definitive-ranking-best-worst-halloween-candies
// To Recover: https://www.website.com/blog/holidays/halloween/definitive-ranking-best-worst-halloween-candies
if (window.location.href.indexOf("/blog/holidays/halloween/") < 0) {
_SHR_SETTINGS_CUSTOM = {"url_components":{"postname_custom":window.location.pathname.replace('/blogs/holidays/', '/blog/holidays/halloween/')}};
}
</script>