Delete forum threads

To delete a thread, you must perform the following:

  1. Get an instance of the manager.
    Get an instance of the ForumsManager object.
  2. Get the specified thread.
    Get an instance of the thread. For more information, read For developers: Query forum threads.
  3. Mark the thread for deletion.
    To mark the thread to be deleted, call the DeleteThread method of the manager and pass the thread as an argument.
  4. Save the changes.
    To delete the thread, save the changes to the manager.

NOTE: To delete multiple threads, query them and execute the code below for each thread.

NOTE: If you try to delete a thread that has posts in it, the posts will also get deleted.

Here is a code example:

Was this article helpful?