#Overriding Default Meta Tags

1 messages · Page 1 of 1 (latest)

icy egret
#

Has anyone been able to override the payload meta tags, I know in admin we can edit the favicon and og:image tag but was wondering on the rest. I tried to directly import import Meta from "payload/dist/admin/components/utilities/Meta"; but it only added my tags vs override the tags with the same property

#

I thought helmet handled this under the hood but possibly not, not sure

hard prism
icy egret
#

No luck :/

prisma ivy
#

Looking at the source code, this is currently not possible since these values are hard-coded into each view. Here's the default edit view, for instance https://github.com/payloadcms/payload/blob/ec2933c49a778f49eb1430ca43d71365df0e2a79/src/admin/components/views/collections/Edit/Default.tsx#L113. I see the value here, though. This could make a nice feature.

GitHub

Built with React + TypeScript, Payload is a free and open-source Headless CMS. [✩Star] if you support our work! - payload/Default.tsx at ec2933c49a778f49eb1430ca43d71365df0e2a79 · payloadcms/payload

#

What @hard prism is getting at might also work as a temporary solution. Try and render the Meta or Helmet components somewhere on the page after the line I pasted above. This way react-helmet consolidates your tags. You might be able to do this within a custom UI field component described here https://payloadcms.com/docs/fields/ui#ui-field

Payload CMS

Payload is a headless CMS and application framework built with TypeScript, Node.js, React and MongoDB