Created
September 26, 2024 09:04
-
-
Save abdulawal39/21b6dcd1a2abac3007593b5ad0d855dd to your computer and use it in GitHub Desktop.
Use this code in your active theme's functions.php file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tncpvfw_support_disable_pdfviewer_archive_and_hide_from_google($args, $post_type) { | |
if ($post_type === 'pdfviewer') { | |
$args['has_archive'] = false; | |
} | |
return $args; | |
} | |
add_filter('register_post_type_args', 'tncpvfw_support_disable_pdfviewer_archive_and_hide_from_google', 10, 2); | |
function tncpvfw_support_add_noindex_meta_tag() { | |
echo '<meta name="robots" content="noindex, nofollow" />'; | |
} | |
add_action('tnc_pvfw_head', 'tncpvfw_support_add_noindex_meta_tag'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment