All Collections
Troubleshooting
Use Configuration Variables to Avoid Split Threads and Missing Comments
Use Configuration Variables to Avoid Split Threads and Missing Comments
Disqus avatar
Written by Disqus
Updated over a week ago

What are “split threads”?

When url or identifier are not defined, the Disqus embed will use the window URL as the main identifier when creating a thread. In other words, each unique URL Disqus loads on will result in a new unique thread. This works well for some sites, however, this method of creating threads can lead to duplicate “split threads” for the same page of content, especially when your site accepts many different URLs for the same page of content.

For example, one post on your blog may be accessed via http:// and https://. See Google’s Use Canonical URLs for other common reasons why a site may have many URLs for the same content.

When your site creates many “duplicate” Disqus threads, this can lead to the following unwanted results:

  • Comments in your Disqus forum may not display on the expected thread on your site, resulting in “missing comments”.

  • Engage email notifications may contain your site’s non original (a.k.a “noncanonical”) URLs that get seen by commenters and moderators.

  • Users may comment on a split thread resulting in multiple discussions that later need to be merged using our migration tools.

  • Your thread URL data that’s used on Disqus.com and in other Disqus features may be inaccurate.

Define url and identifier to Avoid Thread Splitting

We recommend that you define the url and identifier configuration variables within the disqus_config section of your embed code. See the installation instructions for the complete embed code.
​ 
 Example:

var disqus_config = function () {
 this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
 this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
 }

These variables should be defined by using your CMS’ or platform’s dynamic values, if available. For example, the Disqus WordPress plugin defines these variables by default using the following PHP values:

this.page.url = '<?php echo get_permalink(); ?>';
 this.page.identifier = '<?php echo dsq_identifier_for_post($post); ?>'; 

See our full documentation on Configuration Variables for more information.

Did this answer your question?