Created
November 6, 2015 08:48
-
-
Save denisstoyanov/1f2c896d8e6f3e519606 to your computer and use it in GitHub Desktop.
Deletes all comments
This file contains 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 | |
function delete_all_comments() { | |
$comments = get_comments(); | |
foreach($comments as $comment) { | |
wp_delete_comment($comment->comment_ID, true); | |
} | |
} | |
delete_all_comments() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment