EDITED - I discovered that my problem only arises when the Yoast plugin is active. But I want to keep Yoast active, so my updated question is: Any idea what to do for comment replies working while Yoast is activated?

Here's my original question:

In a custom theme created by myself, or rather its child theme on a multisite, I am having trouble with the comment_reply_link function. I am using it as follows:

<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

Now on the website, the link doesn't result in the expected /?replytocom=6#respond appended to the URL of the post, but simply in a local #comment-6 href attribute for the link. So when a user clicks on "Reply", nothing happens. When he/she writes a reply then, it is posted as a first-level reply, not as a reply to the intended previous comment.

1 Answer 1


Version 7 of WordPress SEO by Yoast removes the replytocom variables by default.

We’ve removed the option to turn off the replytocom variable. The replytocom feature in WordPress lets you reply to comments without activating JavaScript in your browser. However, every comment gets is own link and these could all end up in the search engines. So we now remove these variables by default.

To get the replytcom variables back we can add the following filter in our theme's functions.php

add_filter( 'wpseo_remove_reply_to_com', '__return_false' );
  • thank you, that works.
    – Johannes
    Jun 11, 2019 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.