Threaded Comments Depth Control

This snippet allows you to control the maximum depth of threaded comments, preventing deeply nested comment threads.

PHP

function custom_thread_comments_depth($args) {
    $args['max_depth'] = 3; // Set the maximum depth of nested comments
    return $args;
}
add_filter('wp_list_comments_args', 'custom_thread_comments_depth');

Snippet Feedback

Did this snippet work for you? Do you have any questions about this snippet? Leave some feedback below.
SHARED BY

Tags

Language

Did it work?

Save Snippet

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.