Site icon The _khAttAm_ Blog

[HOWTO] Make disqus comments do-follow in WordPress

I am using Disqus Comment System v2.61 and it shows comments as nofollow. This is a concern for several WordPress users as their commentators may not be interested to comment if they get no link love via comment url. The disqus comments are later generated by Javascript but it also contains the basic comments for browsers without Javascript. While I have not yet figured out how the Javascript later inserts “nofollow” attribute later when regenerating the comments with Javascript, I have figured out how to remove the ‘rel=”nofollow”‘ from the link of the basic page, which should work for search engine robots. In the version of Disqus Comment System I am using, the comment_author_url() seems to not work. So, I replaced it with get_comment_author_url() and it seems to work. Following is the new comments.php which shows the links as do-follow.

	echo "

Disqus Debug thread_id: “.get_post_meta($post->ID, ‘dsq_thread_id’, true).”

    <li id=”dsq-comment-“> <div id=”dsq-comment-header-” class=”dsq-comment-header”> <cite id=”dsq-cite-“> <a id=”dsq-author-user-” href=”” target=”_blank”> <span id=”dsq-author-user-“>
<div id=”dsq-comment-body-” class=”dsq-comment-body”> <div id=”dsq-comment-message-” class=”dsq-comment-message”>

blog comments powered by Disqus

/* <![CDATA[ */
	var disqus_url = ' ';
	var disqus_identifier = '';
	var disqus_container_id = 'disqus_thread';
	var disqus_domain = '';
	var disqus_shortname = '';
	var disqus_title = ;
		var disqus_developer = 1;
	var disqus_config = function () {
	    var config = this; // Access to the config object

	       All currently supported events:
	        * preData — fires just before we request for initial data
	        * preInit - fires after we get initial data but before we load any dependencies
	        * onInit  - fires when all dependencies are resolved but before dtpl template is rendered
	        * afterRender - fires when template is rendered but before we show it
	        * onReady - everything is done

		config.callbacks.preData.push(function() {
			// clear out the container (its filled for SEO/legacy purposes)
			document.getElementById(disqus_container_id).innerHTML = '';
		config.callbacks.onReady.push(function() {
			// sync comments in the background so we don't block the page
			DISQUS.request.get('?cf_action=sync_comments&post_id=ID; ?>');
		$v) {
		        echo "{$k} = '{$v}';\n";
	var facebookXdReceiverPath = '';
/* ]]> */

/* <![CDATA[ */
	var DsqLocal = {
		'trackbacks': [

				'author_name':	,
				'author_url':	,
				'date':			,
				'excerpt':		<?php echo cf_json_encode(str_replace(array("\r\n", "\n", "\r"), '
', get_comment_excerpt())); ?>, 'type': } ], 'trackback_url': }; /* ]]> */ /* <![CDATA[ */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + disqus_shortname + '.' + disqus_domain + '/embed.js?pname=wordpress&pver='; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); /* ]]> */

You can replace your current comments.php with this file and have do-follow links for your blog readers. I have implemented it on this blog. Comment here and check the page source of my website to see a dofollow link to your website.

Exit mobile version