The following script will help in hiding the GTM NoScript under the <body>
tag.
// Add Google Tag code which is supposed to be placed after opening the body tag.
function gtm_hidding_script_body() {
echo '<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-IDXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->';
}
add_action( 'wp_body_open', 'gtm_hidding_script_body' );
Make sure to add the script after replacing the GTM ID in the function.php
file of the WordPress active theme.