Comments Link Not Working WordPress – Fix (including Disqus)

Some themes, and some plugins can cause the comments link found in the meta data at the top of a post in WordPress to break, luckily this is a very easy fix. One of the most common causes of this is installing a new comments plugin like Disqus – if you are looking for a Disqus fix, click here to jump to it.

The comment link at the top of a page is an ‘anchor link’, anchor links look something like:

Anchor links require an element on the target page to have the ID the same as the text after the ‘#’, as standard the comments anchor link is ‘#comments’ which means there needs to be a ‘div’ near the comments (or surrounding the comments) section; if this isn’t there the link will not work.

The easiest fix for this (if you are not using Disqus) is to open the comments.php file in the WordPress editor found under the appearance section – look to the right, locate the comments.php file and open it so you can see the code.

Search this file for anything that looks like the below:

If you cannot find any div with the ID ‘comments’, you will need to create one – simply copy the below and paste it at the very top of the comments.php file:

Save the file and check if the link is working or not. If it is not it is possible the comments anchor link has been renamed, when you click the comments link check the URL and see what is after the ‘#’ – whatever is written there needs to be used in the div, for example if the text after the hash is ‘blogcomments’ you need to paste the following at the top of the comments file:

Disqus Broken Comments Link Fix

The Disqus fix is similar to the above, all that is missing Is a div with the same ID as the anchor link. However you edit a different file to get this working, navigate to:

Plugins -> Editor

Then using the drop down box found in the top right corner of the screen select ‘Disqus Comment System’. To the right you will see a list of files required for the plugin to work, the file you need to edit is:


Click the file so it opens for editing and paste the below at the very top of the file and save it:

Go back to your website and check the comments link, it should now be working.

If you are using another commenting system, the process will be the same – open the comment plugin for editing and look for the file that ends in ‘comments.php’ and paste the above fix at the top of the file and save.