Stop Pingbacks on WordPress From Showing In Comments

by Josh Koop | Last Updated:  August 5, 2020
Apply to Ezoic Surfer SEO 7 Day Trial Brave Browser
Pro Blogger Income is owned and operated by Pro Blogger Income is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Pro Blogger Income also participates in affiliate programs with Avantlink, Clickbank, CJ, ShareASale, and other sites. Pro Blogger Income is compensated for referring traffic and business to these companies.

For anyone who gets irritated with pingbacks to their posts when they link them the code below you can add to a [ Code Snippets ] Plugin to stop these from running on your blog.

Install the Code Snippets Plugin

  1. New Code Snippet
  2. Title: Stop Self Pingbacks
  3. Code: Paste the below code block
  4. Set To Run Snippet Everywhere
  5. Save Changes and Activate
function no_self_ping( &$links ) {
    $home = get_option( 'home' );
    foreach ( $links as $l => $link )
        if ( 0 === strpos( $link, $home ) )
add_action( 'pre_ping', 'no_self_ping' );
I love technology, I have plenty of technical side experience but never really thought of blogging as a way to earn an income. With everything that has gone on in the last couple years and the instability of the job markets I started to learn how to blog and build affiliate niche sites to add more income channels to give me the chance to break free from the financial chains that bind me and find real freedom!