Linking to your own posts also known as interlinking is great for SEO. However with pingbacks enabled on your site, interlinking posts can become annoying because WordPress automatically creates new pingback for that post. These pingback appear in the comments section of your posts. While some users may like this feature, many users donβt find it useful. In this article, we will show you how to disable self pingbacks in WordPress.
What is a Pingback?
Pingbacks give softwares the ability to communicate between websites. Its almost like remote comments. Think of it like this:
- We write a post on WPBeginner blog.
- Then you write a post on your blog mentioning/linking to our article.
- Your blogging software (WordPress) will automatically send us a pingback.
- Our blogging software (WordPresS) will receive the ping. It will then automatically go to your blog to confirm that the pingback originates there (check if the link is present).
- Then we will have the ability to display your pingback as a comment on our post. This will solely be a link to your site.
Pingbacks also work within your site. So if one of your posts link to another post, then your WordPress will send a self-ping. This can get really annoying.
Fore more details, take a look at our guide about trackbacks and pingbacks.
Now that you know what is a pingback, letβs take a look at how to disable self pingbacks.
There are multiple ways you can disable self pingbacks on your WordPress site. We will show you both plugin method and manual code method.
Disable Self Pingbacks in WordPress Using Plugins
There are two plugins that you can use to turn off self pings.
1. Using No Self Pings Plugin
First thing you need to do is install and activate the No Self Pings plugin. The plugin works out of the box, and there are no settings for you to configure. Simply activating the plugin will turn off self pingbacks.
You will notice that No Self Pings plugin hasnβt been updated for more than two years. Usually we do not recommend installing plugins that havenβt been updated this long. Simply because in most cases those plugins do not work. However, No Self Pings is very simple plugin, and it works even with the latest version of WordPress (4.2.3 At the time of writing this article).
We recommend you to read our guide on the issue of installing plugins not tested with your WordPress version.
2. Using Disabler Plugin
Simply install and activate the Disabler plugin. Upon activation, visit Settings Β» Disabler page to configure the plugin.
You will notice that the plugin allows you to turn off several WordPress features. You need to scroll down to Back End Settings section and check the box next to Disable self pings option.
Click on the save changes button to store your settings.
Turn Off Self Pings Without Using a Plugin
If you do not want to use a plugin, then you can use these two methods to turn off self pings on your site.
1. Turn off Pingbacks Globally
WordPress allows you to turn off pingbacks on your site. By using this option will disable pingback feature completely on your site.
Simply go to Settings Β» Discussion page. Under the Default article settings section, uncheck the box next to βAttempt to notify any blogs linked to from the articleβ option. Click on the save changes button to store your settings.
2. Manually Insert Code to Disable Self Pingbacks
If you are comfortable with adding code snippets to your WordPress theme files, then you can use this method to switch off self pings.
Simply copy and paste this code in your themeβs functions.php file or a site-specific plugin.
1 2 3 4 5 6 7 8 | 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' ); |
Thatβs all, we hope this article helped you disable self pings on your WordPress site. You may also want to check our guide on how to put a stop on WordPress trackback spam.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.