Forum Discussion

RobertT's avatar
8 years ago

Excluding certain threads from SEO

Hi All, 

 

I'm looking at builing a solution to a particular issue in our community that may be applicable to other communites. This arose during a discussion around archiving content and the different types of archival. In some cases we want to exclude content from Search Engines while it isn't relevant to allow newer more relevant content to surface but not move that content or archive it in any visible way within the community.

 

Ideally this would involve putting a flag on a topic/thread (root message) which we'd use for checking logic within a custom component. For this example lets say there's a custom field to exclude from seo called exclude_from_seo which is boolean and we set it to true or false using a checkbox on the post/edit page.

 

The custom component would be created with the following logic:

 

  1. Get the ID of the root message for this topic from freemarker context, use that to perform a REST call to read metadata/key/exclude_from_seo and store this against a variable we'll call ExcludeFromSEO
  2. Logic check using Freemarker IF the value of ExcludeFromSEO = TRUE then we'll insert the required META tags for robots to not index etc ELSE we insert the normal META tags.

The custom component would then be inserted into the header for the ForumTopicPage quilt.

 

I'm wondering if anyone else has developed a solution similar to this or if there's a simpler way to achieve the same result?

 

 

  • We have. We made use of the moderation manager custom tags to trigger it - that's all I know. It works though!