digitalDot Favorites for Google

Description

Add a button or link to help readers add your website to their Google favorites. Google unified Preferred Sources in Search and following in Discover and Search profiles under Favorites on December 1, 2026. This independent plugin by digitalDot is not affiliated with, sponsored by, or endorsed by Google. Google determines eligibility, display and the final selection. The plugin does not guarantee rankings, traffic, inclusion in AI features, or favorite status.

Features

  • Automatic placement before or after content, a dismissible floating notice, or manual placement via shortcode.
  • Select public post types for automatic placement; use the shortcode for manual placement.
  • Native Google button when the optional SDK is enabled and visitor consent is granted; otherwise an accessible, locally rendered direct link.
  • Custom text, light and dark styles, alignment, language and a call to action.
  • Separate Settings and Click statistics administration screens.
  • Optional aggregate local click statistics, with a reset control. Clicks do not establish that readers completed the selection on Google.
  • Optional Google Analytics / Tag Manager click events, subject to the site’s consent integration.
  • Optional local diagnostic log, with a maximum of 50 entries and a clear control.
  • Translation-ready English source strings. Available translations are delivered by WordPress.org language packs.

External services

This plugin integrates the Favorites functionality provided by Google. No digitalDot service, account, license key, or remote code from digitalDot is required.

  • Direct link: https://www.google.com/preferences/favorites?q=example.com. Clicking sends the site’s domain to Google and opens Google’s preferences page. The browser may also send its IP address, user agent, cookies and other request information to Google. No request is initiated by the plugin before a reader follows the link when the SDK is disabled.
  • Optional Google SDK: https://news.google.com/swg/js/v1/publisher.js. It renders the official button or opens the native dialog. The plugin does not host or modify Google’s SDK. It is loaded only when a site administrator enables it and the ddgps_load_google_script filter returns true for the current visitor. Google receives standard browser request data and may process cookies or other information according to its own policies.
  • Optional analytics: the plugin passes preferred_source_click, public content ID, public content title and a URL without query parameters or fragment to the site’s existing dataLayer or gtag integration. It does not install Google Analytics or Tag Manager. This feature requires an administrator opt-in and a true result from the ddgps_allow_analytics consent filter. The configured analytics service may then receive the event and its own standard visitor data.

Service documentation and policies:

Installation

  1. Upload the plugin ZIP through Plugins > Add New > Upload Plugin, or upload the plugin folder to wp-content/plugins/.
  2. Activate the plugin.
  3. Open Google Favorites > Settings and configure placement, appearance and any optional features.
  4. Review Click statistics in the separate submenu. Enable local statistics explicitly to begin recording new clicks.
  5. If using the optional Google SDK or analytics, integrate the consent filters with your consent management platform before enabling the feature. Without this integration, the direct link works and no SDK or analytics events are loaded by the plugin.

For upgrades from 1.0.3: upload the new ZIP and replace the existing plugin files. The directory, main PHP filename, text domain, settings, statistics, consent hooks, analytics event and [ddgps_preferred_source] shortcode are unchanged. Do not uninstall the previous version. Empty button and introductory text fields use the new Favorites defaults. Saved custom text and shortcode attributes are preserved; review them for old Preferred Sources wording and update them where needed. Update WordPress.org language packs when available and clear page and optimization caches.

For upgrades from 1.0.2 or earlier: back up the database and copy any existing styling you want to keep before upgrading. The new plugin directory and main PHP filename use the official slug digitaldot-preferred-sources-for-google. Deactivate the previous plugin and replace its files using FTP/SSH or your hosting file manager, then activate the new directory. Do not keep both copies active or use the Delete action in WordPress on the old installation if you intend to retain data, because its uninstall handler deletes the settings and statistics. Existing ddgps_settings, ddgps_clicks_stats and ddgps_diagnostic_log options retain supported data. The discontinued styling field is removed on activation or the next administration request for each site. Existing manual placements using the old unprefixed shortcode must be updated to [ddgps_preferred_source] in posts, pages, widgets, templates and page builders; no legacy alias is registered. Review settings and clear page caches after upgrading.

FAQ

Which shortcodes are supported?

Use [ddgps_preferred_source]. Parameters: theme (light or dark), align (left, center, right), lang (supported language code), cta (custom introductory text), show_cta (yes or no) and button_text (custom mode). The button mode is a site-wide setting and cannot be overridden by a shortcode.

Can I customize the appearance?

Use the built-in button type, theme, alignment, text and placement settings. For additional styling, use WordPress’s own Additional CSS editor in your theme or Site Editor, if available. The plugin does not accept or store free-form styling rules. Existing theme styles targeting the plugin’s prefixed classes (such as .ddgps-custom-btn) can still be used.

How does consent work?

The external SDK and analytics are disabled by default. The direct link does not require the SDK. For the official button and custom native dialog, enable the Google SDK setting and connect your consent platform to the ddgps_load_google_script filter. For analytics, enable the analytics setting and connect the ddgps_allow_analytics filter. Both filters default to false. Return true only when the corresponding visitor consent is present. For example, in a site-specific integration, replace the example functions with your CMP’s actual consent API:

