• 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?

Laurentius

Active member
#1
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?
 

Jake Bunce

XenForo moderator
Staff member
#2
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>
 

Laurentius

Active member
#3
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?
 

Jake Bunce

XenForo moderator
Staff member
#4
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?
Google will still see those notices. The template condition that hides content from search engines only works in the templates, not in the notices.
 

Laurentius

Active member
#7
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! :)
 

Chris D

XenForo developer
Staff member
#8
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.
 

TheBigK

Well-known member
#9
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.