Skip to content

Home / Guides / Technical SEO

Technical SEO

Check blank settings when social previews go missing

Test missing and empty settings, check the final social tags and compare articles, pages and archives when previews go missing.

By Shane Rounce · 2 min read

“Leave this blank to use the default” sounds straightforward. The code has to agree.

If a preview disappears after a settings change, check whether an empty field means “use the default” or “output nothing”. I test that distinction on articles, pages and archives as well as the homepage, because different page types can take different routes through the code.

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.

Define the fallback once and use it consistently. Where blank is meant to select a default, trim the saved value and check both a missing setting and an empty string. Then repeat the check for every page type using that template.

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

Check any code that removes duplicate social tags. It needs to preserve the intended title and description, including when more than one component tries to provide them.

Inspect the final HTML after that clean-up runs. I use a clear owner for each piece of metadata to reduce the need for fragile clean-up in the first place.

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.

Need a hand with your next project?

I help with website care, with practical advice and hands-on work. Tell me what you are trying to improve.

Email Shane