So I received a simple request from a client this morning:
“Could you add a little trademark logo to show up after our company name in search results, like Amex does?” complete with a grainy screenshot

“Hah, piece o’ cake!” I think to myself. So I quickly go into the site’s admin dashboard, Settings > General and toss a little ® into the Site Title field and hit Save Changes. Then I lean back, sip my coffee, and mentally high-five myself for putting my Computer Science degree to such rewarding use.
Then I start typing up a jovial email about how I slayed this task in mere minutes — wait wtf… the <title> element on the homepage is slightly different than what I just entered, it even has an extra tagline! Ahhhh right, site taglines — that is sometimes an option within the Theme settings. (Yes yes I know, the tagline also shows up in the General settings, but I’m trying to list out some possibilities here. Bear with me! No, not bare.) Here I go once more, back into the Dashboard!
In the sidebar, I go to Appearance > Customize to bring up the theme customization options, and lo and behold there is a tab for Site Identity which contains two fields: ‘Site Title’ and ‘Tagline’. Nailed it! I’ll just go ahead and add that pesky little ®… wait, this tagline doesn’t match what I’m currently seeing either. WHAT is going on here?!? Why is none of this matching up? Why are there multiple places to (attempt to) change the same thing?
Okay, it’s time to start digging into The Guts™.
Starting off with a simple View Source, I take a look at where the tagline is coming from and what it’s surrounded by. Okay cool, I recognize a custom css <link>
— sitting right next to the offending <title>
element — and I remember setting up that css link in the header.php file of the child theme. Maybe I hardcoded the title and tagline like a -total asshole- silly goofball during the latest site facelift I worked on. And of course, in the header.php file right after the custom css line, what do I see?
<?php wp_head(); ?>
🙁
So naturally, off we go to the WordPress docs to see what exactly that little nugget of magic might be doing. It looks like the general idea is: this hook allows many/multiple things to be inserted by themes and/or plugins as needed, as long as the things are registered as ‘wp-head’ actions. Super.
Okay you know what, I’m already SSHed into the server filesystem let’s just bruteforce this badboy. The tagline has some very specific keywords (for the sake of client anonymity let’s say the tagline contained “Wow Such Savings”), so I’m just going to grep through the theme for that phrase:
> grep -rnw . --pattern "Wow Such Savings" > 0 results
Okay I probably got the grep syntax wrong let’s try something else I know is for sure in there:
> grep -rnw . --pattern "known phrase" > 42 results
Damn when did I get so good at grep? Okay maybe the tagline is sitting in the parent theme somewhere. Or maybe even some WP configuration file. Let’s go to THE ROOT web directory. This is everything, it’s gotta be sitting in there:
> grep -rnw . --pattern "Wow Such Savings" > 0 results
Okay. Out of curiosity, let’s see where all wp_head() gets called, and lets check out all the places that ‘wp-head’ actions are registered.
*grepping intensifies*
It turns out: lots of places. Themes, plugins, templates, includes, blah, blah blah. As the codex said: “it is one of the most essential theme hooks… WordPress core uses this hook to perform many actions.” Yes indeed. But one result did jump out at me: the Yoast SEO plugin (which shows up as ‘wordpress-seo’ in the file system). I almost forgot about that one — back to the Dashboard!
Moments later, in the ‘SEO’ sidebar menu I see a glimmer of hope: “Search Appearance”. I mean this is EXACTLY what the client was talking about, he wants to change his search appearance, this must be a sign!
Nope. Just another place to put in the site title that doesn’t match what I’m actually seeing in the browser tab and search results. Ugghhhh.
After that, things get a little dark and I start just desparately going through every option in Yoast and then the rest of the Dashboard, (which is also when I realize there are a couple of new critical issues in my Site Health report…dammit! Add that to my checklist of things to do if I ever return from this “simple request”.) Whilst mindlessly wading through all of this stuff, another thought occurs to me: maybe the old theme settings are still being used somehow?
For a little more background: In our haste to launch this site’s redesign, we left a couple of “invisible” (to the client) things laying around that were still on our “take care of these when budget allows” list. On this list were two things that should be paid more attention to by WordPress site admins: unused themes and plugins. Many people assume that just because they’re not using these themes, or because they de-activated the plugins, they don’t have to worry about them anymore and think “hell why would I even waste time updating these?”. Well the short answer is: security. Just because you and your site are not personally using the code contained within these leftover files and folders, doesn’t mean that someone else won’t figure out a way to do just that. This is one of the most common ways WordPress sites get pwned, and here’s a great write-up on the topic if you want to go more in depth:
https://www.wordfence.com/learn/introduction-to-wordpress-security/#finding-and-installing-plugins
So I could probably just delete the old theme folder and see what happens to the site title (super tempting!), but at this point I’m invested and I’m too curious to see exactly where this “Wow Such Savings” text is actually hiding.
Alternatively, I could just activate the old theme again to check out its settings but HOLY COW DON’T DO THIS ON THE LIVE SITE OR YOU MIGHT REALLY UPSET YOUR CLIENT AND CONFUSE THEIR CUSTOMERS.
And of course, I do have a proper Dev -> Test -> Production pipeline set up, so I could go mess with Dev/Test to my heart’s content, but I wanted to explore another route first. Since I’m fairly certain this text isn’t contained anywhere in the file system (I did a couple extra searches to see if someone did something cheeky like 'proper_case("wOw sUch sAvIngs")'
, etc.), it’s time to visit one of my favorite* places: The Database.
* no really, database design and management were some of my elective courses in college and these skills have made up a BIG chunk of my career so far. And I do <3 me some SQL queries.
I know from experience that A LOT of stuff gets crammed into the wp_options
table, and it’s also an important one to be familiar with for doing things like site transfers (like when you need to update ‘siteurl’ and/or ‘home’ but you can’t access the dashboard anymore because you botched some DNS entry or configuration setting (face_whistling)). So let’s start there!
select *
from wp_options
where option_value like '%Wow Such Savings%'
Nada.
Now I’m thinking “okay I could pick a few more tables at random, or set up some sort of SQL function or stored procedure to loop through all of the tables and check all of the columns – wait, scratch that. I’m going to dump the database and do a text search.” I know this won’t be feasible for some clients whose databases are gargantuan, but for this particular client we’re talking less than 100MB. There are a few ways to go about doing this, for example you could use the mysqldump command line tool, or do an export with your database management tool of choice (I’m currently using Sequel Pro).
In my case, I already had a .sql dump file sitting on my computer from recently syncing up my dev environment, so I throw that badboy into Sublime Text to see what I could sniff out (yes yes, I could do more grepping and/or finding from Terminal, that would be more l33t, but sometimes a guy just wants a GUI okay?!).
HOOOO DOGGY I see my unique phrase show up in 3 places! Let’s see where that sucker is hiding.
Well, two of them were found within the content of site pages/posts, so that left one.
Turns out, it was contained within the ‘meta_value’ column of the wp_postmeta
table, matching up to the ‘_yoast_wpseo_title’ key. Dammit Yoast, I thought we talked about this already?!? Wait a minute, I just thought of one more place I didn’t look in the Dashboard.
Homepage > Edit
Scroll down past the content area
Drop-down the stupid Yoast SEO box.
Drop-down the stupid Snippet Preview box in the SEO tab.
Edit Snippet > SEO Title

Dammit.
And yes my coffee is cold now.
®