# SOLVED Unable to set robots.txt content

**URL:** <https://discourse.gohugo.io/t/solved-unable-to-set-robots-txt-content/2795>\
**Category:** support\
**Created:** [February 28, 2016, 1:29pm UTC](https://discourse.gohugo.io/t/solved-unable-to-set-robots-txt-content/2795 "2016-02-28T13:29:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hughgrigg](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hughgrigg/32/11853_2.png) [@hughgrigg](https://discourse.gohugo.io/u/hughgrigg)\
**Post date:** [February 28, 2016, 1:29pm UTC](https://discourse.gohugo.io/t/solved-unable-to-set-robots-txt-content/2795/1 "2016-02-28T13:29:54Z")

</div>

I’m trying to set the content of the robots.txt file in my Hugo site, but am unable to change it from just “User-agent: \*” (I just want to add two lines after that).

I’ve got the content I want in static/robots.txt, but this seems to not be used or perhaps overwritten.

The site source is at [https://github.com/hughgrigg/chineseboost-articles](https://github.com/hughgrigg/chineseboost-articles)

I’ve used grep and find to try and find where this other content might be coming from. I’m guessing it’s Hugo default.

What should I do to get custom content in robots.txt?

---

<div class="post-metadata">

**Author:** ![hughgrigg](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hughgrigg/32/11853_2.png) [@hughgrigg](https://discourse.gohugo.io/u/hughgrigg)\
**Post date:** [February 28, 2016, 1:45pm UTC](https://discourse.gohugo.io/t/solved-unable-to-set-robots-txt-content/2795/2 "2016-02-28T13:45:17Z")

</div>

Figured it out: the robots.txt file should be at ‘layouts/\_default/robots.txt’

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [February 29, 2016, 1:59pm UTC](https://discourse.gohugo.io/t/solved-unable-to-set-robots-txt-content/2795/3 "2016-02-29T13:59:42Z")

</div>

@hughgrigg did you try just putting your robots.txt in the static folder? The rule for the static folder is that everything therein is copied over as is.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [February 29, 2016, 2:57pm UTC](https://discourse.gohugo.io/t/solved-unable-to-set-robots-txt-content/2795/4 "2016-02-29T14:57:51Z")

</div>

> [@rdwatters](#):
>
> The rule for the static folder is that everything therein is copied over as is.

Yes, but it is (sometimes) useful to build it from a template (iterate over all the pages etc.)
