creative designer

If you're using Disqus (like me) you'll find that existing comments on your Shopify post will vanish after making any change to the handle. With a minor addition to your embed code you can keep rocking those old comments without concern.

Why does Disqus lose the comments?

The default JavaScript embed code uses the url of the page being viewed and saves it as the Identifier to store / save the relevant comment. Once you change the handle this Identifier no longer matches, so Disqus sees the post as a brand new one. This is the expected behaviour so no one is at fault here should you encounter this.

Everything is broken. How do I fix?

You could avert a minor heart attack and change the handle back to what it was. Cheap fix, but it will work. Since you've probably changed the handle for a reason I doubt that's a method you really want to do. There is a better way - just tell Disqus what the old url was. 

There's a post on the Disqus site that goes into some technical detail on this. 

For this site, whenever I change a handle I'll first store the original url as a metafield on the post. The metafield value is what I'll then use to pass the original Identifier back to Disqus in the disqus_config function.

window.disqus_config = function () { this.page.url = {{ article.metafields.global.originalUrl }}};

^ This is a bit of a simplification of what I really do but should give the general idea. To avoid sending the empty values to Disqus I also make sure the metafield is not blank, and doesn't match the current url before adding the config function.

Like to work with me?

Let's talk