Results 1 to 6 of 6

Thread: Is there a way to avoid self-ping (trackbacks) without plugins?

  1. #1
    Karl1's Avatar
    Karl1 is offline Hello World
    Join Date
    Jul 2011
    Location
    Seville, Spain
    Posts
    35

    Default Is there a way to avoid self-ping (trackbacks) without plugins?

    Hi,
    anyone knows a way to avoid self-pings (trackbacks) without the need of a plugin?

    (too much info around the internet, but none seems to be concise)
    thanks

  2. #2
    Jeffro's Avatar
    Jeffro is offline WPTavern Forum Admin
    Join Date
    Jan 2009
    Location
    Ohio
    Posts
    2,359

    Default

    I don't think you can, not without disabling pingsbacks for everything. The good news though is that there is a plugin that's sole purpose is to disable self pingbacks.

    http://wordpress.org/extend/plugins/no-self-ping/

    Perhaps you could look within the plugin and figure out the code to use in your functions.php file so you don't end up using the plugin.

  3. #3
    Karl1's Avatar
    Karl1 is offline Hello World
    Join Date
    Jul 2011
    Location
    Seville, Spain
    Posts
    35

    Default

    yes, that's what I was thinking about :)

    thanks

  4. #4
    kovshenin's Avatar
    kovshenin is offline Hello World
    Join Date
    Sep 2011
    Location
    Moscow
    Posts
    14

    Default

    Not tested, but here's a one liner for your functions.php file ;)

    PHP Code:
    add_action'pre_ping'create_function'&$links''foreach ( $links as $k => $link ) if ( 0 === strpos( $link, get_option( "home" ) ) ) unset( $links[$k] );' ) ); 

  5. #5
    Karl1's Avatar
    Karl1 is offline Hello World
    Join Date
    Jul 2011
    Location
    Seville, Spain
    Posts
    35

    Default

    that doesn't work
    Discovering Wordpress

  6. #6
    Otto's Avatar
    Otto is offline On The Rocks
    Join Date
    Apr 2009
    Location
    Memphis, TN
    Posts
    865

    Default

    Just use the plugin. It's *tiny*. It doesn't add any real load. Simpler = better.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •