Google has a generic "google" meta tag for controlling some aspects of their search indexing:

  • Do not enable the sitelinks search box: <meta name="google" content="nositelinkssearchbox" />
  • Do not attempt an automatic translation of the content into other languages: <meta name="google" content="notranslate" />
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alzz’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
FileSize
2.76 KB

A first attempt to implement Google nositelinkssearchbox metatag for Drupal 8.
Looks like this metatag it is not generic for all search engines so must be under google name.
The nostranslate metatag it is already implemented in the module.

alzz’s picture

FileSize
2.4 KB

Attaching the correct the patch, the previous one is a mess.

DamienMcKenna’s picture

Status: Active » Needs review

Thank you!

Lets see what the testbot says.

tunic’s picture

Testbot says everything is ok, should this issue be in RTBC?

DamienMcKenna’s picture

Status: Needs review » Needs work

This patch is hardcoded for the first scenario, it doesn't allow for the second scenario.

alzz’s picture

Sorry but I dont understand what do you mean with the first and second scenarios.

thejimbirch’s picture

Status: Needs work » Needs review
FileSize
1.78 KB

Attached is an updated patch. The patch in #2 had one field for nositelinkssearchbox using a checkbox, and had the field incorrectly in the Google Custom Search Engine (CSE) module.

The attached patch moves the field into the main metatag module, and puts it in the advanced group. It also changes it to a text input so users can add nositelinkssearchbox, notranslate, or both. I also updated the field's description to include more details, and a link to the Meta tags that Google understands Search Console help article.

thejimbirch’s picture

Google Webmaster Trends Analyst John Mu confirmed that these tags can be combined in this week's Google Webmaster Hangout.

https://www.youtube.com/watch?v=asmUDAzWKdI&t=2350

DamienMcKenna’s picture

A small improvement to the wording, and to note the comment from the video that they can be combined if comma-separated.

  • DamienMcKenna committed 8b6f280 on 8.x-1.x authored by alzz
    Issue #2532596 by alzz, DamienMcKenna, thejimbirch: Add new meta tag:...
DamienMcKenna’s picture

Status: Needs review » Fixed

Committed. Thanks.

DamienMcKenna’s picture

Title: Add new meta tag: google » Add new meta tag: google (D8)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sriharsha.uppuluri’s picture

Hi,

I'm not able to see the google field under advanced section on a drupal vanila instance. I can see the code in codebase but not displaying.