You work hard to get your content shared, and you deserve to be able to display your social proof appropriately. But what if you end up changing your permalink structure? Or what if you decide to make your site more secure by adding SSL (HTTPS)?
Well, in most cases, all your social share counts will disappear.
Since social networks only track counts against a specific URL, it’s effectively a “new” URL if that permalink structure changes. This happens even if you’ve done a great job at creating proper 301 redirects.
Don’t worry. Social Warfare allows you to recover all your precious share counts and social proof.
Background Information: How It Works
In order to recover your social share counts, Social Warfare will make two requests to the various social networks. One request will use your current URL permalink structure, while the other will use your previous one. Once the numbers have been fetched, if they are not an exact match, we will add them together before displaying them on the buttons.
If the numbers match, the plugin assumes that that network is tracking the change and has already compensated accordingly. However, this only usually applies to HTTP to HTTPS or WWW to non-WWW (or vice versa). However, if a proper system of 301 redirects is in place, some networks can also detect other changes.
Note: Our plugin will only fetch share counts for two patterns, the current structure, and one previous structure. If you’ve changed more than once, you must pick the previous structure you believe has the most shares.
In order to come up with that secondary, previous URL permalink structure, you’ll need to tell our plugin what that structure used to look like. You can follow the steps below to accomplish that.
Step 1: Navigate to the Share Recovery Settings
Within your site’s dashboard, click on the Social Warfare menu item, then click on the Advanced tab at the top of the screen. Scroll down to Share Recovery and change the toggle to the ON position.
Share recovery enables you to bring back old shares from Pinterest and Facebook (in most cases) after changing your permalink structure or domain.
Facebook recovery is currently only possible under certain conditions on certain sites – unfortunately, we can’t guarantee those shares can be recovered. LinkedIn and Twitter shares cannot be recovered.
Step 2: Configure Share Recovery
Previous URL Format
If you’ve changed your permalink structure, select the previous structure using the dropdown. If this hasn’t changed, leave it as “Unchanged.”
Custom Permalink Format
If you used a custom permalink structure previously that isn’t offered in the dropdown, choose “custom” from the dropdown and enter it here in this type of format:
/%category%/%postname%/
For a list of acceptable parameters, please see the WordPress Codex.
Previous Connection Protocol
If you changed from http to https (or vice versa), choose the old/former connection protocol using this dropdown. If this hasn’t changed, leave it set to “Unchanged.”
Previous Domain Prefix
If you’ve switched to or from using www, use this dropdown. If not, leave it set to “Unchanged.”
Subdomain
If you previously used a subdomain (such as blog.domain.com), enter the subdomain here without http or https. If not, leave it blank.
Former Domain and Current Domain
If you’ve changed your domain entirely, enter the “naked” domain here. Example:
Step 3: Use the debug tool to confirm the correct pattern
If you want to double-check that your share recovery is set up correctly, simply use our
?swp_cache=rebuild&swp_recovery_debug=true
string on any post permalink to see what alternate permalink is being tracked.
So, for example, you would check
http://yourdomain.com/post-name/?swp_cache=rebuild&swp_recovery_debug=true
then view the page source (right-click > View Source) and search for swp_recovery_url
. The URL shown should be the exact URL of the previous structure, AKA the URL you want to get the shares from.
Recovering from a Specific URL Manually
If you’ve changed the URL for a specific post or page that doesn’t fit the pattern in your Share Recovery settings, you can follow a few steps to set the previous/recovery URL manually:
- In Social Warfare > Advanced > Share Recovery, turn the toggle ON if you haven’t already. If you haven’t changed your permalinks or added SSL, you don’t need to fill in any other recovery settings.
- Edit a post (or page) and click on Screen Options in the top right corner, just under the top admin bar.
- Check the box for Custom Fields, then click Screen Options again to close the toggle (you should only have to do this once).
- Scroll down past the normal editor box and look for the custom fields section.
- You’ll see a bunch of fields – just scroll past them all until you see the Add New Custom Field section at the bottom of the list. Click the Enter New link on the left.
- Enter
swp_recovery_url
in the field on the left and the old URL on the right. (see an example) - Click the Add Custom Field button.
- Save/update the post.
Once you’ve done that, view the post and add
?swp_cache=rebuild&swp_recovery=debug
to the end of the URL in your address bar, then hit Enter. That will force the count to update immediately (it will also update on its own within 48 hours if you don’t have time to go through and refresh manually).
Final Notes
You must keep share recovery activated for Social Warfare to continue adding the counts together. Social Warfare has a setting built in that won’t allow it to display counts if it fetches counts that are lower than it previously fetched. This is because every once in a while, the API share count request fails, and it ends up returning the number zero. However, if it fetches the number zero and previously fetched the number 10, we keep using the number 10.
With this in mind, here’s how it would turn out if you activate share recovery long enough to recover shares and then simply turn it back off:
- Activate share recovery function
- 10 (current URL) + 10 (former URL) = 20 shares
- Deactivate share recovery function
- Fetch 15 (current URL). Less than prev. Show 20
- Fetch 18 (current URL). Less than prev. Show 20
- Fetch 25 (current URL). More than prev. Show 25
- Activate custom recovery function
- Fetch 25 (current URL) + 10 (former URL). Show 35
So make sure that if you use the share recovery function on your site, you remember to keep it turned on afterward.
Conclusion
These settings should cover just every possible scenario for permalink or URL changes to your Social Warfare-enabled site. Please note that your recovered counts will be lost if you ever deactivate or remove Social Warfare from your site. However, as long as Social Warfare is activated, your recovered counts are safe.
If you still have questions about how this function works, feel free to contact our support team.