Tag Info

Hot answers tagged

1

You can use Wp function for this. wp_delete_user(); this function work with user id. you can get all subscribers user id with this way: get_users() getting your filtered users. $get_subscribers = get_users('role=subscriber'); foreach($get_subscribers as $user){ wp_delete_user($user->ID); }


1

As @Charleston Software Associates mentioned, the DESCRIBE query should not be executed if the table doesn't exist. The best solution, as he pointed out, is to prevent the error from occurring in the first place. To do so, patch wp-admin/includes/upgrade.php as follows: Change the following line from dbDelta(): $tablefields = ...


1

Generally, WordPress has functions to handle what you want, it is much preferable to use them. For example, because it isn't a complete list, some of those are: wp_delete_user() wp_create_user() wp_insert_user() wp_update_user() The class behind (most of) it is: WP_User If you really need to know the SQL that is used, I would suggest you read the ...


1

This will create a new admin user called username with password: password in a database called DATABASE Try this: First create a row in wp_users. Replace DATABASE with your database name, username with your choosen username, password with your password of choice. INSERT INTO `DATABASE`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, ...


1

Bulk of WP's native data structures aren't meant for direct MySQL access. They are typically accessed via PHP APIs which take care of MySQL generation/execution and many more things, such as allowing to filter data, caching it for performance, and so on. Your issue here is that from MySQL point of view meta values aren't related to each other, but only to ...



Only top voted, non community-wiki answers of a minimum length are eligible