How to disable self-pings/self-trackbacks in WordPress

When someone links to your website, a pingback or a trackback is being sent to you. This is a great tool which can easily tell you who put a link to your site and you can even get an excerpt of the article with your link in it. That pingback/trackback can be found under your comments which you can approve or only view in the backend.

But if you place a link to your own post or page, WordPress is going to ping itself. That means you will get a notification (a new comment) for every internal link you use. While this might be useful in certain situations where you want to track your own links, more often than not it will be totally annoying and useless.

So, if you want to remove self-pings, you can choose one of the methods we’re going to show you in this article.

The first one requires manual insertion of the code, while the other one comes packed in a form of a free plugin.

Manual:

  1. Open your functions.php file
  2. Copy and paste the following code:
  3. //remove pings to self
    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' );
  4. Save changes

No Self Ping

PRICE: free

This plugin doesn’t require any configuration and it comes with no settings. What it does is the same thing we have shown you in the step above – it adds the required code so you don’t have to mess with functions.php file yourself.

  1. Go to Plugins->Add New
  2. Find “No Self Ping” plugin
  3. Install and activate the plugin

Disabler

PRICE: free

This is another plugin which does the same thing as the previous one.  Disabler is a better choice if you’re going to use some of its other functions. For example, this one can turn off texturization, automatic capitalization of the letter “P” in word “WordPress”, tag “<p>” which is automatically inserted, autosavings, post revisions, RSS feeds, etc. Unfortunately, the plugin hasn’t been updated for 2 years now so be careful if installing.

  1. Go to Plugins->Add New
  2. Search for “Disabler”
  3. Install and activate the plugin
  4. Under its settings, simply check the boxes next to things you would like to turn off in WordPress; check the “Disable Self Pings” box

START YOUR OWN BLOG

This guide is an introduction to mastering the art of blogging. It provides easy to follow steps to start, maintain, and grow your blog.

Read the guide

Leave a Reply

Your email address will not be published. Required fields are marked *