add_filter( 'ddgps_load_google_script', function ( $allowed ) {
    return function_exists( 'my_cmp_google_consent' ) && my_cmp_google_consent();
} );

add_filter( 'ddgps_allow_analytics', function ( $allowed ) {
    return function_exists( 'my_cmp_analytics_consent' ) && my_cmp_analytics_consent();
} );

A consent integration must account for page caching. Do not share consent-dependent cached HTML or JavaScript settings between visitors with different consent states. Configure your cache to vary by consent or bypass caching for those responses, purge caches after settings or consent changes, and ensure the CMP blocks or reloads external functionality on consent withdrawal. If this cannot be guaranteed, keep the external features disabled and use the direct link.

Why is there a direct link instead of the official button?

The direct link is the privacy-preserving default and also the fallback if the SDK is blocked or fails to render. Google’s SDK may need to be excluded from script minification and delayed execution, but must not bypass consent. Google’s native button availability depends on the service. The custom link uses an independent star icon rather than reproducing Google’s trademarked logo.

Do local click statistics measure confirmed additions to Google favorites?

No. They are approximate interaction counts, not confirmed additions in Google. The total is cumulative and the breakdown retains up to 200 content records. A site-wide rate limit reduces automated abuse without storing IP addresses or visitor identifiers. The public endpoint uses a WordPress nonce, which is refreshed if expired on a cached page; a nonce is not proof of a unique human visitor. Clicks inside external cross-origin frames, browser restrictions, cached content or concurrent requests may affect the counts.

What data is stored locally?

The plugin stores settings, optional aggregate click counts and optional diagnostic entries in the WordPress options table. Click counts include public post IDs, titles and public URLs, or a general counter. New counts do not store IP addresses, per-visitor identifiers or individual click timestamps. Earlier versions may have stored a last-click timestamp and short-lived hashed-IP rate-limit transients; new versions do not generate them. The diagnostic log stores display decisions, post details and timestamps, with at most 50 entries. Reset click statistics and Clear log remove their respective records. Deactivation preserves data; uninstall deletes plugin options and the current rate-limit transient for each site, including multisite. Closing the floating notice stores only ddgps_floating_dismissed in sessionStorage, for the duration of the browser tab session. No digitalDot telemetry is collected or sent.

Can a subdirectory be selected separately?

Google manages favorites at the domain or subdomain level. Use the domain check in Settings and consult the Google documentation for eligibility.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“digitalDot Favorites for Google” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.4

  • Update the plugin display name, admin screens, default button text, call to action, accessibility label and suggested privacy policy to Google Favorites.
  • Use the new Google Favorites direct link for all custom and fallback links and the admin domain check.
  • Keep Google’s documented JavaScript SDK, API methods and HTML attributes unchanged; the official button adopts the new branding automatically.
  • Add a settings notice explaining the branding update and how to review existing custom text.
  • Refresh the external service documentation, installation and upgrade instructions, FAQ and translation-ready English strings.
  • Preserve the WordPress.org slug, text domain, shortcode, settings, diagnostic logs, click statistics, consent behavior and existing preferred_source_click analytics event.

1.0.3

  • Remove the free-form CSS setting, its editor, sanitization and inline output; discard the obsolete setting on upgrade.
  • Use the prefixed [ddgps_preferred_source] shortcode exclusively and update all help text and copy controls.
  • Align the directory, main PHP filename and all gettext text domains with the official WordPress.org slug digitaldot-preferred-sources-for-google.
  • Use WordPress.org language packs instead of bundled translation files and manual translation loading.
  • Prefix localized JavaScript configuration objects and keep the Google SDK instance in private script scope.
  • Update the Google Analytics Terms of Service link to Google’s public language index.
  • Retain supported settings, existing aggregate statistics, diagnostic logs and consent integrations.

1.0.2

  • Normalize the directory slug, plugin filename and translation text domain.
  • English readme and source strings; Spanish PO/MO and POT files; translator comments and ordered placeholders.
  • Remove hidden placeholder files and include the GPL license.
  • Protect public click requests with a nonce, POST validation, a bounded site-wide rate limit and settings checks. Support nonce refresh for cached pages.
  • Require opt-in for the external SDK and local statistics; require visitor consent filters for SDK and analytics. Keep a local direct link available.
  • Avoid storing visitor IP hashes or individual click timestamps for new statistics. Add statistics reset, public content validation and multisite cleanup.
  • Use WordPress enqueue APIs for the styling feature that was subsequently removed in 1.0.3.
  • Preserve the existing administration screens, settings keys, statistics and diagnostic log. Keep redirects for legacy menu URLs.
  • Document external services, privacy practices, consent integration and upgrade steps.

1.0.1

  • Add an independent Preferred Sources menu with separate Settings and Click statistics submenus.
  • Preserve existing options, statistics, diagnostic logging and button behavior.

1.0

  • Initial release.