Like that tutorial says, putting that code on step 4 into the on your index file will block and indexing bots to all pages except for the ones in the robots.txt file.
Another solution would be to password protect your store. Doing this will only allow search engines to index the login page. You can find more instructions on that here.
I have placed the code as you have said in the theme.liquid file, along with the layouthub.liquid file. The layouthub one is for a page creation app that I have installed. The homepage is not using a custom made page with this app.
I’m still having no success with this - every site that has a free tool to confirm that googlebot is allowed to index says that it is being permitted…
You can try to enable password protection, Shopify will add all URLs in private mode, Google cannot crawl your website:
From your Shopify admin, you go to Online Store > Preferences.
Scroll to the Password protection area, and check Enable password.
In Password, enter the password that you’ll give to the customers who you want to be able to access your online store. Don’t use the same password that you use to log into your admin.
In Message for your visitors, enter the message that you want to show on the password page. If you don’t want to show a message, then leave this field blank.