• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

how to mass delete users awaiting approval

#1
my forum at coconutbeef.com has been getting a ton of spam so i turned on registration approval. but now i have 350 spam users awaiting approval so how can i just delete them all thanks
 

Jake Bunce

XenForo moderator
Staff member
#2
Admin CP -> Users -> Users Awaiting Approval

It gives you the option to delete each user.

Unfortunately there is no option to mass-select an option on that page. But if you enable debug mode then you can edit the associated template to change the defaults. Add this line to your library/config.php file:

Code:
$config['debug'] = 1;
Then edit this template:

Admin CP -> Development -> Admin Templates -> user_moderated

Replace the contents of that template with this:

Code:
<xen:title>{xen:phrase users_awaiting_approval}</xen:title>

<xen:form action="{xen:adminlink 'users/moderated/update'}">
	<xen:foreach loop="$users" value="$user">
		<fieldset>
			<xen:controlunit label="{xen:phrase user}:"><a href="{xen:adminlink users/edit, $user}" target="_blank">{$user.username}</a> ({$user.email})</xen:controlunit>
			<xen:radiounit label="{xen:phrase action}:" name="users[{$user.user_id}][action]">
				<xen:option value="none">{xen:phrase do_nothing}</xen:option>
				<xen:option value="approve">{xen:phrase approve}</xen:option>
				<xen:option value="reject" selected="true">
					<xen:label>{xen:phrase reject_and_delete_with_rejection_reason}:</xen:label>
					<xen:textbox placeholder="{xen:phrase optional}" name="users[{$user.user_id}][reject_reason]" size="45" />
				</xen:option>
			</xen:radiounit>
			<xen:checkboxunit label="">
				<xen:option name="users[{$user.user_id}][notify]">{xen:phrase notify_user_if_action_was_taken}</xen:option>
			</xen:checkboxunit>
		</fieldset>
	</xen:foreach>
	
	<xen:submitunit save="{xen:phrase process_users}" />
</xen:form>
I just changed the default selections.
 

Morgain

Well-known member
#6
Best to add the CAPTCHA option with question and answer - under Options.
Otherwise you get loads of spam signups waiting email confirmation.
 

Kim

Well-known member
#9
If say you were wanting to clean up 1500 or so users awaiting approval, would you use this technique?

And if so...

Would you then have to replace the code afterwards to revert to the original template once you had cleaned up?

Thanks :)

Kim
 

Jake Bunce

XenForo moderator
Staff member
#10
If say you were wanting to clean up 1500 or so users awaiting approval, would you use this technique?
Yes.

Would you then have to replace the code afterwards to revert to the original template once you had cleaned up?
Doesn't matter. The template edit just changes the default selection to "delete". You can change it back or manually click a different option when you load the list of users.
 

Core Freedom

Well-known member
#20
ah, I got it. Didn't realize that the library change was "opening" the development area. I was able to make the changes. Works great. Do I need to remove that library code again to hide the development area?