Ever added extra URLs to the No Self Ping plugin’s settings… and wondered why they’re still getting pinged? You’re not going crazy. The feature is broken. 🐛
The short version: There’s a logic bug that makes the “Additional URLs” feature completely non-functional. We found it, fixed it, and submitted the fix to the developer.
What No Self Ping Does
The No Self Ping plugin prevents WordPress from sending pingbacks to your own site when you link to your own content. Super useful for internal linking without cluttering your comments with self-pings.
It also has an “Additional URLs” feature where you can add other domains you don’t want to ping—like your staging site, subdomains, or related sites you own.
Except… that feature doesn’t work at all.
The Bug: Inverted Logic 🔍
We dug into inc/manage-pings.php and found this at line 31:
if ( is_array( $extra_urls ) ) {
$url_array = explode( PHP_EOL, $extra_urls );
}
See the problem?
The code checks if $extra_urls is an array. But look at line 29:
$extra_urls = sanitize_option( 'ping_sites', get_option( 'no_self_pings_option', '' ) );
The sanitize_option() function with ping_sites always returns a string, not an array. So is_array($extra_urls) always returns false.
The additional URLs you carefully entered? Never processed. Ever.
The One-Line Fix ✅
The fix is simple—just check if the string is not empty instead of checking if it’s an array:
❌ Before (broken)
if ( is_array( $extra_urls ) ) {
✅ After (fixed)
if ( ! empty( $extra_urls ) ) {
That’s it. Now the plugin actually reads your additional URLs and excludes them from pinging.
How to Apply the Fix Yourself 🔧
If you’re comfortable editing PHP:
- Open
wp-content/plugins/no-self-ping/inc/manage-pings.php - Go to line 31
- Find:
if ( is_array( $extra_urls ) ) { - Replace with:
if ( ! empty( $extra_urls ) ) { - Save the file
Note: Your fix will be overwritten when the plugin updates. Keep an eye out for the official fix.
We Submitted the Fix
We’ve reported this bug and submitted the fix through the WordPress.org support forums. Hopefully it’ll be included in the next release.
The Bottom Line
If you’ve been using No Self Ping’s “Additional URLs” feature:
- It’s been completely broken this whole time
- The fix is one line of code
- We’ve submitted the fix to the developer
Apply the fix yourself or wait for the update. Either way, at least now you know why those extra URLs weren’t being excluded. 🎯