`wp_delete_post` returns NULL
I am trying to delete a lot of WordPress posts programmatically using wp_delete_post
, but not all posts are deleted successfully. In some cases I get NULL
as a return value for
wp_delete_post($row-post_id, true)
and the post isn't deleted from the database.
There are both post
and page
post_types amongst those not deleted posts, as well as custom post types.
What can be the issue there, why aren't some posts deleted, while many others are deleted successfully?
Topic wp-delete-post Wordpress
Category Web