• Home
  • About
  • Insights Hub
    • New Posts
    • Technical SEO
    • General Discussion
    • View All Forums
  • Blog
  • Contact
    • Hub
      New posts Search forums
    • What's new
      New posts New profile posts Latest activity
    • Members
      Current visitors New profile posts Search profile posts
    Log in Register
    What's new Search

    Search

    By:
    Advanced search…
    • New posts
    • Search forums
    Menu
    Log in

    Register

    Install the app
    • Home
      • Hub
      • Technical SEO
      You are using an out of date browser. It may not display this or other websites correctly.
      You should upgrade or use an alternative browser.

      NoIndex (MetaRobots) URLs with Tag Manager

      • Thread starter Chris
      • Start date Sep 24, 2021
      • Sep 24, 2021
      This easy-to-follow tutorial will show you how to deploy the noindex meta robots tag on a URL using Google Tag Manager and jQuery. This method is useful for digital marketers and SEO professionals that unfortunately do not have access to edit the DOM head on a client's website. Which can be an all too often common occurrence.

      Usages of this tag:
      1. Noindex thin and low-quality pages (old blog posts, etc)
      2. Noindex rogue facetted/parameter URLs
      3. Noindex duplicate content URLs

      This method overrides any existing meta robots tag as well as injecting a fresh meta robots tag if there was no meta robots tag present in the DOM head.

      Step 1 - Log in to GTM and create a new tag. We are going to name the tag NoIndex MetaRobots, although, you can set the tag name to whatever you like. The tag configuration type is Custom HTML. Next, paste the following JavaScript snippet into the text editor box.
      Code:
      <script>
      jQuery('meta[name="robots"]').remove();
      var meta = document.createElement('meta');
      meta.name = 'robots';
      meta.content = 'noindex';
      jQuery('head').append(meta);
      </script>

      nonindex2.PNG

      Step 2 - Next up is the firing trigger configuration, I have named this trigger NoIndex MetaRobots trigger. Set the trigger type as 'Page View DOM Ready'. We want the trigger to fire on 'Some DOM ready events' (do not set it all DOM ready events). The event conditions are 'Page URL' > 'Contains' > /url-goes-here/ save the trigger.

      nonindex3.PNG

      Step 3 - You can now publish the new tag and trigger to your live GTM container. View the rendered HTML to the page that you have deployed the tag to fire on (refresh browser window if you already had it open. Also, there is a big difference to view the page source and viewing the rendered HTML. I use a Chrome extension called 'View Rendered Source'.

      nonindex1.PNG

      Here is it in practice
      nonindex4.PNG

      The method above requires jquery 3.0 or newer. You can check the jquery version by entering this snippet in the browser console.
      Code:
      jQuery.fn.jquery

      One final point. If you need to deploy the noindex tag on multiple URLs, then using a lookup table will save you time. Thanks for reading, feel free to comment below.
       

      Attachments

      • nonindex4.PNG
        nonindex4.PNG
        11.1 KB · Views: 0
      Click to expand...
      C
      Written by

      Chris

      Administrator
      Staff member
      • Messages
        51
      • Reaction score
        0
      • Points
        6
      You must log in or register to reply here.
      Share:
      Facebook Twitter Reddit Pinterest Tumblr WhatsApp Email Share Link

      New Posts

      • vogeldm
        SEO and Digital Marketing services
        • Started by vogeldm
        • Apr 22, 2022
        • Replies: 0
        Technical SEO
      • C
        Dropped .UK Domains 11th April 2022
        • Started by Chris
        • Apr 11, 2022
        • Replies: 0
        General Discussion
      • C
        Google Sheets Regex for excluding subfolders
        • Started by Chris
        • Oct 12, 2021
        • Replies: 0
        Technical SEO
      • C
        Modify or Deploy Meta Viewport - Google Tag Manager
        • Started by Chris
        • Sep 24, 2021
        • Replies: 0
        Technical SEO
      • C
        Open-source tools & projects that use Lighthouse
        • Started by Chris
        • Sep 24, 2021
        • Replies: 0
        Technical SEO
      • C
        How to Force HTTPS using .htaccess (cPanel)
        • Started by Chris
        • Sep 24, 2021
        • Replies: 0
        Technical SEO
      • C
        Canonical Tag Override using Google Tag Manager
        • Started by Chris
        • Sep 24, 2021
        • Replies: 0
        Technical SEO
      • C
        Websites to use DNS Prefetching & Prefetching
        • Started by Chris
        • Sep 24, 2021
        • Replies: 0
        Technical SEO
      • Hub
      • Technical SEO

    Join the Community

    Chris Lever is a freelance SEO Consultant availible for Hire. Join the growing SEO Community Forum to learn new skills.

    Join Us

    Need Help?

    • BB Code
    • Cookie Policy
    • Terms of Use
    • Privacy Policy
    • HTML Sitemap

    Learn More

    • About
    • Availability
    • Popular Posts
    • Projects & Scripts
    • Contact

    Get in Touch

    Chris Lever, Manchester, United Kingdom
    info@chrisleverseo.com
    +44 0161 883 2249

    © 2021 Chris Lever SEO. All rights reserved. Powered by Xenforo

    • This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
      By continuing to use this site, you are consenting to our use of cookies.
      Accept Learn more…