SEO field preview doesn't show local fallbacks

This might be more of a feature request:

Iā€™ve noticed that the SEO field previews (for Google, Facebook, Twitter) will show the Global SEO Settings when left blank.

However, the actual SEO results for the page may pick up local Title and Image values. (I havenā€™t been able to make them pick up a local Description, but thatā€™s a different topic).

So, the preview in the SEO field pane becomes inaccurate, for records purposefully relying on derived local fallback values.

Is this something thatā€™s on the radar/roadmap already? I havenā€™t been able to find specific mentions.

Hi @alex.burner!

There is no way for DatoCMS backend to know which SEO values you will ultimately use in your code so the preview shows how your search-box will look like on Google Twitter etc. if you use exactly the values in that single SEO field, which is the result on the single record SEO settings and the global SEO fallback values.

I am not sure if I am getting your request right, would you prefer to have no preview at all?

Hello @Souljuse! In this case, Iā€™m assuming most people are using DatoCMSā€™s _seoMetaTags method, as advised by the docs: SEO and favicon ā€” DatoCMS

Meta tags are generated merging the values present in the recordā€™s SEO meta tags field together with the Global SEO settings you can configure under Content > Settings

If the record doesnā€™t have a SEO meta tags field, the method tries to guess reasonable values by inspecting the other fields of the record (single-line strings and images).

For this request, Iā€™m hoping the SEO preview could show the result of the _seoMetaTags query on the resource in question.

Thinking about this more, we actually would prefer no preview, at least as a short-term fix. Perhaps an option to turn it off in the SEO meta tags field, under Presentation settings?

As it stands, the site weā€™re building consistently uses _seoMetaTags and the corresponding renderMetaTags() React helper (GitHub - datocms/react-datocms: A set of components and utilities to work faster with DatoCMS in React environments) ā€” so weā€™ll have to warn the client to ignore the preview pane, unless theyā€™re setting explicit local SEO values on a record.

But our long term ideal would be the preview pane accurately reflecting _seoMetaTags

@alex.burner just to check if Iā€™ve understood correctly, you are suggesting to show the fallback title/image in the preview if the SEO field is empty, rather than showing the global fallback, right?

That looks good to me. I agree thatā€™s what I would expect as well. Iā€™ll open a task internally

Yep @mat_jack1 thatā€™s exactly right. Thanks for opening an internal task!

@alex.burner this was actually a regression, thanks for reporting. The title field was actually working, but not the image field! This has been fixed now!

Excellent, I see it working now! Thanks all for being so responsive.

FWIW this is personally my first time using DatoCMS, and Iā€™ve been thoroughly impressed so far. We built this whole client site much faster than expected: every feature we were hoping for was present, we could model everything we wanted (minus a ā€œrepeatableā€ for fields - but Links + separate Models gave us everything we needed there), and the editing experience is amazing (infinite nesting ā€œcreate new recordā€ modals, with full save/publish experience on each layer, so nice).

We just bumped up to a paid account and are unleashing content editors into the CMS next week.

1 Like

thank you very much for the nice feedback!! :slight_smile:

1 Like