How to add meta noindex, follow tag, to just one page?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blrs
    Member
    • Oct 2014
    • 38
    • 5.1.x

    How to add meta noindex, follow tag, to just one page?

    I would like to add <meta name="robots" content="noindex, follow" /> tag to my-domain-name.com/help of vBulletin, how would I do that? It would be just one page, all the other ones, need to remain, unchanged.

    Thanks.
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 73981

    #2
    You should use a robots.txt file to prevent the indexing of a single page. There is no way to add additional meta tags to a single page without additional programming.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • glennrocksvb
      Former vBulletin Developer
      • Mar 2011
      • 4011
      • 5.7.X

      #3
      You can do this with a template hook.
      1. Go to AdminCP > Products & Hooks > Manage Hooks > Add New Hook
      2. Fill out the details:
        Hook Location: header_head
        Title: Insert Meta Tags Hook
        Template Name: hook_insert_meta_tags
        Hook Arguments: page=page
      3. Click Save.
      4. Go to AdminCP > Styles & Templates > Style Manager > Select Add New Template for the target style/theme
      5. Fill out template details:
        Title: hook_insert_meta_tags (same as the template name specified in the hook you created)
        Template: (update list of url prefixes as needed. By default, it includes Help ('help') and PM ('privatemessage') pages)

        HTML Code:
                <vb:comment>specify url prefixes of pages that you want to add meta noindex tag to</vb:comment>
        	{vb:set url_prefixes, {vb:php array, 'help', 'privatemessage'}}
        	<vb:if condition="in_array($page['urlprefix'], $url_prefixes)">
        	 <meta name="robots" content="noindex, follow" />
        	</vb:if>
      6. Click Save.
      7. Repeat Steps 4-6 for each style/theme you want to add the hook to. (Optional)

      Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

      Comment

      • Guest

        #4
        Hi,

        I'm trying to add those meta tags to some channales (I won't use them): home, blogs, articles, groups, albums. I've already restricted them to been non accesible to non registered and registered users (just admin), but I also want to add the robots meta tag <meta name="robots" content="noindex, follow" /> to those pages because Google can index them and I want to avoid it.

        How can I make it? I'm trying to add 'blog', 'article', 'https://www.mysite.com/blogs' to "{vb:set url_prefixes, {vb: php array, 'help', 'privatemessage'}}" but it doesn't work.

        Any help? Thanks.
        Last edited by Guest; Wed 25 Dec '19, 3:59am.

        Comment

        • Wayne Luke
          vBulletin Technical Support Lead
          • Aug 2000
          • 73981

          #5
          Home is the first page you see on your site. You'll want Google to view this or nothing on your site will be indexed. Google will follow the permissions of the Guest User group so if you set the channels to so that usergroup can't see them, then they won't be indexed. You can edit the Navigation Bar to remove links to them in Site Builder.

          Not sure why you want to exclude albums though. It would prevent your users from attaching and sharing images.

          Further you can manually exclude them in the XML Sitemap Priority page in the AdminCP. Though if guests can't see them, they are excluded by default.
          Translations provided by Google.

          Wayne Luke
          The Rabid Badger - a vBulletin Cloud demonstration site.
          vBulletin 5 API

          Comment

          • Wayne Luke
            vBulletin Technical Support Lead
            • Aug 2000
            • 73981

            #6
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API

            Comment

            • Guest

              #7
              Originally posted by Wayne Luke
              Home is the first page you see on your site. You'll want Google to view this or nothing on your site will be indexed. Google will follow the permissions of the Guest User group so if you set the channels to so that usergroup can't see them, then they won't be indexed. You can edit the Navigation Bar to remove links to them in Site Builder.

              Not sure why you want to exclude albums though. It would prevent your users from attaching and sharing images.

              Further you can manually exclude them in the XML Sitemap Priority page in the AdminCP. Though if guests can't see them, they are excluded by default.
              I don't know why but my home channel redirects to "articles". I don't use articles in my forum as well as albums, so that's the reason why I need to put those meta tags in those pages (they actually show 404 page to non autorized users).

              Thanks.

              Comment

              • Guest

                #8
                Voted.

                Comment

                • Wayne Luke
                  vBulletin Technical Support Lead
                  • Aug 2000
                  • 73981

                  #9
                  Edit your "Home" tab so it points somewhere besides /articles. Or you renamed your Article channel to Home.

                  When I visit your site as a guest user, I see the standard Homepage with a list of forums. There is no link to "home". This means there is no "home" for search engines to index. The search engine will only see what a guest user sees. It won't follow random links just because.

                  If for some reason, your articles channel is showing up in your XML Sitemap go to XML Sitemap -> Manage Content Priority in the AdminCP. Change the priorities for your channels and set Home to "Exclude".
                  Translations provided by Google.

                  Wayne Luke
                  The Rabid Badger - a vBulletin Cloud demonstration site.
                  vBulletin 5 API

                  Comment

                  Related Topics

                  Collapse

                  Working...