• In the dashboard, I want to hide the recent comments for the pages or posts that is password protected. Are there any ways on doing that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Jhaz!

    Yes, that is possible. Edit the post and under the Discussion panel, tick the Allow Comments checkbox. That should disable the list of comments and the comments form for that particular post.

    If you don’t see the Discussion box in the post editor, you can enable it from the Screen Options.

    Hope that helps.

    Best Regards,
    Ismael

    Thread Starter jhaz

    (@jhaz)

    @sighlence In the dashboard, under the activity block, it shows the recent comments, I just want it to not show there, not disable the comments entirely.

    Hi Jhaz!

    Thank you for the clarification.

    You can toggle the whole Activity box from the Screen Options, but not the Recent Comments section inside it. It’s possible, but you have to manually edit the wp_dashboard_site_activity function in the wp-admin\includes\dashboard.php file, and remove this block of code.

    $recent_comments = wp_dashboard_recent_comments();
    
    	if ( ! $future_posts && ! $recent_posts && ! $recent_comments ) {
    		echo '<div class="no-activity">';
    		echo '<p class="smiley" aria-hidden="true"></p>';
    		echo '<p>' . __( 'No activity yet!' ) . '</p>';
    		echo '</div>';
    	}

    Or use the following css code to influence the style of the dashboard and hide the comments section.

    #activity-widget #latest-comments {
    	display: none;
    }
    

    This short article should help.

    https://css-tricks.com/snippets/wordpress/apply-custom-css-to-admin-area/

    Best Regards,
    Ismael

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Hiding recent comments for certain posts/page’ is closed to new replies.