1. 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

Discussion in 'XenForo Questions and Support' started by Chimpie, Feb 9, 2015.

  1. Chimpie

    Chimpie Well-Known Member

    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?
     
  2. Mike

    Mike XenForo Developer Staff Member

    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.
     
    Chimpie likes this.
  3. tommydamic68

    tommydamic68 Well-Known Member

    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: Feb 15, 2015
  4. Mike

    Mike XenForo Developer Staff Member

    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.
     
  5. tommydamic68

    tommydamic68 Well-Known Member

    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.
     
  6. tommydamic68

    tommydamic68 Well-Known Member

    This code can just be added to any file in the root directory - like a text file per-say?
     
  7. tommydamic68

    tommydamic68 Well-Known Member

  8. markku

    markku Well-Known Member

    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:
    https://developers.google.com/structured-data/slsb-overview
     
  9. tommydamic68

    tommydamic68 Well-Known Member

Share This Page