How to Block CuteStat in a Hugo Website

Hongtao Hao / 2020-06-20

CuteStat can be really annoying. When I first built my website, and searched my name in Google, appeared on top of the resarch restults and it was so ugly!

How can we block CuteStat from crawliing our websites?

A direct way to do this is to go to the bottom of CuteStat , and open Update or Remove .

CuteStat asked us to add a robots.txt file in our website with the following codes:

User-agent: CuteStat
Disallow: /

The problem is how and where to put this file in Hugo?

Settting config.toml And Creating robots.txt #

Hugo has an answer :

In your configuration file , add this1:

enableRobotsTXT = true

Then, open you text editor like Sublime Text and create a file named robots.txt with these codes:

User-agent: CuteStat
Disallow: /

When it’s done, put it as /layouts/robots.txt or /themes/<THEME>/layouts/robots.txt, as Hugo’s official guideline suggests.

Removing Data on CuteStat #

Then, go back to CuteStat’s Update or Remove , input your domain name and chose “Remove Information”. CuteStats now won’t be able to crawl your website anymore.

Hope it works for you.

  1. I assumed that your config file is a toml file. ↩︎

Last modified on 2021-10-05