Use the tax_query parameter with the taxonomy set as post_tag. See the following previous answer:
Related Posts:
- Posts with at least 3 tags of a list of tags
- Better way to get tag stats?
- Given a WP_Query, how can I get a list of tags?
- Executing Queries in tag.php
- How to order posts tag by tag?
- post_type is ignored by WP_Query when ‘tag’ argument is included
- WP Rest API v2 return posts with specific tag
- Loop through all tags & output posts in alphabetical list
- Order posts by tags count?
- How to get any tag ID
- Get all posts without tags
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- How to exclude products by tag from woocommerce shop page?
- Pagination problem after WP_Query with tag filtering
- Query post from all category with same tag on 1 pages
- reducing the amount of wp_query calls
- WordPress Related Post by tags in Single.php
- How to build a WP_Query using mulitple tags and using AND or OR operator between them
- Include tags in WP_Query
- Search for multiple tags?
- Display posts from only one post form in custom query and exclude in main query
- How can I make WP_Query get posts that have a tag but also have random other tags?
- Cluster WooCommerce products in each Category Archive by Tags assigned to products
- Display tags with random thumbnail from selection of posts with that tag
- Query posts intersecting tags and categories
- Combining categories (Query posts with multiple taxonomy terms)
- Order by most used tag
- WP Query with multiple tags by get the tags
- How to not display tags with less than X posts
- Query Posts by Tag and exclude
- Get posts that do not have the same tags as current
- exclude product with available tag
- WP_Query by keyword OR post tag
- Display posts by tag
- Creating attachments archive in tags and categories
- Get posts with no tags?
- Filter products on category AND tag
- Only show tag with the same id as the post
- Get posts that match defined arrays of tags
- Order posts by tags count?
- Fix wp_term_relationships slow query in get_posts
- getting posts by tags
- Search with WP_Query, but ignore href URLs in anchor tags?
- Show posts from categories instead of tags
- post_type not working when tag__in is present?
- Related Post by Tags Code
- I cannot get tax_query in get_posts() to work with custom taxonomy
- WordPress custom query by archive title
- How to create page that lists tags by initial letter?
- Random posts in WP_Query when searching by tag
- Issue attempting a wp_query_posts with tags
- Limit Tags display and ad Drop Down Menu
- Can’t seem to get an else statement correct? [closed]
- Get posts that were most recently tagged
- How to query posts based on lat-lng coordinate as post meta?
- WP_Query displaying ALL posts
- How to combine tax_query and date_query in WordPress
- wp_query display posts from same category of the post
- Targeting specific pages in the loop
- Order posts by meta value and Date
- Include Sticky Posts in Page Post Count for custom query
- Query sticky posts with thumbnails
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- Can you order posts from wp_query by two custom meta fields?
- Pagination working everywhere but the index page
- How do I search inside specific taxonomies in WordPress
- What’s the purpose / logic of split_the_query in WP_Query->get_posts
- if statement in wp_query arguments
- Need wp_query to return all children and grandchildren
- How to use offset in WP_Query
- new WP_Query to get max price meta value not working
- wp_query should show stickies first
- wordpress search word, “hello world” ===> ‘hello+world’ ===> ‘hello’, ‘world’
- Wp query show post by author name or post title or post content
- wordpress ajax relationship query
- WordPress query_posts by tag doesn’t work anymore(?)
- Admin Page Post Id wp_reset_postdata not working
- Multiple queries and performance – wp_query
- Display single most recent post in category on every page of category archive
- Show menus to one admin username
- inserting content of 1 Post to in another with a template hierarchy
- get_posts custom field
- Get the child category ID of current category
- Limit number of posts in WP_query per month
- Custom query does not find pages
- Display posts ONLY from the current logged in user and current week/year/month Elementor posts
- What’s wrong with this meta query? (order by meta key, then title, doesn’t work)
- Change normal grids to masonry grids
- order posts by a secondary query that counts items
- WP_Query, ACF field and array
- WordPress pagination not returning posts on second page
- Query 3 meta_key and orderby
- how to avoid reloading/refresh the page when displaying the post of wp_list_categories
- Pagination not working with WP_QUERY
- Extract video content from post to display on front page
- Carousel slider with WP_Query to show 3 posts on each slide
- how to use transient method?
- How to replecate the _fields parameter in custom REST api endpoint
- wp_query, calculate with two dates when ‘key’ is text format
- Use value from meta key array for use in WP_Query