Disqus Generates an Imaginary /forums link on websites

Update #3: I performed a Google search on WordPress forums and found other people with the same issue:
https://wordpress.org/support/topic/plugin-disqus-comment-system-crawl-errors-with-plugin
https://wordpress.org/support/topic/plugin-disqus-comment-system-disqus-comment-system-showing-weird-code-on-my-page.

Update #2: Disqus says the script below isn’t generated by Disqus. I’m guessing the Disqus plugin is not created by the folks at Disqus:
[blackbirdpie url=”https://twitter.com/#!/disqus/status/79018382791417856″]

Here’s the actual universal code for enabling comment counts on Disqus-enabled websites (from Disqus.com) which is different from what the Disqus plugin generates:

<script type="text/javascript">
    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
    var disqus_shortname = 'example'; // required: replace example with your forum shortname

    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function () {
        var s = document.createElement('script'); s.async = true;
        s.type = 'text/javascript';
        s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
        (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
    }());
</script>

Update #1: There’s an update to the Disqus commenting plugin right now. Not sure if this release is related to this matter, but I’ll be downloading to find out! πŸ™‚
Update to Disqus Commenting Plugin 06-09-2011

Disqus generates phantom /forums links
Disqus generates phantom /forums links

Since my switch from Habari to WordPress, I’ve come to love Google Webmaster Tools as a tool for hunting bad links out in the universe. I have Disqus commenting enabled on my site and I love the service, but I discovered something quite weird.

The Disqus commenting (java)script embedded in my site’s pages apparently generates a /forums link on the fly which Google crawls. Since I don’t have a forums page anywhere on my site, Google dutifully files that ‘bad’ link away and it’s on *every* page of my site. As of today, Google says there are over 100 pages on Jane Talks Tech (tag pages, post pages, category pages, archive pages, author pages, etc) that link to the non-existent janetalkstech.com/forums page. Granted, I could redirect that to something else as regular visitors don’t see the /forum link. However, this strikes me as odd behavior and I hope that Disqus will respond to my inquiry.

[blackbirdpie url=”https://twitter.com/#!/janetalkstech/status/78962649903276032″]

 

Here’s the “offending” script:

    <script type="text/javascript">
    // <![CDATA[
        var disqus_shortname = 'janetalkstech';
        var disqus_domain = 'disqus.com';
        (function () {
            var nodes = document.getElementsByTagName('span');
            for (var i = 0, url; i < nodes.length; i++) {
                if (nodes[i].className.indexOf('dsq-postid') != -1) {
                    nodes[i].parentNode.setAttribute('data-disqus-identifier', nodes[i].getAttribute('rel'));
                    url = nodes[i].parentNode.href.split('#', 1);
                    if (url.length == 1) { url = url[0]; }
                    else { url = url[1]; }
                    nodes[i].parentNode.href = url + '#disqus_thread';
                }
            }
            var s = document.createElement('script'); s.async = true;
            s.type = 'text/javascript';
            s.src = 'http://' + disqus_domain + '/forums/' + disqus_shortname + '/count.js';
            (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
        }());
    //]]>
    </script>

The particular link that generates the nonexistent janetalkstech[dot]com/forums link is this:

 s.src = 'http://' + disqus_domain + '/forums/' + disqus_shortname + '/count.js';

So get to checking your Crawl reports in Google Webmaster Tools, get to redirecting URLs and you’ll thank me later. πŸ™‚

Published by

Jane Ullah

I wear many hats. In no particular order, I am a: wife, geeky blogger, a twitter-happy aspiring photographer, and passionate about things I believe in.