Is 30 posts/sec considered slow for wp_delete_post?

Speed factor of any function that deals with content such as wp_insert_post() or wp_delete_post() highly depends on the situation and the content that it’s dealing with.

Let’s make a simple example. You have a post, that contains featured image, dozen of tags, categories, a thousand custom fields, assigned taxonomies, and a hundred more. When you run a command to delete this post, you are not just trying to delete a permalink from the database, you are also trying these:

  • Detach the post thumbnail
  • Remove a dozen of term relationships
  • Run a loop and deal with a million of metadata
  • And possibly more.

If you run a SQL command and just remove the post’s data from the database (not recommended), it might speed up to thousands of posts per second. But, fully removing the content and unlinking the relationships is heavy.