[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Delete all forum posts (vbulletin/php)

Posted on 2011-05-02
Medium Priority
Last Modified: 2012-05-11
I am a user on a forum and now want to delete all posts I have made from that forum. I can manually goto each post, click edit, click delete, and delete the posts. However, this is not a pratical solution for a large number of posts (>5k).

I'm sure there must be a way using php to cycle through the posts if I have a list of the post/thread id's to systematically delete the posts.

The vbulletin forum code taken from the delete post bit looks like this:
<form class="vbform block" action="editpost.php?do=deletepost&amp;p=1387087" method="post">
	<h2 class="blockhead">Delete Post</h2>
	<div class="blockbody formcontrols">
		<h3 class="blocksubhead">Select the appropriate options and then click the <strong>Delete</strong> button.</h3>
		<div class="section">
			<div class="blockrow">
			<dl class="dep_group">
					<dt><label for="delete"><input type="checkbox" class="dep_ctrl" id="delete" name="dodelete" value="1" tabindex="1" /> Delete this post in the following manner:</label></dt>
					<dd id="delete_deps">
						<ul class="group checkradio">
								<dl class="group dep_group floatcontainer">
									<dt><label for="deltype_soft"><input type="radio" id="deltype_soft" checked="checked" class="dep_ctrl" name="deletepost" value="delete" tabindex="1" /> Delete Message</label></dt>
									<dd id="deltype_soft_deps">
										<input type="text" name="reason" class="textbox primary" value="" tabindex="1" />
	<div class="blockfoot actionbuttons">
		<div class="group">
			<input type="submit" class="button" value="Delete Post" tabindex="1" />
	<input type="hidden" name="s" value="" />
	<input type="hidden" name="securitytoken" value="1303979356-07f41ff782fe86f8f02350cd2d1a73d620a65ee3" />
	<input type="hidden" name="p" value="1387087" />
	<input type="hidden" name="url" value="www.thewebsite.com/forums/showthread.php?127861" />
	<input type="hidden" name="do" value="deletepost" />

Open in new window

If I have both the thread id the post is in, and the post id itself for every post, can anyone think of a way to cycle through this list automatically deleting the posts by using the above code? Cheers :)

Question by:Ross
  • 4
  • 2

Expert Comment

ID: 35507028
Is the forum yours / do you have access to the mysql database?
For a large number like that I would think the easiest way would be a simple mysql query to remove all posts that match your userID.  I would highly recommend doing a backup first though if this is even an option for you.

Author Comment

ID: 35507137
No I'm not - if I was it'd be easy like you say :)

I need a way to do this just with my regular forum rights. Any ideas?

Expert Comment

ID: 35508711
not offhand, no.  Normal forum authentication and security will prevent you from carrying functions like that out.  All forums I know of will validate each of those requests by session / user authentication, which you wouldn't have since the script would not be running on the forum host server.

I would probably request assistance from a forum admin.  I know SMF for example has a standard admin option to remove a forum account along with all posts and threads associated with it.  Then if you still wanted an account there you could just re-create it.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 35508859
What about something like a vba action that fires a browser session to do it? That way we're already authenticated via the cookie? Can we pass the delete command in the URL on it's own?
LVL 12

Expert Comment

by:Mohamed Abowarda
ID: 35511018
Since you don't have access to the database, it won't be as simple as it could be.

Create PHP cURL script to access the forum and delete each post for you.

Accepted Solution

Ross earned 0 total points
ID: 35831944
Paid for a coder to develop a tool to do this for me.

Author Closing Comment

ID: 35872669
solutions posted here didn't address my issue - went to private coder.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month20 days, 3 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question