Hi I would like to delete spam signups based on the data in the name field. I can delete them based on the email field using SQL but a lot of spammer but http in the name field. I can't do it in the admin section because there are over 40000 of these accounts. I would prefer to do it via sql or possibly php script. Any suggestions?
Try below query running:
DELETE FROM `customer_entity` WHERE email like "%qq.com%";
Suggesting few articles to read as well:
https://inchoo.net/magento/delete-spam-customer-accounts-magento/
Hello @tonycanada16f1 ,
Prevention:
Most of the spambots will be filtered out by activating Magento’s built-in captcha for the registration form. So it's better to use the captcha.
It can be easily activated in administration under Settings->Customer->Customer Configuration->CAPTCHA. there are several options, as well as forms to be activated on.
you can check the following guide
https://inchoo.net/magento/delete-spam-customer-accounts-magento/
Thanks
Problem solved? Click Kudos & Accept as Solution!
If you want to delete spam signups based on the data in the name field using SQL, you can use the SQL LIKE operator with a wildcard character % to search for and delete records that match a certain pattern in the name field. For example, if you want to delete records that have the string "http" in the name field, you can use the following SQL query:
sql
Copy code
DELETE FROM [table_name] WHERE [name_field] LIKE '%http%';
Replace [table_name] with the name of your table and [name_field] with the name of the field where the name data is stored. This query will delete all records where the name field contains the string "http" anywhere in the field.
Alternatively, you can use a PHP script to connect to your database and execute the SQL query to delete the spam signups. Here's an example PHP script:
php
Copy code
<?php
// Replace these variables with your database credentials
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "database_name";
// Create a connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check for errors
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Define the SQL query to delete spam signups based on the name field
$sql = "DELETE FROM [table_name] WHERE [name_field] LIKE '%http%'";
// Execute the query
if ($conn->query($sql) === TRUE) {
echo "Spam signups deleted successfully";
} else {
echo "Error deleting spam signups: " . $conn->error;
}
// Close the connection
$conn->close();
?>
Replace [table_name] and [name_field] with the name of your table and the name of the field where the name data is stored, respectively. Run this PHP script on your server to delete the spam signups based on the name field.
Remember to always backup your database before executing any SQL queries or scripts that delete data.
Regards,
Rachel Gomez