Description
Haghs Preferred Source Button for Google lets your visitors add your site — or the exact post/page they’re reading — to their Google Preferred Sources with a single click, using Google’s official google.com/preferences/source link format. No API keys, no OAuth, no tracking scripts. Just a fast, simple button.
This plugin is developed independently by Benjamin Hagh Parast and is not affiliated with, endorsed by, or sponsored by Google. “Google” and “Preferred Sources” are referenced only to describe the feature this plugin links to.
Features
- Fully customizable button text
- Choose where the button appears automatically: Header, Footer, Before Content, After Content, Navigation Menu, Floating Left, or Floating Right
- Show the button on any public post type – Posts, Pages, or any custom post type registered by your theme or other plugins – defaults to Posts only, since blog content usually carries the repeat-visit value
- Uses the exact permalink of the post/page being viewed, so visitors prefer the specific content they found, not just your homepage
[hpsbg_button]shortcode for manual placement anywhere, with optionaltextandurloverrides- Open link in a new tab (optional)
- Built-in guidance in the settings screen on Google’s Preferred Sources eligibility requirements, with links to check your own domain and to Google’s official documentation
- Clean uninstall — removes its single settings option, no leftover data
- No external libraries, no database tables, minimal CSS footprint
About Google Preferred Sources
Preferred Sources is a feature from Google that lets people choose the sites they want to see more of in Top Stories, AI Overviews, and other personalized search surfaces. There is no submission or application process — Google determines eligibility automatically by crawling and evaluating a site. Only domain-level or subdomain-level sites are eligible (a subdirectory such as example.com/blog never qualifies on its own), and eligibility is generally tied to publishing fresh, regular content that Google would also consider for Top Stories.
You can check whether your own domain is currently eligible at google.com/preferences/source, and read Google’s own guidance at Google Search Central’s Preferred Sources documentation. This plugin’s settings screen links to both, since the button itself is only useful once your site already qualifies — it cannot make an ineligible site eligible.
Installation
- Upload the plugin files to the
/wp-content/plugins/haghs-preferred-source-button-for-googledirectory, or install the plugin through the WordPress Plugins screen directly. - Activate the plugin through the ‘Plugins’ screen in WordPress.
- Go to Settings Preferred Source Button to configure the button text and placement, and to check your Google eligibility.
- Optionally use the
[hpsbg_button]shortcode anywhere you want manual placement.
FAQ
-
Does this plugin use any Google API or require an API key?
-
No. It links directly to Google’s public preferences URL. No keys, no authentication, no tracking.
-
Will it show my homepage or the specific post URL?
-
When a visitor is viewing a single post or page, the button uses that exact page’s URL. The “Fallback URL” setting is only used in contexts without a single post/page in view (e.g. archive pages or the navigation menu).
-
Yes — under Settings Preferred Source Button, choose Header, Footer, Before Content, After Content, Navigation Menu, Floating Left, Floating Right, or disable automatic placement and use the shortcode only.
-
Can I show it only on blog posts and not static pages?
-
Yes. By default the button only shows on Posts. The “Show On” list includes every public post type on your site (Posts, Pages, and any custom post types like Portfolio, Products, etc.) so you can pick exactly which content types get the button.
-
My site doesn’t appear in Google’s preferences tool – why?
-
That’s a Google eligibility decision, not something this plugin controls. See the “About Google Preferred Sources” section above, and the link to Google’s own documentation in the plugin’s settings screen.
-
Is this plugin affiliated with Google?
-
No. It is an independent, unofficial tool that links to a publicly available Google URL. “Google” and “Preferred Sources” are used descriptively only.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Haghs Preferred Source Button for Google” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Haghs Preferred Source Button for Google” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.2.0
- Renamed plugin and slug to avoid trademark/naming confusion
- Prefixed all functions, classes, options, constants, and the shortcode tag with
hpsbg/HPSBGto avoid collisions - Added an eligibility information section to the settings screen, with links to check your domain and to Google’s official documentation
1.1.0
- “Show On” now lists every public post type (not just Posts/Pages), including custom post types
- Default changed to Posts only, since blog content is usually where repeat-visit value lives
1.0.0
- Initial release: customizable button text, placement options, post type targeting, per-post permalink targeting, and shortcode support.