Keyword

Stop Google from indexing 'tag' pages when tags are used ?

  • Marc Solaris
  • Marc Solaris's Avatar Topic Author
  • Offline
  • New Member
More
8 years 7 months ago - 8 years 7 months ago #146265 by Marc Solaris
Hello,

I am using the tag functions in k2 and when I check what Google indexes from my website I see that it also indexes pages such as : This example URL

in item.php (line 298) of my (gavick.com Writer) template I tried doing the following to stop Google from indexing tag pages as follows:

<li> <a rel="nofollow" href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a> </li>

I added rel="nofollow" but it seems this isn't working.

Am I missing something ?
I basically don't want any links indexed by google which has the word "/tag/" in it, I just want my normal links to my pages, and no tag pages indexed.
Last edit: 8 years 7 months ago by Marc Solaris.
The topic has been locked.
More
8 years 7 months ago #146279 by Lefteris
Hi,

Adding rel no follow will not remove the already indexed pages from Google. It will only tell Google to not index again those pages in the future. You also need to ensure that the rel no follow is added everywhere in your site where tag links are displayed ( in modules for example ) .

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
The topic has been locked.
  • Marc Solaris
  • Marc Solaris's Avatar Topic Author
  • Offline
  • New Member
More
8 years 7 months ago #146288 by Marc Solaris
Hi again,

Google has not indexed my website yet. So there is nothing to remove yet.
I checked my website with XML Sitemap Generator and saw that tag pages will be created if I submit my website to Google.

I already have a rel="nofollow" on tag links below all detail pages.

So what else can be done to prevent indexing ?
Maybe something in robots.txt ? or another code ?
The topic has been locked.
More
8 years 7 months ago #146291 by Lefteris
According to this support.google.com/webmasters/answer/96569?hl=en Google will not index the tag pages if you have the rel nofollow attribute to their links.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
The topic has been locked.
  • Marc Solaris
  • Marc Solaris's Avatar Topic Author
  • Offline
  • New Member
More
8 years 7 months ago #146338 by Marc Solaris
Heya

Yes, I am aware of what Google says, but the reason why I'm posting here is because I used rel="nofollow" on other parts of the website and the online service I mentioned earlier (XML Sitemap Generator) removed these links, or lets say didn't index them, for the sitemap, wheres these k2 tag links are not being removed from the resulting sitemap (thus my worry that if the sitemap generator creates the links, goggle most probably will also index these links, even if I remove them from the sitemap).
The topic has been locked.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 7 months ago #146447 by Krikor Boghossian
Replied by Krikor Boghossian on topic Stop Google from indexing 'tag' pages when tags are used ?
If the extension creates tags links in the sitemap then these links will be indexed. You need to 'tweak' the extension so it won't index these links.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
The topic has been locked.
More
8 years 4 months ago #149321 by Jennie Dawson
I have found out how to do this.

Edit the template file in:

components --> com_k2 --> templates --> default --> tag.php

Add the following code to the top just above the start of the K2 Tag layout
<?php
$doc = JFactory::getDocument();
$doc->addCustomTag('<meta name="robots" content="noindex" />');
?>

Save the file in your template overrides folder, ie:

templates --> yourtemplate --> html --> com_k2 --> default --> tag.php

This has worked for me
The topic has been locked.
More
8 years 4 months ago #149346 by Lefteris
@Jennie Dawson

Thanks for sharing this.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
The topic has been locked.
  • Marc Solaris
  • Marc Solaris's Avatar Topic Author
  • Offline
  • New Member
More
8 years 16 hours ago #152172 by Marc Solaris
Great worked for me too !!
The topic has been locked.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 15 hours ago #152182 by Krikor Boghossian
Replied by Krikor Boghossian on topic Stop Google from indexing 'tag' pages when tags are used ?
Just make sure to use overrides so you won't lose your edits when K2 is updated.

getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
The topic has been locked.

Powered by Kunena Forum