# No content on homepage for Googlebot

**URL:** <https://meta.discourse.org/t/no-content-on-homepage-for-googlebot/41146>\
**Category:** Bug\
**Created:** [2016年三月16日 16:30 UTC](https://meta.discourse.org/t/no-content-on-homepage-for-googlebot/41146 "2016-03-16T16:30:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)\
**Post date:** [2016年三月16日 16:30 UTC](https://meta.discourse.org/t/no-content-on-homepage-for-googlebot/41146/1 "2016-03-16T16:30:14Z")

</div>

Currently there doesn’t appear to be any content output in the `#main-outlet` element for Googlebot:

 ![](https://global.discourse-cdn.com/meta/original/3X/8/9/8912a3355b5c6f5eddbb7036e18732417dd6c823.png)

HTML for reference:

```html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Discourse Meta</title>
    <meta name="description" content="Discussion about the next-generation open source Discourse forum software">
    <meta name="author" content="">
<meta name="generator" content="Discourse 1.5.0.beta12 - https://github.com/discourse/discourse version e84d5549efe6c24a6230cfbe2ce8c1b511ffc9d6">
<link rel="icon" type="image/png" href="https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/c/b/cb4bec8901221d4a646e45e1fa03db3a65e17f59.png">
<link rel="apple-touch-icon" type="image/png" href="https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/c/b/cb4bec8901221d4a646e45e1fa03db3a65e17f59.png">
<link rel="icon" sizes="144x144" href="https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/c/b/cb4bec8901221d4a646e45e1fa03db3a65e17f59.png">
<meta name="theme-color" content="#ffffff">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes">

      
    
        <link rel="alternate" type="application/rss+xml" title="Latest posts" href="https://meta.discourse.org/posts.rss" />
    <link rel="alternate" type="application/rss+xml" title="Latest topics" href="https://meta.discourse.org/latest.rss" />

    <style>
        img { max-width: 100%; width: auto; height: auto; }
    </style>
  </head>
  <body>
      
    <header>
      <a href="/"><img src="https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/9/d/9d543e92b15b06924249654667a81441a55867eb.png" alt="Discourse Meta" id="site-logo" style="max-width: 400px;"></a>
    </header>
    <div id="main-outlet" class="wrap">
      

    </div>
    <footer class="container">
      <nav itemscope itemtype='http://schema.org/SiteNavigationElement'>
        <a href='/'>Home</a>
        <a href="/categories">Categories</a>
        <a href="/guidelines">FAQ/Guidelines</a>
        <a href="/tos">Terms of Service</a>
        <a href="/privacy">Privacy Policy</a>
      </nav>
      <p>Powered by <a href="http://www.discourse.org">Discourse</a>, best viewed with JavaScript enabled</p>
    </footer>
    <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-33736483-2']);

  _gaq.push(['_setCustomVar', 1, 'Anonymous', true, 2]);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

       <script>
 Discourse.ExternalNavItem = Discourse.NavItem.extend({
    href : function() {
      return this.get('href');
    }.property('href')
  });

  I18n.translations[I18n.locale].js.filters.bugs = { title: "Bugs", help: "Open Bugs" };
  I18n.translations[I18n.locale].js.filters.features = { title: "Features", help: "Open Feature Requests" };
     
  Discourse.NavItem.reopenClass({
    buildList : function(category, args) {
      var list = this._super(category, args);
      if(!category) {
        list.push(Discourse.ExternalNavItem.create({href: '/category/bug?order=op_likes&status=open', name: 'bugs'}));
        list.push(Discourse.ExternalNavItem.create({href: '/category/feature?order=op_likes&status=open', name: 'features'}));
      }
      return list;
    }
  });
  </script>
  </body>
</html>

```

I would expect the latest list of topics for meta.

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [2016年三月16日 17:56 UTC](https://meta.discourse.org/t/no-content-on-homepage-for-googlebot/41146/2 "2016-03-16T17:56:24Z")

</div>

How did you set the user agent of Googlebot? My Chrome doesn’t have that choice and I wonder if it’s related.

---

<div class="post-metadata">

**Author:** ![Alankrit\_Choudh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alankrit_choudh/32/119698_2.png) [@Alankrit\_Choudh](https://meta.discourse.org/u/Alankrit_Choudh)\
**Post date:** [2016年三月16日 17:59 UTC](https://meta.discourse.org/t/no-content-on-homepage-for-googlebot/41146/3 "2016-03-16T17:59:42Z")

</div>

Chrome 扩展——

> **[User-Agent Switcher for Chrome - Chrome Web Store](https://chromewebstore.google.com/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg)**
>
> Spoofs & Mimics User-Agent strings.

我目前正在使用它，结果尚可。

 ![YoPtLeF](https://global.discourse-cdn.com/meta/original/4X/0/6/f/06fed43902e0c1c46e6e441a0ec42d5b013e614d.png)

---

<div class="post-metadata">

**Author:** ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)\
**Post date:** [2016年三月16日 18:09 UTC](https://meta.discourse.org/t/no-content-on-homepage-for-googlebot/41146/4 "2016-03-16T18:09:56Z")

</div>

As per this post:

> [@Updating the smartphone user-agent of Googlebot](https://meta.discourse.org/t/updating-the-smartphone-user-agent-of-googlebot/41112):
>
> Next month Google will be updating the smartphone user-agent of Googlebot: [https://webmasters.googleblog.com/2016/03/updating-smartphone-user-agent-of.html](https://webmasters.googleblog.com/2016/03/updating-smartphone-user-agent-of.html) Reviewing the code-base it doesn’t look like it’s going to make a blindest bit of difference to Discourse. Someone might possibily want to add the new user-agent here: [https://github.com/discourse/discourse/blob/master/spec/components/crawler\_detection\_spec.rb](https://github.com/discourse/discourse/blob/master/spec/components/crawler_detection_spec.rb) Current Googlebot smartphone user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8…

I added a “custom device” to Google Chrome dev tools using the newly proposed Googlebot smartphone user agent for mobile:

```plaintext
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

```

 ![](https://global.discourse-cdn.com/meta/original/3X/b/1/b11d002b5bfae00676cc294879a4931d7aed9cea.png)

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [2016年三月16日 18:13 UTC](https://meta.discourse.org/t/no-content-on-homepage-for-googlebot/41146/5 "2016-03-16T18:13:33Z")

</div>

Huh interesting, I can reproduce it while in incognito. Looking into it.

---

<div class="post-metadata">

**Author:** ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)\
**Post date:** [2016年三月16日 18:16 UTC](https://meta.discourse.org/t/no-content-on-homepage-for-googlebot/41146/6 "2016-03-16T18:16:01Z")

</div>

I found this because I was running this new Mobile Friendly Google Tool against my Discourse instance:

> **[Introduction to Lighthouse  |  Chrome for Developers](https://developer.chrome.com/docs/lighthouse/overview/)**
>
> Learn how to set up Lighthouse to audit your web apps.

I was expecting the output to be clunky - but expected topic results.

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [2016年三月16日 18:37 UTC](https://meta.discourse.org/t/no-content-on-homepage-for-googlebot/41146/7 "2016-03-16T18:37:12Z")

</div>

Looks like it’s a combination of mobile + Googlebot. We had an optimization to never render the `<noscript>` content in mobile mode. I’ve changed it so that we only skip rendering that if we aren’t in our crawler layout. Seems to work!

[https://github.com/discourse/discourse/commit/233aa2ab2f2942f2e1c33338ea4f0868f32b6f53](https://github.com/discourse/discourse/commit/233aa2ab2f2942f2e1c33338ea4f0868f32b6f53)

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [2016年三月16日 18:37 UTC](https://meta.discourse.org/t/no-content-on-homepage-for-googlebot/41146/8 "2016-03-16T18:37:15Z")

</div>


