Skip to content

Commit c806b9e

Browse files
committed
Do not ping for no-indexed posts.
1 parent 3230569 commit c806b9e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

inc/namespace.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,16 @@ function maybe_ping_indexnow( $new_status, $old_status, $post ): void {
211211
return;
212212
}
213213

214+
/*
215+
* Skip for noindexed posts that have never pinged IndexNow.
216+
*
217+
* Previously pinged URLs are still pinged to encourage removal from
218+
* search engines.
219+
*/
220+
if ( SEOCompat\is_noindex( $post ) && empty( get_post_ping_urls( $post ) ) ) {
221+
return;
222+
}
223+
214224
/*
215225
* Prevent double pings for block editor legacy meta boxes.
216226
*/

0 commit comments

Comments
 (0)