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

XF 1.4 Google's Sitelinks Search - Xenforo vs EMTLife

Chimpie

Well-known member
#1
I've read a couple of threads here about Google's Sitelinks Search Box and I haven't found the answer to my question.

I'm using Chrome and entered the query: emtlife - We get this:
emtlifesearch1.png

Entering a search term (let's use: avatars) brings up an emtlife - xenforo search of "avatars".

Doing a Google search query of: xenforo - We get this:

xenforo1.png
Entering a search term (again: avatars) brings up a Google search for "avatars", not a site/xenforo search.

Why the difference?
 

Mike

XenForo developer
Staff member
#2
There is code in place to do a site search but it only works if you've installed XF in the root. That said, it's also Google's choice what it thinks is most appropriate for each specific case.
 

tommydamic68

Well-known member
#3
There is code in place to do a site search but it only works if you've installed XF in the root. That said, it's also Google's choice what it thinks is most appropriate for each specific case.
SO if XF is not installed in the root Google sitelink search bar will not show? I have been pulling my hair out trying to find why my site will not get the search bar as many XF sites I have looked out in Googles search results do not have. One odd thing I did find is this: I f I go to the URL which is in the script for the Google sitelink search it returns empty results...If this is true with the root, any work around?

Code:
http://smysite.com/community/search/search?keywords={search_keywords}
 
Last edited:

Mike

XenForo developer
Staff member
#4
Whether or not it shows is really down to Google. As far as I've seen, it only shows if the search markup (the application/ld+json bit) is in the root. You could add that to whatever file is at your domain root if you wish.

One odd thin I did find is this: I f I go to the URL which is in the script for the Google sitelink search it returns empty results...If this is true with the root, any work around?
The search has a placeholder in it that gets replaced.
 

tommydamic68

Well-known member
#5
Whether or not it shows is really down to Google. As far as I've seen, it only shows if the search markup (the application/ld+json bit) is in the root. You could add that to whatever file is at your domain root if you wish.


The search has a placeholder in it that gets replaced.
It seems the issue is the {search_keywords} doesn't show a valid "search results" page on many Xenforo based sites including mine or any that that I have checked. A link to a valid search page is what is required according to Google. Not sure why Xenforo's leads to a valid search page while others do not. Just stumped.
 

tommydamic68

Well-known member
#7

markku

Well-known member
#8
That's because xenforo.com has posts containing the search query {search_keywords}

The other forums not.

the {search_keywords} will actually be replaced automatically, so try this:
https://theadminzone.com/search/search?keywords=xenforo

and it will work.

The problem is not with {search_keywords}.

It's just like Mike explained:
The search has a placeholder in it that gets replaced.
https://developers.google.com/structured-data/slsb-overview
 

tommydamic68

Well-known member
#9