1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Notice in threads, but not for google?

Discussion in 'XenForo Questions and Support' started by Laurentius, May 19, 2012.

  1. Laurentius

    Laurentius Active Member

    Before when I showed notices in threads google indexed that for every single thread as the description. Is there a way to show the notice for visitors, but not for the search engines or how should I do this? Also if I would like the login / sign up button to show in the threads and in thread view, how can I accomplish that?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Search engines don't like it when you show different content for them. You can get penalized for that.

    This template condition should work:

    Code:
    <xen:if is="!{$visitor.is_robot}">
    
    </xen:if>
    
    This wouldn't be done through the notice system. But you can edit the templates to add a message to the page using this template conditional:

    Admin CP -> Appearance -> Templates -> PAGE_CONTAINER

    Add the red code:

    Code:
    			<xen:if is="{$sidebar}">
    				<div class="mainContainer">
    					<div class="mainContent"></xen:if>
    						
    						<xen:include template="ad_above_top_breadcrumb" />
    
    						<xen:if is="!{$visitor.is_robot}">
    							<p class="importantMessage">
    								MESSAGE FOR EVERYONE EXCEPT ROBOTS
    							</p>
    						</xen:if>
    
    						<xen:hook name="page_container_breadcrumb_top">
    						<div class="breadBoxTop">
    							<xen:if is="{$topctrl}"><div class="topCtrl">{xen:raw $topctrl}</div></xen:if>
    							<xen:include template="breadcrumb"><xen:set var="$microdata">1</xen:set></xen:include>
    						</div>
    						</xen:hook>
    
     
  3. Laurentius

    Laurentius Active Member

    Ok, I was referring to the default notice system which is built-in in xenforo. Can I show them for unregistered in threads without risking that google will index them as descriptions?
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Google will still see those notices. The template condition that hides content from search engines only works in the templates, not in the notices.
     
  5. Laurentius

    Laurentius Active Member

    Ok, so I shouldn't show any notices at all in the threads? Except if I do it your way and edit the PAGE_CONTAINER?
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    There is nothing wrong with notices in threads. But you want to conditionally remove them so I am helping you with that.
     
  7. Laurentius

    Laurentius Active Member

    I would like a notice I made to show for all unregistered people, without risking google to use it as the description for all my threads, if google even does that? If you don't think it's necessary to remove them at all, please say so! :)
     
  8. Chris D

    Chris D XenForo Developer Staff Member

    I personally don't think it's necessary.

    Google will use the thread's meta description tags for the description.

    Look at these search results:

    https://www.google.co.uk/#sclient=p....,cf.osb&fp=65314b8ea9a82d90&biw=1366&bih=643

    The second result:

    result.PNG
    If you go to that thread you will notice that it picks up part of the content of the first post in the thread.

    Now, if you View Source in your browser in that thread you will see this:

    HTML:
    <meta name="description" content="Welcome to a new series of Have You Seen videos, demonstrating some of the new features and improvements to come in XenForo 1.1.
     
    First on the list:..." />
    Google will always use this description tag which XenForo sets automatically based on thread content. It shouldn't be possible to pick it up from a notice.
     
    Laurentius likes this.
  9. TheBigK

    TheBigK Well-Known Member

    Notices do not interfere with search engines. The meta description is picked from the first <p> .. </p>. I've been using notices in threads and it doesn't seem to affect anything.
     
    Laurentius likes this.
  10. simbolo

    simbolo Well-Known Member

    I'd second that, shouldn't have any effect.
     

Share This Page