Affiliate Disclosure: We may be compensated if you use our links to make a purchase. We are extremely selective in who we partner with & only recommend products we believe in. Our affiliate relationships do not influence our recommendations.

Focus Mode comment title custom text example
LearnDash Focus Mode comment title

If you’ve enabled comments in Focus Mode, the default title that appears before the comment box reads, “Leave a Comment.” This works fine for traditional blogs but it doesn’t always make sense for a LearnDash lesson or topic.

This article will show you how to use custom text instead of “Leave a Comment.”


In order to change this text, we’re going to use a piece of PHP code.

My preferred way to make changes like this is with the Code Snippets plugin. You could also add this code to the functions.php file of your child theme (if you’re using one), but I find Code Snippets to be easier to manage and less likely to bring your site down if you make a mistake.

  1. Install & activate “Code Snippets” from your WordPress plugins page
  2. Navigate to Snippets > Add New in the left sidebar
  3. Give your snippet a name. Something like “LearnDash – Focus Mode Comment Title Text”
  4. Paste the code snippet into the Code area
  5. Choose the Only run on site front-end option
  6. Click the Save Changes and Activate button

The Code Snippet

Here’s the code snippet that you’ll use:

Recommended ProductKinsta hosting to boost site speed
add_filter(
	'learndash_focus_mode_comment_form_args',
	function() {
		$comment_arguments = array(
			'title_reply' => 'Ask your questions here',
		);
		
		return $comment_arguments;
	}
);

The only thing you should change in the code above is the Ask your questions here text. Update that to whatever you want your new title to be.


For more tips, check out our comprehensive guide to LearnDash Focus Mode.