• Resolved Udegbunam Chukwudi

    (@strictlyonlinebiz)


    My site load time is in need of drastic reduction this I’m doing away with unnecessary plug-ins.

    Please I’d like to know how to Exclude Trackbacks and Pingbacks from Defualt WordPress Recent Comments Widget without using a wordpress plug-in. The last solution to this problem offered 1 year ago in no longer valid.

    Cheers

Viewing 6 replies - 1 through 6 (of 6 total)
  • Try adding this to your theme’s functions.php file:

    if ( !$comments = wp_cache_get( 'recent_comments', 'widget' ) ) {
    	$comments = $wpdb->get_results("SELECT $wpdb->comments.* FROM $wpdb->comments JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID WHERE comment_approved = '1' AND post_status = 'publish' AND comment_type IN ('comment', '') ORDER BY comment_date_gmt DESC LIMIT 15");
    	wp_cache_add( 'recent_comments', $comments, 'widget' );
    }
    Thread Starter Udegbunam Chukwudi

    (@strictlyonlinebiz)

    Thanks for the fix. 😉

    BTW is there a way of getting it not to show blog author’s comments?

    this seems to be the recommended solution around. But it does not work for me (at least, now).
    Here’s the page:
    [URL Redacted]

    i’ve inserted the code, but recent comments widget still shows all the trackbacks and pingbacks

    and before you ask – i emptied all caches

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    menkaur – I removed the URL as it as tripping the spam filter, and I can’t tell if it’s actually an answer or not (I’m afraid I don’t speak that language). Perhaps you could just share the solution in a post?

    i DON’T SPAM.

    in any case, here’s how it solved it at the end – i just dropped the standard recent comments widget and got myself “Wizzart – Recent Comments” widget. in fact, i’m very much satisfied with it

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I didn’t say you slammed 🙂 the spam filter is an automated thing, and has yet to reach singularity so it can make mistakes. No need to shout. But thank you for explaining, it may help many people.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: RecentComments] Exclude Trackbacks and Pingbacks from Defualt WordPress Recent Comments Wid’ is closed to new replies.