Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
943 views
in Q2A Core by
Hi all,

I'm using a related questions widget and all the related questions also appear in search engine results. This might be causing problem of duplicate content but more importantly it creates a lot of search results which is not good. Can someone please suggest a good way to prevent this? - Recent Question Widget content should not be crawled by search engine bots.
Q2A version: 1.7.0
by
Can't the user just go to page 2 of the search results?
I'm not sure what you can expect really - the related questions are always going to be similar to the search results for the same keywords.
by
Sorry. Guess my question was confusing. I meant google search and not the search inside Q2A. Users are searching the web for questions (my site is having exam questions) and due to "Related questions" widget in pages, multiple search results are coming. So, I would prefer this widget not to be crawled by the google bot. Saw this page- https://perishablepress.com/tell-google-to-not-index-certain-parts-of-your-page/
Would it be a good solution?

2 Answers

+2 votes
by
selected by
 
Best answer

These are what I found from Google,

Method 1:

Put simply, the googleon/googleoff tags tell GoogleBot Google Search Appliance when to start and stop indexing various parts of the web document. Consider the following example:

<p>This is normal (X)HTML content that will be indexed by Google.</p>

<!--googleoff: index-->

<p>This (X)HTML content will NOT be indexed by Google.</p>

<!--googleon: index>

In this example, we see how the googleon/googleoff tags will prevent the second paragraph from being indexed by Google. Notice the “index” parameter, which may be set to any of the following:

  • index — content surrounded by “googleoff: index” will not be indexed by Google
  • anchor — anchor text for any links within a “googleoff: anchor” area will not be associated with the target page
  • snippet — content surrounded by “googleoff: snippet” will not be used to create snippets for search results
  • all — content surrounded by “googleoff: all” are treated with all attributes: index, anchor, and snippet
Read more > https://perishablepress.com/tell-google-to-not-index-certain-parts-of-your-page/
Method 2: Using CSS

HTML:

<span class="sig">signature goes here</span>

CSS:

.sig {
display:none;
}
Read more: http://webmasters.stackexchange.com/questions/16390/preventing-robots-from-crawling-specific-part-of-a-page
3. Content in iframes and javascript are don't indexed usually
<iframe src ="sidebar.asp" width="100%" height="300">
    </iframe>

here the rules to be added in the robots.txt file for block the spider

user-agent: *
disallow: sidebar.asp
+1 vote
by
I found this myself as it looked really important for SEO. Don't know why no one else is bothered. Just added the two lines with +++ to qa-include/plugins/qa-widget-related-qs.php.

@Scott Is this a change worth required in the core code? Because the content of the related questions widget causes the google search to list this page (where the question is related) and not the actual page of the question.

 $titlehtml = qa_lang_html(count($questions) ? 'main/related_qs_title' : 'main/no_related_qs_title');
 

+++$themeobject->output('<!--googleoff: all-->');

$themeobject->q_list_and_form($q_list);
+++$themeobject->output('<!--googleon: all-->'); //arjun
by
I've added your code to the plugin but I can't see <!--googleoff: all--> tag on website page source!
...