In the WP Grid Builder Facebook group (unofficial), a user asks:
Hi All, I’m looking for a way to update the contents of a grid that is set to ‘Content Type > Terms’ and is being used on a single post template, to only show the terms the currently being viewed post has. Any suggestions?
This Pro tutorial shows how wp_grid_builder/grid/query_args filter can be used to limit the terms of a WP Grid Builder terms grid to only the terms of the current post when viewing any single post.
Let’s say your “Categories Grid” is set up like this:

When this grid’s shortcode is inserted in the single post template, *all* the terms in the site will be output.
To limit the terms to only the current post terms, add the following in child theme‘s functions.php or a code snippets plugin:
/**
* Filter the query args for a terms grid to only show terms associated with the post.
*
* @param array $query_args The query args.
* @param int $grid_id The grid id.
*
* @return array
*/
add_filter( 'wp_grid_builder/grid/query_args', function ( $query_args, $grid_id ): array {
global $post;
// if it does not match grid id 1, return the query args
if ( 1 !== $grid_id ) {
return $query_args;
}
$taxonomy = 'category'; // change 'category' to the associated taxonomy.
$post_id = wp_doing_ajax() ? url_to_postid( wp_get_referer() ) : $post->ID;
// get the terms associated with the post
$terms = get_the_terms( $post_id, $taxonomy );
// if there are terms, get the term ids
$query_args['include'] = $terms ? wp_list_pluck( $terms, 'term_id' ) : [];
return $query_args;
}, 10, 2 );
Replace 1 in
if ( 1 !== $grid_id ) {
with the ID of your WPGB grid.