remove Blog /tag URLs from Search Engine indexation

SOLVE
Highlighted
Advisor

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








check Did my post help answer your query? Help the Community by marking it as a solution
Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Top Contributor | Diamond Partner

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 

Alyssa Wilie

Web Developer at LyntonWeb

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

2 Replies 2
Top Contributor | Diamond Partner

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 

Alyssa Wilie

Web Developer at LyntonWeb

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

Advisor

hi @amwilie

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








check Did my post help answer your query? Help the Community by marking it as a solution
Reply
0 Upvotes