Disable Self Pingbacks

Prevents WordPress from sending pingbacks to your own site

PHP

function disable_self_pingbacks(&$links) {
    foreach ($links as $l => $link)
        if (0 === strpos($link, get_option('home')))
            unset($links[$l]);
}
add_action('pre_ping', 'disable_self_pingbacks');

Snippet Feedback

Did this snippet work for you? Do you have any questions about this snippet? Leave some feedback below.

Language

Did it work?

Save Snippet

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.