Title: Delete user using wordpress query
Last modified: August 21, 2016

---

# Delete user using wordpress query

 *  [Vaib](https://wordpress.org/support/users/vaibhavg/)
 * (@vaibhavg)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/delete-user-using-wordpress-query/)
 * Hi i create a custom template and run a query to understand how to execute query
   in wordpress. I run this query
    <?php global $wpdb; echo $sql = $wpdb->prepare(“
   DELETE FROM wpdb->users WHERE ID = 5”, $id) ; $wpdb->query($sql); ?>
 * But it’s not working. how can we run wordpress query.

The topic ‘Delete user using wordpress query’ is closed to new replies.

## Tags

 * [custom-query](https://wordpress.org/support/topic-tag/custom-query/)
 * [Delete User](https://wordpress.org/support/topic-tag/delete-user/)

 * 0 replies
 * 1 participant
 * Last reply from: [Vaib](https://wordpress.org/support/users/vaibhavg/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/delete-user-using-wordpress-query/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
