Preferred Source Google Button
Preferred Source (Google) lets you add Google's official "Add as a preferred source" badge or link to your site, so visitors can mark it to appear more often in Google Search and Discover.
Features
This module provides two ways to display Google's preferred source badge or link. A block, which can be placed in any theme region, any number of times, each with its own style. And a field formatter for a boolean field, so editors can turn the badge on or off per content item, for example per article.
Two display styles are available for both placements. The official Google badge image, which automatically switches between a light and dark version depending on the visitor's system settings. Or a plain text link, for themes that prefer not to use the badge graphic.
The destination URL is always generated from the site's own domain, so there is nothing to configure or get wrong there by design.
Post-Installation
After enabling the module, there is no separate settings page, since the module has nothing global to configure.
To use the block, go to Structure, Block layout, and place the "Preferred Source (Google)" block in any region. In the block's own configuration, choose the display style.
To use the field formatter, add a boolean field to a content type under Structure, Content types, Manage fields. Then set that field's format to "Preferred Source (Google)" under Manage display, and choose the display style there.
Additional Requirements
None. This module only requires Drupal core, and works with Drupal 10.3 and later, as well as Drupal 11. All required assets, including Google's badge images, are bundled with the module.
Supporting this Module
No funding links at this time.
Community Documentation
For background on the feature itself, see Google's own Preferred Sources developer docs and the Google blog post announcing it.