“Leave this blank to use the default” sounds straightforward. The code has to agree.
In June 2026 I traced missing page titles and social descriptions to saved template settings. The fallback handled a setting that did not exist, but not a setting saved as an empty string. The homepage used a different route through the code, so checking only that page made the site look healthier than it was.
Empty is a product decision
Sometimes an empty value means “please show nothing”. Sometimes it means “I have not customised this”. Those are different instructions, and I want a settings screen to make the distinction clear.
For these title and description templates, the intended behaviour was to use a sensible default. I added one resolver that trimmed the saved value and fell back when it was empty. Every relevant template lookup then used the same rule, rather than fixing one page type and leaving the others behind.
In PHP, the null coalescing operator only handles a missing or null value. It does not consider an empty string to be missing. That small detail was enough to empty several bits of otherwise valid page output.
A second trap: cleaning up your own output
Related work found a de-duplication step that was removing the social title and description it was meant to preserve. It was looking for matching tags without reliably keeping track of which component had written them.
The immediate fix made ownership explicit and preserved the intended pair. The broader lesson is the one in my note on metadata ownership: fewer competing emitters means less fragile clean-up afterwards.
The checks that caught it
- An unset template, an empty template and a whitespace-only template.
- A real custom value, to make sure the fallback did not override it.
- The homepage, a normal article, an archive and a product-shaped page where relevant.
- The final HTML after every output filter had run.
- A fresh public response after clearing the relevant cache.
A social network may keep its own cached preview, so I first check what the website is currently returning before chasing the platform’s refresh behaviour.
This is why I like maintenance work that includes the quiet parts of a site. A page can still look fine to a visitor while its title, preview or other supporting information has quietly gone missing.