• Hi,

    It would be nice if we could turn off self-pingback. I’m constantly linking to my own articles. At least make it optional, controllable somewhere from wp-admin.

    Yes, there’s a plugin to stop self-pinging, but I looked at how the plugin works and it seems it doesn’t actually remove the pingbacks, just hides them (assuming I read the php correctly), which is obviously pretty suboptimal performance-wise!

    Thanks 🙂
    Glowing Face Man

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I put this in my functions.php for the same effect:

    <?php
    /* No Frakin' Self Pings
    */
    function no_self_ping( &$links ) {
            $home = get_option( 'home' );
            foreach ( $links as $l => $link )
                    if ( 0 === strpos( $link, $home ) )
                            unset($links[$l]);
    }
    
    add_action( 'pre_ping', 'no_self_ping' );
    ?>
    Thread Starter glowing-face-man

    (@glowing-face-man)

    Thanks. Is add_action also a non-standard addition? I added that at the end of functions.php and got a PHP error that add_action was undefined.

    Glowing Face Man

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    No, add_action is default to WP.

    http://codex.wordpress.org/Function_Reference/add_action

    What else is in your functions.php? Do you mind sharing?

    Thread Starter glowing-face-man

    (@glowing-face-man)

    I haven’t touched my functions.php. It’s standard WordPress 2.8.5 (or whatever the latest release is).

    Fatal error: Call to undefined function add_action() in /home4/glowingf/public_html/blog/wp-includes/functions.php on line 3350

    Now I’m a little worried, if you’re saying your snippet should work. Is something wrong with my intall..

    Glowing Face Man

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Your functions.php is a theme file, not a ‘standard wordpress’ file 🙂 I mean, it’s standard but it’s an optional file.

    About the theme functions file

    Remove the code from wp-includes/functions.php

    Put it in a NEW functions.php file in your THEME.

    ians

    (@ians)

    somebody help me..

    when I activate my themes I got and error message

    Fatal error: Call to undefined function add_action() in /home/friendko/public_html/GRABANDDEV.COM/wordpress-themes/skincare/wp-includes/functions.php on line 3725

    tnx.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    ians, please make a new post for this problem, preferably in this forum: http://wordpress.org/support/forum/5

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Feature removal request: self-pingbacks’ is closed to new replies.