There are a couple of ways you could do it, both involving examining the article tags which com_content produces, comparing them with the tags which you want to keep, and discarding the tags which don't match.
You can do this either by creating an override of the com_content layout display.php
for displaying an article (as described in https://docs.joomla.org/J3.x:How_to_use_the_Template_Manager#Creating_Overrides) or you could use a content plugin which is triggered by onContentPrepare and remove the unwanted tags that way.
Either way, you should use the TagsHelper API to get the tags associated with the specific parent, and the searchTags()
method will do this for you. Examples of calling this function are given in the Tags API Guide.
The basic plugin code which will do something like what you want is below. You may need to adapt it slightly - for example, this matches all descendants of tag with id=4, not just immediate children, and there are views other than com_content.article
where articles are output. I'm not guaranteeing that it's totally bug-free!
<?php
defined( '_JEXEC' ) or die;
use Joomla\CMS\Helper\TagsHelper;
use Joomla\CMS\Factory;
class plgContentLimittags extends JPlugin
{
public function onContentPrepare($context, &$article, &$params, $page = 0)
{
$parts = explode(".", $context);
$app = Factory::getApplication();
if ($app->isClient('site') && isset($parts[0]) && $parts[0] == "com_content" && isset($parts[1]) && $parts[1] == "article" && isset($article->id, $article->tags, $article->tags->itemTags))
{
$filters = array('parent_id' => 4);
$allowedTags = TagsHelper::searchTags($filters);
foreach ($article->tags->itemTags as $index => $tag)
{
$found = false;
foreach ($allowedTags as $allowedTag)
{
if ($tag->tag_id == $allowedTag->value)
{
$found = true;
break;
}
}
if (!$found)
{
unset($article->tags->itemTags[$index]);
}
}
}
return true;
}
}