Remove All With A Certain Email Type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gobbly2100
    Senior Member
    • Jun 2006
    • 164
    • 3.6.x

    Remove All With A Certain Email Type

    Is it possible to remove all users with a certain kind of email address, For example remove everyone who has an email such as @spam.com ?
    PC Repair Poole - Web Directory - Diabetes Forum
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    I recommend you run a query to put those users into a new group, then prune by group. Use this query:

    Code:
    UPDATE user
    SET usergroupid = [color=red]X[/color]
    WHERE email LIKE '%@spam.com%'
    Where X is the usergroupid of the new group. Now prune by group:

    Admin CP -> Users -> Prune / Move Users

    Comment

    • deep_blue
      Member
      • Apr 2006
      • 69
      • 3.5.x

      #3
      hi

      when i am running this query in SQL, it is saying

      An error occurred while attempting to execute your query. The following information was returned.
      error number: 1054
      error desc: Unknown column 'X' in 'field list'

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        Change X to the usergroupid of the destination group which you will later prune.

        Comment

        • ximcix
          Senior Member
          • May 2004
          • 115

          #5
          Excellent.
          thanks for that tip Jake

          If only this could be accomplished via "Search For Users" using the email field then the results could be pruned, it would make life so much easier.

          Comment

          • Trevor Hannant
            vBulletin Support
            • Aug 2002
            • 24326
            • 5.7.X

            #6
            Originally posted by ximcix
            Excellent.
            thanks for that tip Jake

            If only this could be accomplished via "Search For Users" using the email field then the results could be pruned, it would make life so much easier.
            Pop it in the Suggestions forum....
            Vote for:

            - Admin Settable Paid Subscription Reminder Timeframe (vB6)
            - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

            Comment

            • volarium
              Member
              • Feb 2005
              • 34

              #7
              Can anyone provide guidance on how to apply this query to a custom profile field? Here is what I have:
              Code:
               
               
              UPDATE user
              SET usergroupid = 10
              WHERE $bbuserinfo[field6] LIKE [EMAIL="'%@%'"]'%html%'[/EMAIL]
              This gives me a SQL syntax error.
              Thanks in advance.

              Comment

              • Lats
                Senior Member
                • Mar 2002
                • 3671

                #8
                Try this...
                Code:
                UPDATE
                    user
                LEFT JOIN
                    userfield
                ON
                    user.userid = userfield.userid 
                SET 
                    usergroupid = 10
                WHERE 
                    userfield.field6 LIKE '%html%'
                Lats...

                Comment

                • volarium
                  Member
                  • Feb 2005
                  • 34

                  #9
                  Thank you so much for the quick response, this worked like a charm!

                  Comment

                  • Lats
                    Senior Member
                    • Mar 2002
                    • 3671

                    #10
                    Glad it worked for you
                    Lats...

                    Comment

                    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                    Working...