1

I would like to "noindex" all tag pages on a Squarespace site. Unfortunately, since Squarespace doesn't allow access to the .htaccess file or even the robots.txt file and since tag pages are dynamic, I haven't found a way to prevent Google from indexing them. My attempts to remove them via Search Console have also been unsuccessful.

So does anyone know of a way to block and noindex Squarespace tag pages?

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
daviddeering
  • 819
  • 1
  • 7
  • 9

2 Answers2

2

Squarespace has added the ability to no-index both tag and category pages, so you don't need to do all that. Just go to the SEO tab for your blog page and look for "hide from search engines." For more on using tags (and categories) I wrote an article that might be useful, How To Use Tags And Categories For Squarespace SEO

1

Yes, this is possible. There are various options. See Squarespace's support pages here and here for more.

Options for Adding the 'Noindex' meta to a Squarespace Site

Best Option

1. Enable the tag in Collection Settings

Use the "SEO" tab to enable the noindex tag for tag pages:

  1. In the Home Menu, click Pages.
  2. Hover over the page and click the gear-icon.
  3. Click the SEO tab.
  4. Under Hide from Search Engines, check "All tag pages in this collection".

enter image description here



Older Options that May Still Work

2. Use Developer Mode

This will add the meta element without using javascript.

  1. Enable developer mode (noting the consequences) on the site.
  2. Edit the <head> element of the site, adding some JSON-T like: {.if tagFilter}<meta name="robots" content="noindex">{.end}. The <head> element is most likely located in the site.region file, or possibly a .block file within /blocks. If you only want to add the element on certain collections, you could encapsulate the previous JSON-T with something like {.equal? collection.urlId "mycollection"}...{.end}.

3. Use Javascript

This will add the meta element using javascript which, although it is debated whether it is effective in a case like this or not, there are indications that it is.

  1. Via header code injection, insert the following: <script>/\/tag\/|tag=/.test(window.location.href) && document.head.appendChild(Object.assign(document.createElement("meta"),{name:"robots",content:"noindex"}));</script>

    Note that the code above will add the meta element via javascript on any page that contains /tag/ or tag=. You'd want to be sure you didn't have legitimate URLs on your site that utilized either of those two patterns and that you wanted indexed. Otherwise, you'd want to edit the logic of the code to test for a more specific pattern.

4. Use Google Tag Manager

This also may rely on javascript, but for non-coders this may be more approachable.

  1. Create a GTM account if necessary.
  2. Add the GTM code to your site. Place the <script> code snippet at the top of sitewide header injection. Place the <noscript> code snippet at the top of sitewide footer injection.
  3. Add a new tag. Go to "Tags" and click "New". Create a new tag configuration that adds the robots noindex meta element to the page. Finally, add a trigger to the configuration that will fire only on URLs containing /tag/. An excellent tutorial has been created by those at radrank.com: https://radrank.com/squarespace-seo-problem/

Note that Squarespace recently made a change to the blog collection URL structure and that there is currently an inconsistency in Squarespace sites' robots.txt file related to the ?tag=mytag and the /tag/mytag URL structure. The former structure for tags actually is marked as disallow in Squarespace sites' robots.txt file. The latter URL structure is not. However, canonical tags and XML sitemaps should be using the latter URL structure. The second option above was written in case Squarespace changes their approach to the previous URL structure in the robots.txt file.

Options 2-4 likely require higher-than-personal paid plan. It is possible that options 3 & 4 above could be done using markdown blocks added to site header/footer, though to my knowledge this has not been tested.

Community
  • 1
  • 1
Brandon
  • 3,572
  • 2
  • 12
  • 27
  • Wow, that's awesome Brandon--thank you! I couldn't find a single solution to this problem and you've given me 3--thank you! – daviddeering Apr 18 '19 at 13:54