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.

  • Anonymous

    Did you modify the plugin with the ‘official’ disqus code? The plugin does have it’s uses, but keeps generating /forum and pname=wordpress&pver=2.66 links.

  • Hey Jane, someone just contacted our support and mentioned a link to this post. Sorry for the earlier confusion here and for not seeing this post earlier. (To clarify, we do make the WordPress plugin in-house.)

    Looking over the situation, I think Giannii may have misunderstood the issue when he read your tweet. To elaborate on what’s happening, basically those “phantom” links are JavaScript-assembled links coded in the Disqus WordPress plugin. When search engines like Google try to crawl these dynamic links that results in 404 crawl errors. Historically we’ve recommended reaching out to Google directly about this, as enough feedback may help them develop a workaround on their end.

    Unfortunately this is not something we can fix as Disqus simply wouldn’t be anywhere near the product it is without relying heavily on JavaScript — our entire embed is JavaScript. This is an issue all JavaScript-assembled widgets face. That said, I realize this is still not something you’d like to see when logging in to Google Webmaster Tools, so please know we’re always striving to find a way to work around this and rest assured if we do find a way we’ll implement it straight away.

    Feel free to continue the conversation here, I’d be happy to answer any questions. Or reach out to us at http://disqus.com/support or http://twitter.com/disqus if we can ever lend a hand with anything else.

    • Hi Tyler!

      Thanks for the clarification. It’s not a big problem and I’m sure the thinkers at Disqus or Google will figure this out soon. 🙂

      Jane

  • it really makes me dizzy everytime i saw such kind of codes…thanks for the in for anyway.