Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How To Disable Self-Pings In WordPress?

Interlinking is great for SEO. However, by enabling the pingbacks on your website, Wordpress automatically create pingback on that post when one of your posts linked to another post. These pingbacks will appear in the post comment section. While some users like this feature and some users don’t find it useful. We can disable Self-Pings in WordPress. In this article let’s check, How to Disable Self-Pings in WordPress?

Disable Self-Pings In WordPress

What is a Pingback in WordPress?

A pingback in WordPress is a comment that automatically created on another website when you add the other post link in your blog post. Pingback allows notifying the other blogger that their post link was added in your website article.

A Pingback will be created when another website has enabled pingback on their website.

How Pingback works?

Pingback works like an automatic comment system as like below example.

  • I write a blog post on my Royalecash blog.
  • You write a post on your blog and added our blog link to your blog post.
  • Then your WordPress automatically send a pingback to Royalecash blog.
  • Royalecash will receive the ping and notifies in the post comment section. Now I’ve the ability to display the pingback as a comment in the post comments section.

Pingbacks also work within the site. These are called self-pings.

What are self-pings?

If any of your post links added to another post, WordPress will send the self-pings to the linked post.

By enabling the pingbacks on your website, you’ll also receive the pingback on your post when one of your post link to another post. These are called self-pings.

self pings comment.jpg

These are really annoying. You can disable these self-pings. Let’s check how to disable self-pings.

How To Disable Self-Pings In WordPress?

You can easily disable self-pings by using 2 methods.

  1. Using a plugin.
  2. Adding code snippet to function.php file.

Now I’ll demonstrate how to disable self-pings using code and plugin.

Disable self-pings with No Self Pings Plugin:

Login to your WordPress dashboard, install and activate the No Self Pings Plugin. Check this beginner’s step by step guide to install and activate the plugins.

That’s it you no need to do anything. There are no settings to configure to work this plugin. After activating the plugin, it will work out of the box and disable self-pings on your WordPress website.

Adding code snippet to function.php file:

WordPress being a self-hosted platform, we can easily add any type of support by adding a small code in theme function.php file.

Login to your WordPress dashboard and go to Appearance > Editor.

Open your theme function.php file and paste the below code snippet.

function no_self_ping( &$links ) {
$home = esc_url( home_url() );
if ( 0 === strpos( $link, $home ) )
unset( $links[ $l ] );
}
add_action( 'pre_ping', 'no_self_ping' );

This method is very simple. But In case if you change the theme in the future, all changes will be lost.

I hope this article helped you in Disabling Self-Pings In WordPress. Please share this article on Facebook, Google + and Twitter.

The post How To Disable Self-Pings In WordPress? appeared first on Royal Ecash.



This post first appeared on Royalecash, please read the originial post: here

Share the post

How To Disable Self-Pings In WordPress?

×

Subscribe to Royalecash

Get updates delivered right to your inbox!

Thank you for your subscription

×