“What’s in a name?” — William Shakespeare, talking about websites
Context: That’s Not My Site’s Name!
There’s a slight issue in search results for this blog:

I’ve changed the title to “Definitely Not My Blog’s Name”, but there is definitely the name of another site there. It’s not a good look! It’s not entirely clear what one can do about it either. A cursory search turned up a result on WebmasterWorld — which I remember frequenting about twenty-danged years ago! — which pointed me in the direction of the horse’s mouth: Google Search Central, and their “Site Names In Google Search” advice.
When Google lists a page in search results, it shows the name of the site the page comes from. This is called the site name. Note that the site name is different from the per-page title links (title links are specific to each web page, whereas the site name is for the entire site).
Yup, that’s what we’re looking for. Let’s cut to the chase and see what we can do about it:
Add the required properties to the home page of your website, in either JSON-LD, RDFa, or microdata format. You don’t need to include this markup on every page of your site; you only need to add this markup to the home page of your site.
They give an example, but here’s mine:
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "WebSite", "name": "Rob's Blog", "alternateName": "Rob's Blog on Tech and Life", "url": "https://blog.roberthallam.org" } </script>
That seems good enough for now. I threw in a slightly twee alternateName
just to have something there; with much the same vibes as “quicksave twice, just to be sure it took”.
I then popped over to Google Search Console (which apparently is no longer called Google Webmaster Tools, aw) and requested a reindex of my homepage to hopefully cajole GoogleBot into picking up the schema changes.

It’s kinda odd that they say one of the referring pages is a seemingly-random tag feed, but oh well. A few impenetrable mysteries has been part and parcel of dealing with google for, well, the past twenty-plus years at least.
One particular piece of advice I remember people regularly shared was to never, never ever, definitely do not ever click on AdSense ads — not even accidentally — if you wanted to be part of the program, because they would be able to detect that single click was inappropriate and kick you out the program. Because there were rumours of one person making $1M a month from the AdSense program (a user on WMW who later shared what they did), folks took it to heart.
Adding Schema to WordPress
First up, there is a Schema plugin which I am apparently using: Schema.
(looks like oneboxing plugins works, neat!)
I checked its settings but I couldn’t find one for including the site name on the home page. Plus I wanted to DIY it as there’s a couple things I’d like to tweak, like having ASB check the site disallow list… but that’s another topic for another time.
I wrote a small plugin to hook into wp_head
and insert the schema listed above. I had it using get_bloginfo('name')
and get_bloginfo('url')
, but I hard-coded (!!) my own name to avoid an HTML entity on the apostrophe in “Rob’s”. Admittedly, I don’t actually know if that is better or not, but my gut says to go with the entity-less version in the first instance.
The code is pretty simple, but I may still pop it on GitHub or my own Gitea in case anyone wants to do something more with it. I guess an obvious extension would be to create a simple configuration page for customising the output; but I’m in the middle a bunch of things…
Here’s hoping this politely but firmly nudges Google to use the right site name 🤞
Gib Teh Codez
<?php /* * Plugin Name: Simple Website Schema * Author: Rob Hallam * Author URI: https://roberthallam.com * Description: Adds a simple schema to the site's home page header (to fix site name) */ defined( 'ABSPATH' ) || exit; /** * Adds a simple schema to the site's header on the homepage to fix site name * @see https://schema.org/WebSite * @see https://developers.google.com/search/docs/appearance/site-names */ function add_header_schema() { $site_name = get_bloginfo('name'); $site_url = get_bloginfo('url'); $jsonLd = '<script type="application/ld+json">' . PHP_EOL . '{' . PHP_EOL . ' "@context": "https://schema.org",'. PHP_EOL . ' "@type": "WebSite",' . PHP_EOL . ' "name": "Rob\'s Blog",' . PHP_EOL . ' "alternateName": "Rob\'s Blog on Tech and Life",' . PHP_EOL . ' "url": "'.$site_url.'"' . PHP_EOL . '}' . PHP_EOL . '</script>' . PHP_EOL; // only add the schema if we are on the home page if ( is_front_page() || is_home() ) { echo $jsonLd; } } // Add the function to the wp_head action add_action( 'wp_head', 'add_header_schema' ); /** Register the function to run in the wp_head action */ function simple_header_schema_init() { // empty } /** Unregister the function on deactivation */ function simple_header_schema_deinit() { remove_action( 'wp_head', 'add_header_schema' ); } /** Empty uninstall function */ function simple_header_schema_uninstall() { // No action needed on uninstall } register_activation_hook( __FILE__, 'simple_header_schema_init' ); register_deactivation_hook( __FILE__, 'simple_header_schema_deinit' ); register_uninstall_hook( __FILE__, 'simple_header_schema_uninstall' ); ?>