CMS Development

Anton
Experto reconocido | Partner nivel Diamond
Experto reconocido | Partner nivel Diamond

remove Blog /tag URLs from Search Engine indexation

resolver

Hey guys,

as the title says -a client wants to remove all /tag URLs from a specific blog from indexing. Is there a "simple" way to achieve this? I know that you can "globaly" add

<meta name="robots" content="noindex,nofollow">

in Settings->Website->Blog->templates to the blog posting and blog listing templates but as he wants to remove only the /tag URLs neither of those two would work. Adding this to the "blog posting" header wouldn't help and adding the code to the listing view would also affect the default listing view - what's not the goal here.

 

I've told him about the solution with a custom robots.txt, but he's now happy about that. Excluding the /tag/* URLs in the Google Search Console is also not an option as it'll only affect the google results(who knows which other Search Engine the user uses).

 

Does anyone have a solution or idea how to achieve this?

 

Note: The client also told me that he want's a userfriendly and "easly scaleable" solution. 

 

thanks in advance

 

best, 

Anton

Anton Bujanowski Signature
0 Me gusta
1 Soluciones aceptada
alyssamwilie
Solución
Experto reconocido | Partner nivel Elite
Experto reconocido | Partner nivel Elite

remove Blog /tag URLs from Search Engine indexation

resolver

In the blog listing markup you can target just the topic/tag pages by using the following if statement:

 

{% if topic %}
    <meta name="robots" content="noindex,nofollow">
{% endif %}



Alyssa Wilie
Web Developer
LyntonWeb 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

Ver la solución en mensaje original publicado

7 Respuestas 7
PBifaro
Miembro

remove Blog /tag URLs from Search Engine indexation

resolver

I tried adding this to the blog listing template header section and it just shows at the top of the page.

Where is this supposed to go?

 

PBifaro_0-1693331583045.png

 

0 Me gusta
Anton
Experto reconocido | Partner nivel Diamond
Experto reconocido | Partner nivel Diamond

remove Blog /tag URLs from Search Engine indexation

resolver

Hi @PBifaro,

unless you want to go a custom module way you can drop 

 

<meta name="robots" content="noindex,nofollow">

 

in the Header-HTML part in the blog settings here:

settings(gear icon top right) -> Website -> Blog -> Templates -> Blog listing pages header HTML and/or Blog post header HTML

 

 

best, 

Anton

Anton Bujanowski Signature
0 Me gusta
alyssamwilie
Solución
Experto reconocido | Partner nivel Elite
Experto reconocido | Partner nivel Elite

remove Blog /tag URLs from Search Engine indexation

resolver

In the blog listing markup you can target just the topic/tag pages by using the following if statement:

 

{% if topic %}
    <meta name="robots" content="noindex,nofollow">
{% endif %}



Alyssa Wilie
Web Developer
LyntonWeb 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
Anton
Experto reconocido | Partner nivel Diamond
Experto reconocido | Partner nivel Diamond

remove Blog /tag URLs from Search Engine indexation

resolver

hi @alyssamwilie

thanks for the quick and easy solution. It works fine. 

Did a small addition so the meta-tag will be added to the head.

 

My code:

{% if topic %}
<script>
$('head').append( '<meta name="robots" content="noindex,nofollow">' );
</script>
{% endif %}

 

Thanks again!

 

best, 

Anton

Anton Bujanowski Signature
0 Me gusta
PBifaro
Miembro

remove Blog /tag URLs from Search Engine indexation

resolver

So this goes into setting > Advanced Settings > Head HTML

 

copy and paste as is or do I need to wrap this in <>

0 Me gusta
RNWilkinson
Participante

remove Blog /tag URLs from Search Engine indexation

resolver

Hi Anton,

I am trying to do the same, but I'm having some trouble. Does this code need to go into our blog listing template or the original HubSpot version?

Thanks,

Neal

Edit

This code worked like a charm - our template used a base html file for headers and footers, so I just needed to apply this code in there, rather than the blog template specifically. Works great. Thanks to Alyssa and Anton.

0 Me gusta
PBifaro
Miembro

remove Blog /tag URLs from Search Engine indexation

resolver

this did n't work for the template

 

0 Me gusta