Title: Get posts by tags using $wpdb
Last modified: August 21, 2016

---

# Get posts by tags using $wpdb

 *  [yox64](https://wordpress.org/support/users/yox64/)
 * (@yox64)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/get-posts-by-tags-using-wpdb/)
 * Hello!
 * Can anyone help me with an SQL query that gets all the posts that have two or
   more specified tags?
 * I know how to do it with get_posts(), but I need to do it with $wpdb.
 * Thank you!

The topic ‘Get posts by tags using $wpdb’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [tags](https://wordpress.org/support/topic-tag/tags/)
 * [wpdb](https://wordpress.org/support/topic-tag/wpdb/)

 * 0 replies
 * 1 participant
 * Last reply from: [yox64](https://wordpress.org/support/users/yox64/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/get-posts-by-tags-using-wpdb/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
