SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,888
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)

    Does anyone know the Google script to exclude text?

    I used to use SEO script similar to the following, have searched without success.
    PHP Code:
    <!== exclude-start ==>
    Top menuabouthelpetc
    <!== exclude-end ==> 
    Last edited by John_Betong; Mar 13, 2014 at 04:57. Reason: spelling: not my fortay
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  2. #2
    SitePoint Mentor silver trophybronze trophy
    Mikl's Avatar
    Join Date
    Dec 2011
    Location
    Edinburgh, Scotland
    Posts
    1,606
    Mentioned
    66 Post(s)
    Tagged
    0 Thread(s)
    John,

    If you are trying to prevent part of your page from being indexed by Google, those tags won't have any effect. In fact, I'm not aware of any tags that will tell Google to ignore part of a page. Of course, you can tell Google to ignore an entire page, but that's another matter.

    Why do you want to do this? It looks like you want to have Google ignore certain menus. Why? If you don't want it to follow the menus (that is, you want to to ignore the pages that the menu links to), a simple nofollow would do that.

    If I've misunderstood your question, my apologies. Perhaps you could clarify what you are trying to achieve.

    Mike

  3. #3
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,888
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by Mikl View Post
    John,

    If you are trying to prevent part of your page from being indexed by Google, those tags won't have any effect. In fact, I'm not aware of any tags that will tell Google to ignore part of a page. Of course, you can tell Google to ignore an entire page, but that's another matter.

    Why do you want to do this? It looks like you want to have Google ignore certain menus. Why? If you don't want it to follow the menus (that is, you want to to ignore the pages that the menu links to), a simple nofollow would do that.

    If I've misunderstood your question, my apologies. Perhaps you could clarify what you are trying to achieve.

    Mike
    Hi Mike,

    Many thanks for your reply. I am delighted to say that after a very lengthy Google search the script was found



    <!-- google_ad_section_start(weight=ignore) -->
    Repetetive text to be ignored
    ...
    ...
    <!-- google_ad_section_end -->
    Clarification of the problem:

    I have a Google Search Box on my article pages and a search returns umpteen references which are only snippet-menu-links and not the specific article. The snippet-menu-links are hidden in a <span> which only show when the link is hovered.

    The idea of excluding the snippet-menu-links with was to eliminate the Googled snippet-menu-links and only show the specific searched article.

    Here is a typical page:

    file: first-article.php
    Code:
    <!doctype html>
    <html>
    <head>
    <title>First Article</title>
    </head>
    <body>
    
    <div id="main'>
       <h1>First Article</h1>
       <p>lengthy blurb (about 1,000 words) goes here about the First Article</p>
    </div>
    
    <!-- google_ad_section_start(weight=ignore) -->
    <ul id='dynamic_snippet_links'><!-- Dynamically included on every page article -->
      <li>
        <a href='second-article.php'>
            Second Article
           <span><?php echo "100 line snippet from the article";?></span> 
        </a> 
      </li><li>
        <a href='third-article.php' title="<?php echo "100 line snippet from the article";?>">
           Third Article
           <span><?php echo "100 line snippet from the article";?></span> 
        </a> 
      </li><li>
         ...
      </li><li>
         ...
      </li>
    </ul>
    <!-- google_ad_section_end -->
    </body>
    </html>

    Off Topic:

    Apparently Google in their infinite wisdom offer this facility but reserve the right to implementation.



    Quite some time ago I had the brilliant idea of having snippet menu links but did not appreciate the subsequent consequences I am open to offers as to alternative solutions.
    Last edited by John_Betong; Mar 13, 2014 at 23:15. Reason: spelling: not my fortay
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  4. #4
    SitePoint Mentor silver trophybronze trophy
    Mikl's Avatar
    Join Date
    Dec 2011
    Location
    Edinburgh, Scotland
    Posts
    1,606
    Mentioned
    66 Post(s)
    Tagged
    0 Thread(s)
    John,

    My understanding of google_ad_section_start is that it tells the AdSense bot what to ignore and what to give priority to. It's got nothing to do with search results, and it will have no effect if the page does not contain AdSense.

    At least, that's my understanding. If it is proving useful for your custom search box, that's fine, but it's not what I would expect.

    MIke

  5. #5
    SitePoint Zealot
    Join Date
    Mar 2009
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure that
    Code:
    <!-- google_ad_section_start(weight=ignore) -->
    ...
    <!-- google_ad_section_end -->
    work as you describe? I never found this info before.

    So far as I know, for tell google to ignore entire page, use "nofollow/noindex" keyword.
    And to tell google to ignore part of a webpage, use
    Code:
    <!--googleoff: index-->
    
    <p>Google will not index this part of html.</p>
    
    <!--googleon: index>

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by azraf View Post
    Are you sure that
    Code:
    <!-- google_ad_section_start(weight=ignore) -->
    ...
    <!-- google_ad_section_end -->
    work as you describe? I never found this info before.</p>

    <!--googleon: index>[/CODE]
    They are instructions were for Google AdSense - not for the Google search engine. They affected how AdSense used to determine what the page is about with regard to selecting the most appropriate ads to display. It has been obsolete for some time - https://support.google.com/adsense/answer/23168?hl=en


    The googleon: and google:off commands for the search engine are covered on https://developers.google.com/search...rawl/Preparing
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    SitePoint Mentor silver trophybronze trophy
    Mikl's Avatar
    Join Date
    Dec 2011
    Location
    Edinburgh, Scotland
    Posts
    1,606
    Mentioned
    66 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by azraf View Post
    ... for tell google to ignore entire page, use "nofollow/noindex" keyword.
    No, nofollow does not tell Google to ignore a page. It tells it not to follow a link to the page, which is an entirely different matter.

    Mike

  8. #8
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,888
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    Without reading all the blurb about googleoff and googleon, I tried it locally and discovered that the links on the page became invisible.

    A quick search revealed these interesting solutions:

    https://productforums.google.com/for...ng/qrBI_v-N4N0
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •