Created
November 13, 2016 11:30
-
-
Save kasparsd/01078e01c481c35dd0d7e071fd1a7ed0 to your computer and use it in GitHub Desktop.
Delete all WordPress trackbacks and pingbacks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$comments = get_comments( array( | |
'type' => 'pings', | |
'fields' => 'ids', | |
) ); | |
foreach ( $comments as $no => $comment_id ) { | |
wp_delete_comment( $comment_id, true ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment